XPLINK Assembler

The XPLINK support provided by the assembler macros EDCXPRLG and EDCXEPLG allows XPLINK C and C++ code to call routines that can be coded for performance, or to perform a function that can not be readily done in C/C++. The EDCXCALL macro allows XPLINK assembler to call routines in the same program object, or in a DLL. The following z/OS® Language Environment® books provide more information on XPLINK that may be useful to assembler programmers:
Coding XPLINK assembler routines differs from traditional non-XPLINK assembler in the following ways:

Table 1 shows the layout of the XPLINK interface. See z/OS Language Environment Vendor Interfaces for additional information about register usage and conventions, especially for details about passing parameters with XPLINK. For information on the registers which are saved in the register savearea of the XPLINK stack frame see z/OS Language Environment Programming Guide.

Table 1. Comparison of non-XPLINK and XPLINK register conventions
  Non-XPLINK XPLINK
Stack Pointer Reg 13 Reg 4 (biased)
Return Address Reg 14 Reg 7
Entry point on entry Reg 15 Reg 6 (not guaranteed; a routine may be called via branch relative)
Environment Reg 0 (writeable static) Reg 5
CAA Address Reg 12 Reg 12
Input Parameter List address in R1 Located at fixed offset 64 ('40'x) into the caller's stack frame (remember the 2K bias on R4). Additionally, any of General Registers 1, 2, and 3, and Floating Point Registers 0, 2, 4, and 6, may be used to pass parameters instead of the caller's stack frame.
Return code Reg 15 R3 (extended return value in R1,R2)
Start address of callee's stack frame Caller's NAB value Caller's Reg 4 - DSA size
End address of callee's stack frame Caller's NAB value + DSA size Caller's Reg 4
Where caller's registers are saved
  • R0-R12 saved in caller's stack frame
  • R13 saved in callee's stack frame
  • R14-R15 saved in caller's stack frame
  • R0 not saved, not preserved
  • R1-R3 not saved, not preserved
  • R4 not saved, recalculated (or saved, restored)
  • R5 not saved, not preserved
  • R6 saved in callee's stack frame, not restored
  • R7-R15 saved in callee's stack frame (R7 is the return register and is not guaranteed to be restored)