Writing a callable service

An installation-defined callable service receives parameters from the application program when the program calls the service stub that is associated with the service. An installation-defined service can also access information in the secondary parameter block (SPB). The address of the SPB is passed in register 0. See Secondary parameter block for a description of the SPB.

The service receives control with these characteristics.
  • Supervisor state
  • Key 0
  • APF authorized
  • TCB or SRB mode
  • Cross memory mode
  • AR mode
  • AMODE(31) or AMODE(64)
  • RMODE(ANY)
The service can change the characteristics during their processing. However, the service must return to its caller with the same characteristics as on entry.

You must write the services in assembler, because you are in Access Register and cross memory mode, and the addresses of some of the parameters you may access are ALET-qualified. In particular, parameters passed into a callable service are in the user's address space, which you can access with an ALET of 1. See z/OS MVS Programming: Extended Addressability Guide for information about cross memory and AR mode.