When an AR mode program receives control and uses the linkage stack,,
it would:
- Issue a BAKR instruction which will save the caller's 64-bit
GPRs and ARs on the linkage stack. (Although a primary mode caller
provides a save area, an AR mode target program would not use the
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
an address within the primary address space).
- Set GPR 13 to indicate that the caller's registers are saved
on the linkage stack:
- If the program creates a save area, obtain a 72-byte save area
on a word boundary (or 144-byte or larger save area on a doubleword
boundary if routines called by this program need it) in the primary
address space.
- Set the second word of the save area to the character string 'F1SA'
if obtaining a 72-byte save area or 'F6SA' if obtaining a 144-byte
or larger save area
- Load GPR 13 with the save area address.
- Set AR 13 to zero to indicate that the storage resides in the
primary address space.
- If the program does not create a save area, do one of
following actions:
- Load 0 into GPR 13.
- Set the second word of a two word area in the primary address
space to the character string ‘F1SA’. Load the address of
the two word area into GPR 13.