Language Environment dynamic storage area – non-XPLINK

A DSA (dynamic storage area) is an extension to the save area described in the OS Type I linkage convention. The DSA is described in Figure 1. Note that DSAs are sometimes referred to as stack frames. This DSA is used by exception handling and Debug Tool services. A macro is provided for assembler language programs.

Figure 1. Language Environment Dynamic storage area – non-XPLINK format
Dynamic storage area – non-XPLINK format

R13 addresses the currently active DSA or standard system save area. The DSA is required for all callers of Language Environment services. A DSA is allocated every time a block is entered and might be extended for member use. For the code sequences to allocate or extend a DSA, see Allocate/extend/return storage in user stack and Allocate/return storage in library stack.

All DSAs and save areas are backward-chained. A stopping DSA, known as the dummy DSA, the zeroth stack frame, or the zeroth DSA, indicates the first DSA on the stack. The DSA layout includes all fields used/accessed by Language Environment and language-specific components.

Notes on DSA Format:
  1. IBM® language products use these two bytes. All other products must set these two bytes to X'0000'.
  2. This field must be initialized.
  3. This field is not used by Language Environment but is reserved for compatibility. If it is used, it is the standard forward chain of save areas.
  4. This area should only be used to save the caller's general registers. General registers R14 through R12 are saved during prolog and restored during epilog. Bit 0 of R14 indicates the AMODE of the caller.
  5. The member-defined fields are established by the caller.
  6. This field is reserved for Debug Tool use. It is currently used by the compiled code EXecute hook mechanism.
  7. This field is used by the Language Environment library routines.
  8. If any vendor package calls a PL/I application, the caller's DSA must have the address of the PL/I LWS. Before calling PL/I user or library routines, the application must pick up the address of the LWS from the CAA (CEECAALWS) and store it into the DSA at CEEDSALWS.
The following is the minimum set of DSA requirements:
  • CEEDSANAB must contain a valid NAB (Next Available Byte).
  • CEEDSAMODE does not need to be initialized.
  • CEEDSABACK must be properly set.
  • R14 and R15, used as the linkage registers, must be saved in the appropriate offsets within the DSA.

Non-Language Environment DSAs can be in the save area chain. Routines that scan the stack should be aware that the length of the save area and the saved register contents might not conform to Language Environment conventions.