User`s guide

How the MACRO Compiler Functions on Different Platforms
2.6 Declaring a Routine’s Register Use
Preserve
These register arguments are used to describe the usage of registers in the
routine and to instruct the compiler how to compile the routine. You can use the
register arguments to:
Override the compilers default preservation behavior (see Section 2.4.2 and
Section 2.5.1)
Indicate the nonavailability of registers for temporary compiler usage
Document routine register usage
Note
OpenVMS Alpha systems only: If you specify /OPTIMIZE=VAXREGS to
use VAX registers as temporary registers, you must declare all implicit
register uses with the input and output clauses to prevent their use as
temporary registers. When this optimization is enabled, the compiler can
use as temporary registers any registers that are not explicitly declared.
2.6.1 Input Argument for Entry Point Register Declaration
The input argument indicates those registers from which the routine receives
input values. In some cases, the routine itself does not use the contents of the
register as an input value, but rather calls a routine that does. In the latter case,
known as the pass-through input technique, the other routine should also
declare the register as input in its routine entry mask.
The input argument has no effect on the compilers default register preservation
behavior. Registers specified only in the input argument will still be treated by
the compiler exactly as described in Section 2.4.2 and Section 2.5.1. If a register
is used as an input and you want to change the default preservation behavior,
you should specify the register in the output, preserve,orscratch arguments
in addition to the input argument.
The input argument informs the compiler that the registers specified have
meaningful values at routine entry and are unavailable for use as temporary
registers even before the first compiler-detected use of the registers. Since the
compiler does not normally use any of the VAX registers (R2 through R12) as
temporary registers, specifying registers in the input argument affects compiler
temporary register usage in two cases:
OpenVMS Alpha systems only: If you are using the VAXREGS optimization
option. This optimization allows the compiler to use as temporary registers
any of the VAX registers which are not explicitly being used by the VAX
MACRO code. Note that for .JSB32_ENTRY directives, the compiler
always assumes that all the VAX registers are used as input when using
the VAXREGS optimization, so it is not necessary to specify VAX registers in
the input argument to prevent their use as compiler temporary registers.
If you are explicitly using any of the Alpha or Itanium registers (R13 and
above).
In either of these cases, if you do not specify a register that is being used as
input in the input argument, the compiler may use the register as a temporary
register, corrupting the input value.
How the MACRO Compiler Functions on Different Platforms 2–13