BDT uses a macro, BDTXUEX, to transfer control to user exit routines.
The BDTXUEX macro either calls or branches to each routine, depending
on whether the routine is in the BDT address space or the link pack
area:
- BDTXUEX uses the BDTXCALL linkage to reach user exit routines
that are in the BDT address space. The calling module’s registers
are saved in BDTGRSV prior to invoking the exit routine, the exit
routine is linked, and exit processing is performed. Return to the
calling routine is through register 14, and includes a return to BDTGRSV
to reload the calling routine’s registers before returning control
to the calling module. (Refer to Figure 1, part A, for a representation of this processing.)
- BDTXUEX uses a BALR instruction to reach user exit routines that
are in the link pack area (always BDTUX28 and usually BDTUX08, BDTUX10,
and BDTUX19). As a result, the caller’s registers are not saved, nor
are the registers automatically restored upon return; this is your
responsibility when coding these exit routines. The BDTXCALL linkage
cannot be used in this case: the registers are not saved in BDTGRSV
because the BDTXCALL linkage has no access to the BDT TVT. Return
to the calling module is direct with use of a BR14 instruction. (Refer
to Figure 1, part B, for a representation
of this processing.)
Note: The BDTXUEX macro considers all return codes other than
a multiple of 4 to be invalid.
Figure 1. BDTXUEX exit routine linkage conventions