The following list shows register usage and linkage.
GPR0 => writable Static Area (WSA)
GPR1-3 => arguments (depending upon type)
GPR4-12 => preserved
GPR12 => CAA, the key Language Environment control block
GPR13 => the caller's stack frame in the Language Environment stack.
Each such stack frame begins with a 36-word save area.
GPR14 => the return point in the caller's routine
GPR15 => the entry point in the called routine
FPRs => arguments (depending upon type)
VR24-31 => arguments (depending upon type)
Some of the caller's arguments are placed in registers and the
remainder in a portion of what will be the callee's stack frame. With
FASTLINK the caller enters the called routine at an offset of 16 bytes
from the called routine's entry point.
Note: - The module is assumed to be readonly and never changed during
execution, in particular the eyecatcher, frame size or offset to PPA1
do not change during execution.
- The frame size field in the prolog above is owned by the compiled
module and the value it contains is whatever is required by the prolog
of the routine. It does not necessarily contain the precise value
of the dsa size. For example, in C++ vararg routines, it contains
the size of the fixed portions of the stack frame. Since the frame
size may change from one call to the next and the size of the argument
area is passed from the caller to the callee, a runtime calculation
of the actual dsa size is required.
- The eyecatcher is changed slightly to signify that this procedure
uses the FASTLINK dsa layout and is thus prepared for future support
of extended addresses.
FASTLINK is designed to operate in conjunction with the
Language Environment-provided
execution stack. The current stack pointer is maintained in GPR13.
The prolog of a
Language Environment-enabled
routine may allocate space (referred to as a "frame", "stack frame"
or "dsa") in this stack for its own purposes and to support subsequent
calls to other routines. The stack frame is an architected area that
contains the following
subtopics:
- A save area to be used by any routines called by the executing
routine for saving registers and other values as architected. This
save area, which is the first sub-section in a Language Environment stack
frame, is pointed to by GPR13, and begins with a 36-word OS save
area.
- A link area reserved for Language Environment defined
use. This area contains a number of architected fields used by languages
and glue code.
- The argument area where the caller of this routine places arguments
when more arguments exist than can be passed in registers.
- The near auto area used to guarantee a register spill area within
4K of the stack pointer.
- The work area where scratch and or automatic variables are located.