User`s guide

How the MACRO Compiler Functions on Different Platforms
2.4 Declaring CALL Entry Points
2.4.1 Homed Argument Lists
Examples of AP references for which the compiler automatically homes the
arguments include:
Storing AP or an address based on AP in another register
Passing AP or an address based on AP as a parameter
Adding a variable offset to AP to reference a parameter
Using variable indexing off AP to reference a parameter
Using a non-longword aligned offset into the arglist, such as 6(AP)
The compiler sets up the homed argument list in the fixed temporary region of
the procedure frame on the stack.
Although not mandatory, you can specify homing with two arguments to the
.CALL_ENTRY directive, home_args=TRUE and max_args=n.
The argument max_args=n represents the maximum number of longwords the
compiler should allocate in the fixed temporary region. The main reason for
using max_args=n is if your program receives more arguments than the number
explicitly used in the source code. A common reason for specifying home_
args=TRUE in a routine, which does not in itself require it, is the invocation
of a JSB routine that references AP. For such references, the compiler assumes
that the argument list was homed in the last .CALL_ENTRY routine, and uses
FP-based references. Because this may not always be a valid assumption, the
compiler reports an informational message when AP is used inside .JSB_ENTRY
routines.
If you want to suppress the informational messages that the compiler reports, use
both arguments.
If you omit one or both arguments and the compiler detects a use that requires
homing, messages are issued by the compiler, informing you of what the compiler
did. You can then make the appropriate changes to your code, such as adding one
or both arguments or changing the value of the max_args argument.
If you only specify home_args=TRUE, the following message is issued:
AMAC-W-MAXARGEXC, MAX_ARGS exceeded in routine routine_name, using n
This message is issued because you explicitly asked for homing but did not
specify the number of arguments with max_args. If the compiler does not find
any explicit argument reference, then it allocates six longwords on OpenVMS
Alpha systems and eight longwords on OpenVMS I64 systems. If the compiler
finds explicit argument references, it allocates the same number of longwords as
the highest argument reference found. (This message is also issued if you specify
a value for max_args which is less than the number of arguments found by the
compiler to be homed.)
If you specify only max_args, and if the compiler detects a reference requiring
homing, the compiler issues the following message:
AMAC-I-ARGLISHOME, argument list must be homed in caller
If you specify neither argument and the compiler detects a reference requiring
homing, the compiler issues the following messages:
AMAC-I-ARGLISHOME, argument list must be homed in caller
AMAC-I-MAXARGUSE, max_args value used for homed arglist is n
How the MACRO Compiler Functions on Different Platforms 2–9