The CEEPCALL macro passes control to a control section at a specified entry point. The target of CEEPCALL can be resolved either statically (link-edited with the same program object) or dynamically (imported from a DLL). The only required positional parameter is the name of the called entry point. This name is case-sensitive, and can be up to 255 characters in length. The optional parameter list will be pointed to by General Purpose Register (GPR) 1.
Since only REENTRANT Assembler code is supported by this macro, it must be specified as a combination of LIST and EXECUTE forms so that the parameter list can be built in automatic (that is, stack) storage.
The CEEPCALL macro does not generate any return codes. A return code may be placed in GPR 15 by the called program.
GPRs 1, 14, and 15 are not preserved by this macro.
Syntax >>-+-------+--CEEPCALL--+-----------------------------+--,--MF=L->< '-label-' '-, (--parm1--, ...)--+-----+-' '-,VL-'
or
Syntax >>-+-------+--CEEPCALL--entry-name--+-----------------------------+--,--MF=(E,--prob_addr--)->< '-label-' '-, (--parm1--, ...)--+-----+-' '-,VL-'
To create the parameter list, the calling program creates a list of addresses of each parameter in the order designated. In the execute form of the macro, GPR 1 contains the address of the parameter list when the program receives control. (If no parameters are coded, GPR 1 is not altered.) See Figure 2.
For more information about DLLs, including full sample assembler DLL routines, see Building and using dynamic link libraries (DLLs). The following example illustrates an invocation of the CEEPCALL macro to call the routine named Bif1 with no parameters:
DLLAPPL CEEENTRY MAIN=YES,PPA=DLLPPA
* Symbolic Register Definitions and Usage
R15 EQU 15 Entry point address
*
CEEPCALL Bif1,MF=(E,)
*
SR R15,R15
RETURN DS 0H
CEETERM RC=(R15),MODIFIER=0
*
DLLPPA CEEPPA
LTORG
CEEDSA
CEECAA
END DLLAPPL
The following example illustrates an invocation of the CEEPCALL macro to call the routine named Bif5 passing 5 integer parameters:
DLLAPPL CEEENTRY MAIN=YES,PPA=DLLPPA,AUTO=AUTOSZ
* Symbolic Register Definitions and Usage
R15 EQU 15 Entry point address
*
THECALL CEEPCALL Bif5,(PARM1,PARM2,PARM3,PARM4,PARM5),VL,MF=(E,PARMS)
*
SR R15,R15
RETURN DS 0H
CEETERM RC=(R15),MODIFIER=0
*
PARM1 DC A(15)
PARM2 DC A(33)
PARM3 DC A(45)
PARM4 DC A(57)
PARM5 DC A(99)
DLLPPA CEEPPA
LTORG
CEEDSA
PARMS CEEPCALL ,(0,0,0,0,0),MF=L
AUTOEND DS 0D
AUTOSZ EQU AUTOEND-CEEDSA
CEECAA
END DLLAPPL