MPE/iX Intrinsics Reference Manual (32650-90875)
20 Chapter2
Intrinsic Use
Parameters
Parameters
Intrinsic parameters can be input, output, or input/output (I/O) parameters:
• Input parameters pass values into the intrinsic routine.
• Output parameters return values from the intrinsic routine to the calling routine.
• I/O parameters pass values into and return values from the intrinsic routine.
Parameter Declarations
Parameters are passed to an intrinsic either by value or by reference, depending on how
the parameter is declared. When a parameter is passed by reference, its address in the
caller's data area is made available to the called procedure. When a parameter is passed by
value, the called procedure receives a private copy of the actual data value. If the called
procedure changes the private copy, the corresponding value in the calling routine remains
unchanged.
Parameters can be either a literal value or a variable; however, only variables can be
passed to reference parameters.
A process must call intrinsic parameters in the exact calling sequence (order) specified in
the syntax statement and must separate them by commas. For example, write a call to the
CLOSELOG intrinsic as follows:
CLOSELOG(ACCESS,0,0);
You must represent optional intrinsic parameters if they are missing. To indicatea missing
parameter within the parameter list, omit the parameter, but retain the preceding
commas. For example, write a call to the FOPEN intrinsic and omit the second (optional)
parameter as follows:
FILENUM:=FOPEN(MYFILE,,3);
If you omit the first parameter from a list, indicate this by following the left parenthesis
with a comma ((,). If you omit one or more parameters from the end of a list, indicate this
by following the last parameter with the right parenthesis; no commas are required.
NOTE
When a process calls an intrinsic with no parameters from C/XL, follow the
intrinsic name with an empty pair of parentheses (()).
Parameter Alignment
For programs running under MPE V and in compatability mode (CM), parameters are
passed by word address, which automatically enforces parameter alignment.
For programs running in native mode (NM), byte addressing is used for all parameters. As
a result, it is possible to pass a 16-bit or 32-bit parameter that is not 16-bit or 32-bit
aligned. Unless explicitly stated in the parameter description, native mode programs do
not impose alignment requirements.