This section discusses some programming considerations you need
to be aware of when using the calling-standard macros.
1 – Making Multiple Calls From the Same Routine
The $CALL macro generates the following instruction sequence:
LDQ R26, code_address_offset(Rls) ; load code address
LDQ R27, procedure_descriptor_address_offset(Rls) ; load procedure
; descriptor
; address
JSR R26, R26 ;
The contents of R26 and R27 are erased as a result of using the
$CALL macro. This is important since Rls in the previous sequence
is typically R27. Thus, if you require subsequent access to your
linkage section, such as when making subsequent calls, you need
to make a working copy of R27 to use after the first call.
Note that $CALL also overwrites the values in the argument
registers, and the scratch registers specified or the default
set by the SCRATCH_REGS argument, when you pass arguments to the
called routine.
2 – Nonstandard Linkage
Under certain circumstances, there may be advantages in using a
nonstandard routine linkage.
3 – Routine Restrictions
Different routine types have different capabilities and
restrictions. For example, only a stack routine that specifies
BASE_REG_IS_FP=TRUE can make standard calls.
4 – Syntax Rules
You can use either positional or keyword argument association
or a combination of the two with these macros. For positional
association, the order of formal arguments is shown with
the format of each macro. The following syntax rules apply
when invoking the assembler using the command-line qualifier
/NAMES=AS_IS:
o When specifying macro names, you must use all uppercase or all
lowercase characters. You cannot mix uppercase and lowercase
characters.
o When specifying keyword arguments, you must use the same
alphabetic case as the macro name it is associated with. If
you use lowercase characters with the macro name, you must
use lowercase characters with the keyword argument. If you
use uppercase characters with the macro name, you must use
uppercase characters with the keyword argument.