Previous Topic: Write a Subsystem Program in High-level Languages

Next Topic: Function Code 0—Queue a Message to the INTCMD Environment of an NCL Process

SUBSYS Callback API

If the subsystem is using the new format parameter list, then a callback API is available. You can call this API from a SUBSYS program, including any subtasks of that program, to perform several services. (For an example of the use of this API in a subtask, see the source of the UTIL0035 program.)

The address of the API entry point is in the NCPSAPIE field, as defined by the $NMNCPL macro. The address in this field is different for each active subsystem and does not change during the life of that subsystem. You can save it elsewhere (for example, for use by subtasks), but must not share it across subsystems or across subsystem restarts.

After loading the entry point into Register 15 (R15), you can call the API by a standard BALR R14,R15 instruction. The caller can be in any AMODE, but all addresses passed in the parameter lists must be valid 31-bit addresses.

The API expects a standard format parameter list. Depending on the request, the list contains three or four parameters.

Register 1 must point to a list of addresses, each address in turn pointing to a parameter. The end-of-list bit is not required and not checked.

The first parameter is a fullword binary function code: 0, 4, and 8, which are described in the following sections.