Save area (48 bytes)

This area is always present when a stack frame is required. It holds up to 12 registers. The first two words hold, optionally, GPRs 4 and 5, which contain the address of the previous stack frame and the environment address passed into the function. This is followed by the two words containing GPR 6, which may or may not hold the actual entry point address (depending on the type of call), and GPR 7, the return address. GPR 8 through GPR 15, as used by the called function, are saved in the following 32 bytes. Table 1 shows the XPLINK register conventions.

Except when registers are saved in the prolog, this area may not be altered by compiled code. The PPA1 GPR Save Mask indicates which GPRs are saved in this area by the prolog.

Stack overflow is detected when the STM instruction stores into the write-protected guard page while trying to save the registers in this save area.

Storage of the Backchain field in the save area is triggered by the optional XPLINK(BACKCHAIN) compiler option (or at the convenience of the compiler). This adds slightly to the cost of the prolog code, but may increase the serviceability characteristics of the application by providing a DSA backchain pointer in the save area. Note that this backchain pointer may or may not be valid, depending on the options specified when a function was compiled.

The third slot in the save area contains the value in GPR 6 on entry to the routine. If the routine was called with a BASR instruction, this will be the address of the function's entry point. The fourth slot contains the return address. The return point can be examined to determine how the function was called: if with a BASR instruction then the entry point address can be found in the third slot of the save area; if with a branch relative instructive, then the entry point can be computed from the return address and the branch offset contained in the branch relative instruction.