Compare Space Addressability (CMPSPAD)


Op Code (Hex) Extender Operand 1 Operand 2 Operand 3 [4-6]
CMPSPADB 1CF2 Branch options Compare operand 1 Compare operand 2 Branch targets


CMPSPADI 18F2 Indicator options Compare operand 1 Compare operand 2 Indicator targets
Operand 1: Numeric variable scalar, character variable scalar, numeric variable array, character variable array, pointer data object, pointer data object array.

Operand 2: Numeric variable scalar, character variable scalar, numeric variable array, character variable array, pointer data object, pointer data object array.

Operand 3 [4-6]:

Description  The space addressability of the object specified by operand 1 is compared with the space addressability of the object specified by operand 2.

Based on the results of 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 the operands are not in the same space, the resultant condition is unequal. If the operands are in the same space and the offset of operand 1 is larger or smaller than the offset of operand 2, the resultant condition is high or low, respectively. Equal occurs only if the operands are in the same space at the same offset. Therefore, the resultant conditions (high, low, equal, and unequal) are mutually exclusive. Consequently, if you specify that an action be taken upon the nonexistence of a condition, this results in the action being taken upon the occurrence of any of the other three possible conditions. For example, a branch not high would result in the branch being taken on a low, equal, or unequal condition.

If a pointer data object operand contains a data pointer value upon execution of the instruction, the addressability is compared to the pointer data object rather than to the scalar described by the data pointer value. The variable scalar references allowed on operands 1 and 2 cannot be described through a data pointer value.

The object destroyed  (hex 2202) exception, parameter reference violation  (hex 0801) exception, and pointer does not exist  (hex 2401) exception are not signaled when operand 1 or operand 2 is based on a space pointer machine object. This occurs when the space pointer machine object contains an internal machine value that indicates one of these error conditions exists. If the corresponding exception is not signaled, the resulting condition of the comparison operation is not defined other than that it will be one of the four valid resultant conditions for this instruction.

Resultant Conditions 

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

36 Space Management

44 Protection Violation