If the calling program is in primary ASC mode, the parameter list
must be in the primary address space. All addresses passed by the
programs must be contained in the primary address space and must not
be ALET-qualified. The program that passes parameter data can use
GPRs 0 and 1, or both. To pass the address of a parameter list, the
program should use GPR 1.
As an example, consider the way the system uses a register to pass
information in the PARM field of an EXEC statement to your program.
When your program receives control from the system, register 1 contains
the address of a parameter list that points to one parameter. The
parameter list is a fullword on a fullword boundary in your program's
address space (see
Figure 1). The high-order
bit (bit 0) of this word is set to 1. For a program that is not AMODE
64, the system uses this convention to indicate the last word in a
variable-length parameter list. Bits 1-31 of the fullword contain
the address of a two-byte length field on a halfword boundary. The
length field contains a binary count of the number of data bytes in
the PARM field. The data bytes immediately follow the length field.
If the PARM field was omitted in the EXEC statement, the count is
set to zero. To prevent possible errors, always use the count as a
length attribute in acquiring the information in the PARM field.
Figure 1. Primary Mode Parameter List EXEC PGM=
Note: The
system builds a parameter list that matches the previous description
even if the program that is the target of an EXEC statement is AMODE
64; it is not a typical parameter list for an AMODE 64 program and
the AMODE 64 program must not use the address word without first clearing
bit 0.
Unlike the parameter list produced for an EXEC statement, within
a general parameter list:
- there can be multiple parameters;
- there is no system-imposed limitation on the length of any parameter;
and
- no parameter has a system-defined format.
Lengths and formats of parameters are defined by the called service.
For an AMODE 24 or AMODE 31 program, the parameter list consists of
4-byte wide address slots; for an AMODE 64 program, the parameter
list consists of 8-byte wide address slots. For an AMODE 24 or AMODE
31 program, the high order bit of the last address slot is used to
indicate the end of the list. For an AMODE 64 program, that convention
is not used. Instead, a separate parameter would be provided if the
target program needs to be able to determine how many parameters were
passed. That separate parameter could be within the parameter list
(for example, the first parameter list slot) or could be in register
0.