Intel 8085 VCR User Manual


 
CHAPTER
5
PL/M
LINKAGE
CONVENTIONS
With the relocation feature, it
is
possible for an assembly language program module
to call a procedure originally coded in
PL/M.
(PL/M
procedures can also call
assembly language modules.)
Linkage between assembly language modules and
PL/M
procedures should follow
the linkage conventions
of
PL/M.
Formal parameters declared
in
a procedure definition are treated as locally-defined
variables for the
PL/M
procedure.
That
is, each parameter
is
allocated storage se-
quentially in memory as if it were a variable local
to
the procedure. During pro-
cedure invocation, actual parameters are evaluated, and the results assigned to the
corresponding formal parameters. Parameters are passed as follows:
A single BYTE parameter
is
passed in register C. A single ADDRESS parameter
is
passed in register B (high-order byte) and C (low-order byte).
If
there are two parameters, the first
is
passed as described above; the second
is
passed in registers D (high-order byte, if any) and E (low-order byte).
When there are more than two parameters, the last two are passed as described
above, and the remainder are passed via the stack.
All actual parameters are copied into the locations
of
the formal parameters upon
entry to the procedure.
CPU registers are used to hold results returned by procedures which have the BYTE
or
ADDRESS attribute. In the case
of
a BYTE procedure, the value
is
returned in
the accumulator, while
an
ADDRESS procedure returns the low-order byte in the L
register and the high-order byte in the H register.
5-1