CALL (Call a Program) Macro

The CALL macro passes control from one program to a specified entry point in another program.

You cannot use the CALL macro to pass control to a program in a different addressing mode; The AMODE of the caller is passed to the called program.

The CALL macro passes control to a control section at a specified entry point as follows: If a control section is not part of the object module which applies to the CALL macro, the linkage editor attempts to resolve this external reference by including the object module which contains the control section (AUTOLINK feature). When the CALL macro is executed, control is passed to the control section at the specified entry point.

The linkage relationship established when control is passed is the same as that created by a BAL instruction; that is, the issuing program expects control to be returned.

AR mode programs and primary mode programs can invoke the CALL macro. Before an AR mode program invokes this macro, the program must issue SYSSTATE ASCENV=AR to tell the CALL macro to generate code that is appropriate for AR mode.

Format

Read syntax diagramSkip visual syntax diagramname CALL entryname(15),( addr-list),VL,ID= id-number,MF=L(E, list-addr)

Requirements for the caller

AMODE:
24 or 31
RMODE:
24 or ANY
ASC Mode:
Primary or AR (access register)
Control parameters:
Must be in the caller's primary address space.

Parameters

entryname | (15)
Specifies the entry name to be given control.
(addr-list)
(addr-list),VL
Specifies one or more addresses (A-type address constants only), separated by commas, to be passed to the called program. To create the parameter list, the control program expands each address inline to a fullword on a fullword boundary in the specified order. Register 1 contains the address of the parameter list when the program receives control. (If this parameter is not coded, register 1 is not altered.)

VL is the default and causes the high-order bit of the last address parameter to be set to 1; the bit can be checked to find the end of the list.

If your program is in access register (AR) mode, the system builds the parameter list so that the addresses that are passed to the called program are in the first half of the list and their associated ALETs are in the second half of the list. Therefore, the parameter list for callers in AR mode is twice as long as the parameter list for callers in primary mode for the same number of addresses. The 1 in the high-order bit identifies the last address parameter, but not the last entry in the parameter list.

ID=id-number
Specifies a 2-byte identifier useful for debugging purposes only. The last fullword of the macro expansion is a NOP instruction containing the identifier value in bytes 3 and 4.
MF=L(E,list-addr)
L specifies the list form of the CALL macro, which generates a non-executable problem program parameter list that can be used by the execute form of the macro. In the list form, only A-type address constants can be used.

E specifies the execute form of the CALL macro, which uses the parameter list that is generated by the list form of the macro. list-addr specifies the address of the parameter list.

Only executable instructions and a VCON of the entry point are generated. If the address parameters are also specified in this form, the ADCONs of the parameter are placed on contiguous fullword boundaries beginning at the address that is specified in the MF parameter, and sequentially overlaying corresponding fullwords in the existing list.