Compare Pointer for Object Addressability (CMPPTRA)
Instruction Syntax
| Op Code (Hex) | Extender | Operand 1 | Operand 2 | Operand 3 [4] |
|---|---|---|---|---|
| CMPPTRAB 1CD2 | Branch options | Compare operand 1 | Compare operand 2 | Branch targets |
| CMPPTRAI 18D2 | Indicator options | Compare operand 1 | Compare operand 2 | Indicator targets |
Operand 1: Data pointer, space pointer, system pointer, instruction pointer, or label pointer.
Operand 2: Data pointer, space pointer, system pointer, instruction pointer, or label pointer.
Operand 3 [4]:
- Branch Form-Instruction number, relative instruction number, branch point, or instruction pointer.
- Indicator Form-Numeric variable scalar or character variable scalar.
| Bound Program Access |
|---|
The return code will be set as follows:
This built-in function is used to provide support for the branch and indicator forms of the CMPPTRA operation. The user must specify code to process the return code and perform the desired branching or indicator setting. |
Description:
The object addressed by operand 1 is compared with the object addressed by operand 2 to determine if both operands are addressing the same object. Based on the comparison, the resulting condition is used with the extender to transfer control (branch form) or to assign a value to each of the indicator operands (indicator form).
If operand 1 is a data pointer, a space pointer, or a system pointer, operand 2 may be a data pointer, a space pointer, or a system pointer in any combination. An equal condition occurs if the pointers are addressing the same object. For space pointers and data pointers, only the space they are addressing is considered in the comparison. That is, the space offset portion of the pointer is ignored. All implicit process spaces and teraspace are considered part of an active PCS (Process Control Space) object. Thus a pointer to teraspace or to an implicit process space addresses the same object as any other pointer which addresses the PCS of the process which contains the currently executing thread. Further, since any teraspace reference is local to a process, any two pointers to teraspace used within the same process are defined to address the same object.
For system pointer compare operands, an equal condition occurs if the system pointer is compared with a space pointer or data pointer that addresses the space that is associated with the object that is addressed by the system pointer. For example, a space pointer that addresses a byte in a space associated with a system object compares equal with a system pointer that addresses the system object.
For instruction pointer comparisons, both operands must be instruction pointers; otherwise, a pointer type invalid (hex 2402) exception is signaled. An equal condition occurs when both instruction pointers are addressing the same instruction in the same program. A not equal condition occurs if the instruction pointers are not addressing the same instruction in the same program.
For label pointer comparisons, both operands must be label pointers; otherwise, a pointer type invalid (hex 2402) exception is signaled. An equal condition occurs when both label pointers are addressing the same label in the same procedure. A not equal condition occurs if the label pointers are not addressing the same label in the same procedure.
A pointer does not exist (hex 2401) exception is signaled if a pointer does not exist in either of the operands.
Resultant Conditions
- Equal
- Not equal
Authorization Required
- Execute
- Contexts referenced for address resolution
Lock Enforcement
- Materialize
- Contexts referenced for address resolution
Exceptions
- 06 Addressing
- 0601 Space Addressing Violation
- 0602 Boundary Alignment
- 0603 Range
- 08 Argument/Parameter
- 0801 Parameter Reference Violation
- 0A Authorization
- 0A01 Unauthorized for Operation
- 10 Damage Encountered
- 1004 System Object Damage State
- 1005 Authority Verification Terminated Due to Damaged Object
- 1044 Partial System Object Damage
- 1A Lock State
- 1A01 Invalid Lock State
- 1C Machine-Dependent
- 1C03 Machine Storage Limit Exceeded
- 20 Machine Support
- 2002 Machine Check
- 2003 Function Check
- 22 Object Access
- 2201 Object Not Found
- 2202 Object Destroyed
- 2203 Object Suspended
- 2208 Object Compressed
- 220B Object Not Available
- 24 Pointer Specification
- 2401 Pointer Does Not Exist
- 2402 Pointer Type Invalid
- 2E Resource Control Limit
- 2E01 User Profile Storage Limit Exceeded
- 36 Space Management
- 3601 Space Extension/Truncation
- 44 Protection Violation
- 4401 Object Domain or Hardware Storage Protection Violation