EXITCALL – Providing an Exit Point

Read syntax diagramSkip visual syntax diagram label EXITCALL nnnSetup,( address_parameters),VL,MAXRC=4,MAXRC= nn,WORKREG=2,WORKREG= number,CVTREG= number,ITRACE=NO,ITRACE=YES,MF=L(E, address),SAVERC=NO,SAVERC=YES
Setup
Read syntax diagramSkip visual syntax diagram SETUP ,EXIT=NO,EXIT=label( reg)YES,EXITRC=NONE,EXITRC=ALL(,nn)

Purpose

The EXITCALL macro passes control to an exit routine, if the exit point has been enabled by the EXIT statement or command. The linkage established is the same as that created by a BASR instruction; the issuing program expects to regain control. The macro allows an address parameter list to be constructed. Standard, list, and execute forms of the EXITCALL macro can be coded.

Parameters

label
is any valid assembler statement label.
nnn
is a number, 0 - 255, that identifies an exit point. You can specify the nnn number symbolically or with an absolute expression. If you specify MF=L, you must omit the nnn and specify a comma (,) to show its absence.
SETUP
identifies special conditions to be processed by the next EXITCALL nnn invocation, which must follow immediately after this invocation. When specified, SETUP also initializes the ECXBLOK area, which stores exit routine return codes, to zeros.
,EXIT=
identifies another routine that RSCS calls before calling the next exit routine associated with this exit point. RSCS calls this routine only if the exit routine issues the return code specified on the EXITRC parameter.
NO
Tells RSCS to continue its usual processing for this exit point. This is the default.
label
Specifies the assembler label of the routine to be called.
(Rn)
Specifies that register n contains the address of the routine to be called.
YES
Tells RSCS to call the next sequential instruction.
,EXITRC=
identifies the return code for which RSCS calls the routine specified on the EXIT parameter.
NONE
Specifies that RSCS does not call additional routines when the exit routine issues any return code. This is the default.
ALL
Specifies that RSCS calls the specified routine when the exit routine issues any valid return code.
nn
Specifies a return code for which the routine is called.
address_parameters
specifies one or more addresses, separated by commas, passed to the exit routine. Each address is expanded, in order, to a fullword on a fullword boundary. R1 contains the address of the first parameter. If you do not specify address parameters, the contents of R1 do not change.

If you code the standard form of the macro, you can specify addresses as any valid A-type address constant or as R2 to R12. You can specify registers symbolically or with an absolute expression; they must be coded within parentheses.

If you specify the list form of the macro, you must state address parameters. Specify address as any valid A-type address constant, or show their absence with commas.

If you specify the execute form of the macro, you can specify addresses as any value that is valid in an RX-type instruction or as R2 to R12. You can specify registers symbolically or with an absolute expression; they must be coded within parentheses.

,VL
sets the high-order bit of the last address parameter in the macro expansion to 1. The exit routine can test this bit to find the end of the parameter list. VL is coded only if address parameters are designated. It should be used only when a variable number of parameters can be passed to the called program.
,MAXRC=code
specifies the maximum acceptable return code, code, issued by the exit routine. If this parameter is omitted, the default is 4.
,WORKREG=number
specifies an internal work register, number, destroying the register's original contents; R2 is the default. You can specify registers symbolically or with an absolute expression. Do not specify registers 0, 1, 12, 13, 14, or 15 as a work register. If the module containing this EXITCALL macro uses many base registers, registers 9, 10, and 11 may also be unavailable.
,CVTREG=number
specifies a register, number, that contains the address of the CVT control block. You can specify registers symbolically or with an absolute expression. The contents of this register are not destroyed, unless register 1, 14, or 15 is specified. Do not specify registers 0, 12, or 13. If the module containing this EXITCALL macro uses many base registers, registers 9, 10, and 11 may also be unavailable. If you do not specify a register, RSCS generates a LOAD instruction and a V-type address constant to get the address of the CVT.
,ITRACE=
specifies whether an ITRACE macro is called within the EXITCALL expansion to trace the call to the exit routine.
NO
Does not generate an ITRACE macro. This is the default.
YES
Generates an ITRACE macro. This option is intended for IBM use only.
,MF=
specifies the format of the macro.
L
List form.
(E,address)
Execute form. The address is any valid RX-type address or a register, 1 - 12, that was previously loaded with the specified address. You can specify the register symbolically or with an absolute expression; it must be coded within parentheses. For example, Register 1 must be specified as (1).
,SAVERC=
specifies whether the return code from an exit routine should be stored in the ECXBLOK.
NO
Does not store the return code. This is the default.
YES
Stores the return code.

Usage Notes

  1. EXITCALL generates literal expressions. You must ensure that literals are not generated outside the boundaries of the CSECT that contains the EXITCALL macro. Use of an assembler LTORG statement is recommended.
  2. The EXITCALL macro expansion uses the TEXITS label generated by the CVT; you must code the CVT macro in any module that calls EXITCALL.
  3. When the code generated by the EXITCALL macro is processed, the contents of registers 14, 15, and the specified WORKREG register are altered. If you code address parameters, R1, and possibly R0, are also altered.
  4. If the exit routine issues a return code that exceeds the MAXRC value or is not a multiple of 4, user abend 1xx is generated (where xx is the number of the exit point in hexadecimal).