HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 2 Intrinsic Use

Parameters

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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 “Mnemonic Descriptions” lists the mnemonics used in intrinsic syntax statements and their meanings.

Table 2-1 Mnemonic Descriptions

MnemonicMeaning
AArray
BBoolean
CCharacter
CACharacter Array
I1616-bit signed integer
I3232-bit signed integer
I6464-bit signed integer
I*32-bit signed integer (NM) or 16-bit signed integer (CM)
LALogical array
O-POption privileged (privileged mode (PM) capability)
RECRecord
R3232-bit real number
R6464-bit real number
UDSUser-defined structure
U1616-bit unsigned integer
U3232-bit unsigned integer
U6464-bit unsigned integer
VPassed by value
@3232-bit address
@6464-bit address
@*32-bit address (NM) or 16-bit address (CM)
*Type varies

 

Itemnum and Item Pair 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 “Data Type Mappings” 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 TypeCOBOL II/XLFORTRAN 77/XLPascal/XLC & C/XL
16-bit signed integer (I16)PIC S9(1) - S9(4) BINARY SYNCInteger*2SHORTINT or any 16-bit subrangeSHORTINT
32-bit signed integer (I32)PIC S9(5) - S9(9) BINARY SYNCInteger or integer*4Integer or any 32-bit subrange32-bit
64-bit signed integer (I64)PIC S9(10) - S9(18) BINARY SYNCN/AN/AN/A
16-bit unsigned integer (U16)PIC S9(1) - S9(4) BINARY SYNCInteger*20..65535 or any 16-bit subrangeUnsigned short
32-bit unsigned integer (U32)PIC S9(5) - S9(9) BINARY SYNCInteger or integer*4Any 32-bit subrangeUnsigned integer
64-bit unsigned integer (U64)PIC S9(10) - S9(18) BINARY SYNCN/AN/AN/A
32-bit real (R32)N/AReal or real*4RealFloat
64-bit real (R64)N/ADouble precision or real*8Long realDouble
Boolean (B)Group itemLogical*2BooleanSHORTINT
Character (C)USAGE DISPLAY or group itemCharacterCharUnsigned character or character
32-bit address (@32)PIC S9(5) - S9(9) BINARY SYNCInteger or integer*4LOCALANYPTR or any normal pointer typePointer
64-bit address (@64)PIC S9(10) - S9(18) BINARY SYNCN/AGLOBALANYPTR or any pointer type declared with the $EXTNADDR compiler directiveLong pointer
Array (A)USAGE DISPLAY or group itemEquivalent array typeArray (any type)Array (any type)
Record (REC)USAGE DISPLAY or group itemArray typeRecord (any type)Struct (any type)
User-defined structure (UDS)    

 

Feedback to webmaster