HP OpenVMS Systems Documentation |
HP OpenVMS Programming Concepts Manual
17.5 Condition Values Returned HeadingA condition value is a longword that has the following uses on the OpenVMS VAX, OpenVMS Alpha, and OpenVMS I64 systems:
The HP OpenVMS Calling Standard explains in detail the uses for the condition value and depicts its format and contents. The Condition Values Returned heading describes the condition values that are returned by the routine when it completes execution without generating an exception condition. These condition values describe the completion status of the operation. If a called routine generates an exception condition during execution, the exception condition is signaled; the exception condition is then handled by a condition handler (either user supplied or system supplied). Depending on the nature of the exception condition and on the condition handler, the called routine either continues normal execution or terminates abnormally. If a called routine executes without generating an exception condition, the called routine returns a condition value in one or two of the following ways:
The method used to return the condition value is indicated under the Condition Values Returned heading in the documentation of each routine. These methods are discussed individually in the following subsections. Under these headings, a two-column list shows the symbolic code for each condition value the routine can return and an accompanying description. The description explains whether the condition value indicates success or failure and, if failure, what user action might have caused the failure and what to do to correct it. Condition values that indicate success are listed first. Symbolic codes for condition values are defined by the system. Though the condition value consists of several fields, each of which can be interpreted individually for specific information, the entire condition value itself can be interpreted as an integer, and this integer has an equivalent symbolic code.
The three sections that follow discuss the ways in which the called
routine returns condition values.
The possible condition values that the called routine can return in general register R0 (R8, R9 for I64) are listed under the Condition Values Returned heading in the documentation. Most routines return a condition value in this way.
In the documentation of system services that complete asynchronously,
both the Condition Values Returned and Condition Values Returned in the
I/O Status Block headings are used. Under the Condition Values Returned
heading, the condition values returned by the asynchronous service
refer to the success or failure of the system service request---that
is, to the status associated with the correctness of the syntax of the
call, in contrast to the final status associated with the completion of
the service operation. For asynchronous system services, condition
values describing the success or failure of the actual service
operation---that is, the final completion status---are listed under the
Condition Values Returned in the I/O Status Block heading.
The possible condition values that the called routine can return in an I/O status block are listed under the Condition Values Returned in the I/O Status Block heading. The routines that return condition values in the I/O status block are the system services that are completed asynchronously. Each of these asynchronous system services returns to the caller as soon as the service call is queued. This allows the continued use of the calling program during the execution of the service operations. System services that are completed asynchronously all have arguments that specify an I/O status block. When the system service operation is completed, a condition value specifying the completion status of the operation is written in the first word of this I/O status block.
Representing a condition value in a word-length field is possible for
system services because the high-order segment of all system service
condition values is 0. See cond_value in Table E-1
or Section 18.11 for the field detail of the condition value structure.
The possible condition values that the called routine can return in a mailbox are listed under the Condition Values Returned in a Mailbox heading.
Routines such as SYS$SNDOPR that return condition values in a mailbox
send information to another process to perform a task. The receiving
process performs the action and returns the status of the task to the
mailbox of the sending process.
The possible condition values that the called routine can signal (instead of returning them in R0 (R8, R9 for I64) are listed under the Condition Values Signaled heading. Routines that signal condition values as a way of indicating the completion status do so because these routines are returning actual data as the value of the routine. As mentioned, the signaling of condition values occurs whenever a routine generates an exception condition, regardless of how the routine returns its completion status under normal circumstances.
Chapter 18
|
Register | Use |
---|---|
PC | Program counter |
SP | Stack pointer |
FP | Current stack frame pointer |
AP | Argument pointer |
R1 | Environment value (when necessary) |
R0, R1 | Function return value registers |
By definition, any called routine can use registers R2 through R11 for
computation and the AP register as a temporary register.
18.1.2 Register Usage for OpenVMS Alpha
On Alpha systems, there are two groups of 64-bit wide, general-purpose Alpha hardware registers:
The first 32 general-purpose registers support integer processing; the
second 32 support floating-point operations.
18.1.2.1 Integer Registers
The calling standard defines the Alpha general-purpose integer registers and their use, as listed in Table 18-2.
Register | Usage |
---|---|
R0 | Function value register. A standard call that returns a nonfloating-point function must return the function result in this register. The register can be modified by the called procedure without being saved and restored. |
R1 | Conventional scratch register. In a standard call, this register can be modified by the called procedure without being saved and restored. |
R2--15 | Conventional saved registers. If a standard-conforming procedure modifies one of these registers, the procedure must save and restore it. |
R16--21 | Argument registers. Up to six nonfloating-point items of the argument list are passed in these registers and the registers can be modified by the called procedure without being saved and restored. |
R22--24 | Conventional scratch registers. The registers can be modified by the called procedure without being saved and restored. |
R25 | Argument information (AI) register. The register describes the argument list (see Section 18.4 for a detailed description) and can be modified by the called procedure without being saved and restored. |
R26 | Return address (RA) register. The return address must be passed in this register and can be modified by the called procedure without being saved and restored. |
R27 | Procedure value (PV) register. The procedure value of the procedure being called is passed in this register and can be modified by the called procedure without being saved and restored. |
R28 | Volatile scratch register. The contents of this register are always unpredictable after any external transfer of control either to or from a procedure. |
R29 | Frame pointer (FP). This register defines which procedure is the current procedure. |
R30 | Stack pointer (SP). This register contains a pointer to the top (start) of the current operating stack. |
R31 | ReadAsZero/Sink (RZ). Hardware defined: binary zero as a source operand, sink (no effect) as a result operand. |
18.1.2.2 Floating-Point Registers
The calling standard defines the Alpha floating-point registers and
their use, as listed in Table 18-3.
Register | Usage |
---|---|
F0 | Floating-point function value register. In a standard call that returns a floating-point result in a register, this register is used to return the real part of the result. The register can be modified by the called procedure without being saved and restored. |
F1 | Floating-point function value register. In a standard call that returns a complex floating-point result in registers, this register is used to return the imaginary part of the result. This register can be modified by the called procedure without being saved and restored. |
F2--9 | Conventional saved registers. If a standard-conforming procedure modifies one of these registers, the procedure must save and restore it. |
F10--15 | Conventional scratch registers. The registers can be modified by the called procedure without being saved and restored. |
F16--21 | Argument registers. Up to six floating-point arguments can be passed by value in these registers. These registers can be modified by the called procedure without being saved and restored. |
F22--30 | Conventional scratch registers. The registers can be modified by the called procedure without being saved and restored. |
F31 | ReadAsZero/Sink. Hardware defined: binary zero as a source operand, sink (no effect) as a result operand. |
The Intel® Itanium® architecture defines 128 general purpose registers, 128 floatingpoint registers, 64 predicate registers, 8 branch registers, and up to 128 application registers. The large number of architectural registers enable multiple computations to be performed without having to frequently spill and fill intermediate data to memory.
The instruction pointer is a 64bit register that points to the currently executing instruction bundle.
This section describes the register conventions for OpenVMS I64.
OpenVMS I64 uses the following register types:
Registers are partitioned into the following classes that define the way a register can be used within a procedure:
OpenVMS I64 further defines the way that static registers can be used between routines:
There are 128, 64bit general-purpose registers (R0R127) that are used to hold values for integer and multimedia computations. Each of the 128 registers has one additional NaT (Not a Thing) bit that is used to indicate whether the value stored in the register is valid. Execution of I64 speculative instructions can result in a register's NaT bit being set. Register R0 is read only and contains a value of zero (0). Attempting to write to R0 will cause a fault.
This standard defines the usage of the OpenVMS general registers as listed in Table 18-4.
Register | Class | Usage |
---|---|---|
R0 | Constant | Always 0. |
R1 | Special |
Global data pointer (GP). Designated to hold the address of the
currently addressable global data segment. Its use is subject to the
following conventions:
The effect of these rules is that GP must be treated as a scratch register at a point of call (that is, it must be saved by the caller), and it must be preserved from entry to exit. |
R2 | Volatile | May not be used to pass information between procedures, either as inputs or outputs. |
R3 | Scratch | May be used within and between procedures in any mutually consistent combination of ways under explicit user control. |
R4-R7 | Preserved |
General-purpose preserved registers. Used for any value that needs to
be preserved across a procedure call.
May be used within and between procedures in any mutually consistent combination of ways under explicit user control. |
R8-R9 | Scratch | Return value. Can also be used as input (whether or not the procedure has a return value), but not in any additional ways. |
R10-R11 | Scratch | May be used within and between procedures in any mutually consistent combination of ways under explicit user control. |
R12 | Special | Memory stack pointer (SP). Holds the lowest address of the current stack frame. At a call, the stack pointer must point to a 0 mod 16 aligned area. The stack pointer is also used to access any memory arguments upon entry to a function. Except in the case of dynamic stack allocation, code can use the stack pointer to reference stack items without having to set up a frame pointer for this purpose. |
R13 | Special | Reserved as a thread pointer (TP). |
R14-R18 | Volatile | May not be used to pass information between procedures, either as inputs or outputs. |
R19-R24 | Scratch | May be used within and between procedures in any mutually consistent combination of ways under explicit user control. |
R25 | Special | Argument information (see Section 18.5.6). |
R26-R31 | Scratch | May be used within and between procedures in any mutually consistent combination of ways under explicit user control. |
IN0-IN7 | Automatic | Stacked input registers. Code may allocate a register stack frame of up to 96 registers with the ALLOC instruction, and partition this frame into three regions: input registers (IN0, IN1, ...), local registers (LOC0, LOC1, ...), and output registers (OUT0, OUT1, ...). R32--R39 (IN0--IN7) are used as incoming argument registers. Arguments beyond these registers appear in memory. |
LOC0-LOC95 | Automatic | Stacked local registers. Code may allocate a register stack frame of up to 96 registers with the ALLOC instruction, and partition this frame into three regions: input registers (IN0, IN1, ...), local registers (LOC0, LOC1, ...), and output registers (OUT0, OUT1, ...). LOC0-LOC95 are used for local storage. |
OUT0-OUT7 | Scratch | Stacked output registers. Code may allocate a register stack frame of up to eight registers with the ALLOC instruction, and partition this frame into three regions: input registers (IN0, IN1, ...), local registers (LOC0, LOC1, ...), and output registers (OUT0, OUT1, ...). OUT0-OUT7 are used to pass the first eight arguments in calls. |
18.1.3.3 I64 Floating-Point Register Usage
There are 128, 82bit floatingpoint registers (F0F127)
that are used for floatingpoint computations. The first two
registers, F0 and F1, are read only and read as +0.0 and +1.0,
respectively. Instructions that write to F0 or F1 will fault.
This standard defines the usage of the OpenVMS floating-point registers as listed in Table 18-5.
Register | Class | Usage |
---|---|---|
F0 | Constant | Always 0.0. |
F1 | Constant | Always 1.0. |
F2-F5 | Preserved | Can be used for any value that needs to be preserved across a procedure call. A procedure using one of the preserved floating-point registers must save and restore the caller's original contents without generating a NaT consumption fault. |
F6-F7 | Scratch | May be used within and between procedures in any mutually consistent combination of ways under explicit user control. |
F8-F9 | Scratch | Argument/Return values. See 18.4 and 18.10 for the OpenVMS specifications for use of these registers. |
F10-F15 | Scratch | Argument values. See Section 18.4 for the OpenVMS specifications for use of these registers. |
F16--F31 | Preserved | Can be used for any value that needs to be preserved across a procedure call. A procedure using one of the preserved floating-point registers must save and restore the caller's original contents without generating a NaT consumption fault. |
F32-F127 | Scratch | Rotating registers or scratch registers. |
VAX floating-point data are never loaded or manipulated in the I64 floating-point registers. However, VAX floating-point values may be converted to IEEE floating-point values, which are then manipulated in the I64 floating-point registers. |
Previous | Next | Contents | Index |