User`s guide

How the MACRO Compiler Functions on Different Platforms
2.6 Declaring a Routine’s Register Use
If you are not using the VAXREGS optimization option or any of the Alpha or
Itanium registers, the input mask is used only to document your routine.
2.6.2 Output Argument for Entry Point Register Declaration
The output argument indicates those registers to which the routine assigns
values that are returned to the routine’s caller. In many cases, the routine itself
modifies the register; in others, the routine calls another routine that deposits the
output value. In the latter case, known as the pass-through output technique,
the other routine must also declare the register as output in its routine entry
register set.
The use of this argument prevents the automatic preservation of registers that
are modified during the routine. Any register included in this argument will not
be preserved by a .CALL_ENTRY or .JSB_ENTRY routine, even if it is modified
by the routine.
The output argument informs the compiler that the registers specified have
meaningful values at routine exit and are unavailable for use as temporary
registers even after the last 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 output argument only 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 output when using the
VAXREGS optimization, so it is not necessary to specify VAX registers in the
output 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 output in the output argument, the compiler may use the register as a
temporary register, corrupting the output value.
For .JSB32_ENTRY routines, since no registers are preserved by default, the
output argument is used only to document your code.
OpenVMS Alpha systems only: For the VAXREGS optimization, all registers are
assumed to be output, and the output argument is used only to document your
code.
2.6.3 Scratch Argument for Entry Point Register Declaration
The scratch argument indicates those registers that are used within the routine
but should not be saved and restored at routine entry and exit. The caller of the
routine does not expect to receive output values in these registers nor does it
expect the registers to be preserved.
The use of this argument prevents the automatic preservation of registers that
are modified during the routine. Any register included in this argument will not
be preserved, even if it is modified by the routine.
2–14 How the MACRO Compiler Functions on Different Platforms