CSLENTRY
Purpose
Use the CSLENTRY macro when writing a callable services library (CSL) routine to identify the module entry point, and generate the proper entry code.
You must specify the CSLENTRY macro before any executable code or data in a CSL routine.
CSLENTRY performs the following:
- Saves the calling program's registers
- Puts the number of parameters passed to the CSL routine in register 0
- Checks parameter list length and issues the proper return codes for improper length plists, if requested (DIRECT option only)
- Generates the USING statement for register 15.
Parameters
Required Parameters:
- parmn
- specifies the name for a parameter expected by the CSL routine. You must define a name for each
expected parameter. Note: You should use the special parameter names RETURN and REASON in your program when referring to the return code and reason code parameters. If you specify the OPENVM option on CSLENTRY, you should also use the special parameter name VALUE when referring to the return value parameter. Do not use these special names for any other parameters.
Optional Parameters:
- label
- is an optional assembler label for the statement.
- DIRECT
- specifies that the routine will be directly callable.
- OPENVM
- specifies that the routine will be directly callable and:
- The return code parameter is not required and may appear anywhere in the parameter list.
- The positions of the return code, reason code, and return value in the parameter list are marked using special data types in the CSL template file.
- req,opt
- supplies the number of required and optional entries in the parameter list. The sum of req and opt must be between 1 and 99 and req must be greater than 0.
- NOCNT
- indicates that no counting of parameters is to be done. No return codes will be set by the macro generated code. Register 0 will not be updated.
- MODE=NO370
- specifies that the macro should not create a System/370 code path.
Usage Notes
- Upon completion of CSLENTRY, register 0 contains the number of parameters passed (if requested) and register 1 points to the parameter list. If these two values are to be used later in the CSL routine code, they should be saved in different registers or in storage. Otherwise, various functions, including CSLGETP, may overwrite the contents of registers 0 and 1.
- The number of parameters passed is treated differently depending on what information you supply
to CSLENTRY.
- If
CSLENTRY (parmn),CSLENTRY DIRECT,(parmn), orCSLENTRY OPENVM,(parmn)is specified, the number of parameters passed is placed in register 0. No return codes for an incorrect parameter list will be returned. If DIRECT is specified, 100 is placed in register 0 when the parameter list size exceeds 99. - If
CSLENTRY DIRECT(req,opt)is specified, the number of parameters passed is placed in register 0. If req is greater than the number of parameters passed, a return code of -11 is returned to the caller. If the sum of req and opt is less than the number of parameters passed, a return code of -10 is returned to the caller. - If
CSLENTRY OPENVM(req,opt)is specified, the number of parameters passed is placed in register 0.How CSLENTRY handles a parameter list size error depends on whether a return code or return value is defined in the parameter list:- If req is greater than the number of parameters passed, and a return value or return code or both exists in the parameter list, then a return value of -1 and a return code of -11 are returned to the caller.
- If the sum of req and opt is less than the number of parameters passed, and a return value or return code or both exists in the parameter list, then a return value of -1 and a return code of -10 are returned to the caller.
- In either of these error situations, if no return value or return code is defined in the parameter list, then CSLENTRY initiates an ABEND.
- If
CSLENTRY DIRECT(NOCNT)orCSLENTRY OPENVM(NOCNT)is specified, then the number of parameters is ignored. No return codes are returned for an incorrect parameter list size. Register 0 is not updated.
- If
- You can use the parameter names specified on this macro with the CSLGETP macro to get information about the parameters passed to your CSL routine. For more information on using this macro, see the z/VM: CMS Application Development Guide for Assembler.
- Specifying the DIRECT or OPENVM operand does not make a CSL routine a direct call routine. You must specify a path on the ROUTINE line or lines which use this routine's text file. The ROUTINE lines are found in the CSLCNTRL file used by CSLGEN. You must also specify DIRECT or OPENVM on the first noncomment line of the template file.
Return Codes
- Code
- Meaning
- -10
- The sum of req and opt is less than the number of parameters passed.
- -11
- req is greater than the number of parameters passed.
