Parameters [ MPE/iX Intrinsics Reference Manual ] MPE/iX 5.0 Documentation
MPE/iX Intrinsics Reference Manual
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
indicate a 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.
Parameter Bit Settings
In some intrinsic calls, a process passes input parameters to the
intrinsic as words whose individual bits or fields of bits signify
functions or options. In cases where bits within a word are described as
reserved for the operating system, set those bits to zero. This ensures
the compatibility of your current program with future releases of the
operating system.
In some intrinsic calls, an intrinsic passes output parameters to words
referenced by a calling program. In cases where bits within a word are
described as reserved for the operating system, the system sets them to
zero unless otherwise noted.
Syntax Statement Mnemonics
An intrinsic's syntax statement contains the calling sequence, or order,
of the parameters, indicates whether a parameter is required or optional,
and specifies the parameter type. Syntax statements have the following
format:
I16V U16V
ACTIVATE(pin,allow);
Required parameters, such as pin in the example above, appear in boldface
italics. Optional parameters, such as allow, are shown in italics. The
mnemonics that appear over the parameters indicate their type and whether
they are passed by reference, which is the default, and is not marked, or
by value. (In the example, the mnemonics for both parameters have a V,
which indicates that they are passed by value.)
Table 2-1 lists the mnemonics used in intrinsic syntax statements and
their meanings.
Table 2-1. Mnemonic Descriptions
---------------------------------------------------------------------------------------------
| | |
| Mnemonic | Meaning |
| | |
---------------------------------------------------------------------------------------------
| | |
| A | Array |
| | |
---------------------------------------------------------------------------------------------
| | |
| B | Boolean |
| | |
---------------------------------------------------------------------------------------------
| | |
| C | Character |
| | |
---------------------------------------------------------------------------------------------
| | |
| CA | Character Array |
| | |
---------------------------------------------------------------------------------------------
| | |
| I16 | 16-bit signed integer |
| | |
---------------------------------------------------------------------------------------------
| | |
| I32 | 32-bit signed integer |
| | |
---------------------------------------------------------------------------------------------
| | |
| I64 | 64-bit signed integer |
| | |
---------------------------------------------------------------------------------------------
| | |
| I* | 32-bit signed integer (NM) or 16-bit signed integer (CM) |
| | |
---------------------------------------------------------------------------------------------
| | |
| LA | Logical array |
| | |
---------------------------------------------------------------------------------------------
| | |
| O-P | Option privileged (privileged mode (PM) capability) |
| | |
---------------------------------------------------------------------------------------------
| | |
| REC | Record |
| | |
---------------------------------------------------------------------------------------------
| | |
| R32 | 32-bit real number |
| | |
---------------------------------------------------------------------------------------------
| | |
| R64 | 64-bit real number |
| | |
---------------------------------------------------------------------------------------------
| | |
| UDS | User-defined structure |
| | |
---------------------------------------------------------------------------------------------
| | |
| U16 | 16-bit unsigned integer |
| | |
---------------------------------------------------------------------------------------------
| | |
| U32 | 32-bit unsigned integer |
| | |
---------------------------------------------------------------------------------------------
| | |
| U64 | 64-bit unsigned integer |
| | |
---------------------------------------------------------------------------------------------
| | |
| V | Passed by value |
| | |
---------------------------------------------------------------------------------------------
| | |
| @32 | 32-bit address |
| | |
---------------------------------------------------------------------------------------------
| | |
| @64 | 64-bit address |
| | |
---------------------------------------------------------------------------------------------
| | |
| @* | 32-bit address (NM) or 16-bit address (CM) |
| | |
---------------------------------------------------------------------------------------------
| | |
| * | Type varies |
| | |
---------------------------------------------------------------------------------------------
Itemnum and ItemPair Options
Some intrinsics allow multiple itemnum,item pairs to be passed to define
one or more options. The itemnum parameter is usually an integer value
that the intrinsic uses to define the meaning and the expected data type
of the value passed or returned in the corresponding item parameter.
An itemnum cannot be passed without its corresponding item value. The
only exception is when a special value is passed in the last itemnum to
indicate the end of the itemnum,item list; in this case, an accompanying
item is not required.
Data Type Mappings
Table 2-2 maps generic data types to possible implementations in
programming languages supported by the operating system. The mnemonics
associated with the generic types appear in parentheses. For more
information on calling intrinsics from these languages, refer to the
appropriate language reference manual.
NOTE The IEEE floating-point standard is the default real format for the
900 Series Hewlett-Packard 3000 computers.
Table 2-2. Data Type Mappings
-----------------------------------------------------------------------------------------------------
| | | | | |
| Generic Type | COBOL II/XL | FORTRAN 77/XL | Pascal/XL | C & C/XL |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 16-bit signed | PIC S9(1) - S9(4) | Integer*2 | SHORTINT or any | SHORTINT |
| integer (I16) | BINARY SYNC | | 16-bit subrange | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 32-bit signed | PIC S9(5) - S9(9) | Integer or | Integer or any | 32-bit |
| integer (I32) | BINARY SYNC | integer*4 | 32-bit subrange | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 64-bit signed | PIC S9(10) - | N/A | N/A | N/A |
| integer (I64) | S9(18) BINARY | | | |
| | SYNC | | | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 16-bit unsigned | PIC S9(1) - S9(4) | Integer*2 | 0..65535 or any | Unsigned short |
| integer (U16) | BINARY SYNC | | 16-bit subrange | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 32-bit unsigned | PIC S9(5) - S9(9) | Integer or | Any 32-bit | Unsigned integer |
| integer (U32) | BINARY SYNC | integer*4 | subrange | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 64-bit unsigned | PIC S9(10) - | N/A | N/A | N/A |
| integer (U64) | S9(18) BINARY | | | |
| | SYNC | | | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 32-bit real (R32) | N/A | Real or real*4 | Real | Float |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 64-bit real (R64) | N/A | Double precision | Long real | Double |
| | | or real*8 | | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| Boolean (B) | Group item | Logical*2 | Boolean | SHORTINT |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| Character (C) | USAGE DISPLAY or | Character | Char | Unsigned |
| | group item | | | character or |
| | | | | character |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 32-bit address | PIC S9(5) - S9(9) | Integer or | LOCALANYPTR or | Pointer |
| (@32) | BINARY SYNC | integer*4 | any normal | |
| | | | pointer type | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| 64-bit address | PIC S9(10) - | N/A | GLOBALANYPTR or | Long pointer |
| (@64) | S9(18) BINARY | | any pointer type | |
| | SYNC | | declared with the | |
| | | | $EXTNADDR | |
| | | | compiler | |
| | | | directive | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| Array (A) | USAGE DISPLAY or | Equivalent array | Array (any type) | Array (any type) |
| | group item | type | | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| Record (REC) | USAGE DISPLAY or | Array type | Record (any type) | Struct (any type) |
| | group item | | | |
| | | | | |
-----------------------------------------------------------------------------------------------------
| | | | | |
| User-defined | | | | |
| structure (UDS) | | | | |
| | | | | |
-----------------------------------------------------------------------------------------------------
MPE/iX 5.0 Documentation