The assembly code on the page after next was produced by the MPE XL Pascal
compiler from the Pascal source code shown on the next page. A few additional
notes concerning the code sample:
In the source code, an external call situation has been simulated by assuming
that the callee (one) resides in a different load module than the caller
(two).
The assembly listing has been abbreviated to include only the code associated
directly with the source code. In the complete listing, there would be calling
and called stubs for all calls to process initialization and termination
procedures (which occur in the outer block/main program as noted below)
preceding the section of code shown here.
Because the use of the CALLX millicode is transparent to the user, it has been
just referenced as being in system space to avoid all of the excess detail that
would be necessary to use actual addressing. A similar liberty has been taken
in a few other cases; where actual offsets appear in the code, they have been
eliminated to achieve simplicity.
The code sample is accompanied (in the left margin) by arrows that follow the
flow of control. These arrows function exactly as those used in the flow
diagrams in the text; in this case, the starting point is in the main program
block, near the bottom of the code sample. Furthermore, all
critical points have been labeled with numbers and documented on the
page following the assembly code (just as was done in the local call example).
The assembly code is lightly documented; the code used in the stubs is
documented in detail in Chapter 5, Import and Export Stubs, and the small
amount of code present other than in stubs is basically the same as that used
in any local procedure call.
A.7.1 Pascal Source Code
program ext call;
:
:
(* procedure one is in module 2; therefore an external call
is necessary in order for the call from two to be successful *)
procedure one (a,b : integer);
begin
end;
:
:
(* procedure two is in module 1, i.e. the same module
as the main program block. Bar calls one *)
procedure two;
begin
one (1,2);
end;
begin
two;
end.
A.7.2 Assembly Code
The numbers in parenthesis follow the flow of control and are used as labels
for the documentation that follows.