Linkage conventions for the callable services

Callers must use the following linkage conventions for all z/OS UNIX callable services:
  • Register 1 is set up by the CALL macro. In 31-bit mode, it contains the address of a parameter list, which is a list of consecutive words, each containing the address of a parameter to be passed. The last word in this list must have a 1 in the high-order (sign) bit. In 64-bit mode, register 1 is 8 bytes long, and contains a 64-bit address that points to a list of 64-bit addresses. See Using callable services in a 64-bit environment.
  • Register 14 is set up by the CALL macro; it contains the return address.
  • Register 15 is set up by the CALL macro; it contains the entry point address of the service stub that is being called.

On return from a callable service, general and access registers 2 through 13 are restored. General and access registers 0, 1, 14, and 15 are not restored.

The caller must be running with 31-bit or 64-bit addressing (AMODE=31 or AMODE=64), because the linkage code uses control blocks that reside above the 16-MB line.

See z/OS MVS Program Management: Advanced Facilities for detailed linkage information.