Saving the calling program's registers
Unless otherwise defined by the individual interface, the calling program expects upon return:
- The low halves (Bits 32-63) of GPRs 2 - 13 are unchanged
- The high halves (Bits 0-31) of GPRs 2 - 14 are unchanged
- ARs 2 - 13 are unchanged
- FPRs 8 - 15 are unchanged; The Floating Point Control (FPC) Register is unchanged except for two fields: the IEEE exception flags and the data exception code (DXC).
- Vector registers (VRs) 8 - 15, bytes 0 - 7, and the entirety of VRs 16 - 23 are unchanged.
- When return information is provided in GPR 0, 1, or 15 (for example return and reason codes), only bits 32-63 of the register contain the returned value.
At entry, all target programs save the caller's registers; at exit, they restore those registers. The two places where a program can save registers are in a caller-provided save area or in a system-provided linkage stack. The ASC mode of the target program determines how the target program saves the registers. A primary mode program can use the linkage stack or the save area its calling program provides. An AR mode program must use the linkage stack, unless the caller provides a save area large enough to save both the access registers (ARs) and the 64-bit general-purpose registers (GPR).