When an AR mode program receives control, and does not want to
use the linkage stack, its caller must have provided an area large
enough for the target program to save the 64-bit GPRs and the ARs
into (at least 216 bytes). The AR mode program would:
- Issue STMG to save the 64-bit GPRs into the caller-provided save
area.
- Issue STAM to save the ARs into the caller-provided area.
- Establish a GPR as a base register and load an ALET of 0 into
the corresponding AR. An ALET of 0 causes the system to reference
storage within the primary address space.
- Issue IAC to save the current ASC mode.
- Switch to a suitable ASC mode for continued processing.
- Allocate a new save area.
- Save the saved ASC mode and the calling program's AR13 into the
new save area.
- Store the address of the caller's save area into the back chain
field of its own save area.
- Store the address of its save area into the forward chain field
of the caller's save area.
- Save "F7SA" at offset 4 to indicate how the calling program's
registers were saved.
See Example.