Compare Numeric Value (CMPNV)
Instruction Syntax
| Op Code (Hex) | Extender | Operand 1 | Operand 2 | Operand 3 [4-6] |
|---|---|---|---|---|
| CMPNVB 1C46 | Branch options | Compare operand 1 | Compare operand 2 | Branch targets |
| CMPNVI 1846 | Indicator options | Compare operand 1 | Compare operand 2 | Indicator targets |
Operand 2: Numeric scalar.
Operand 3 [4-6]:
- Branch Form–Instruction number, relative instruction number, branch point, or instruction pointer.
- Indicator Form–Numeric variable scalar or character variable scalar.
Description:
The numeric value of the first compare operand is compared with the signed or unsigned numeric value of the second compare operand. Based on the comparison, the resulting condition is used with the extender field to:
- Transfer control conditionally to the instruction indicated in one of the branch target operands (branch form).
- Assign a value to each of the indicator operands (indicator form).
Decimal operands used in floating-point operations cannot contain more than 15 total digit positions.
When both operands are signed numeric or both are unsigned numeric, the length of the operation is equal to the length of the longer of the two compare operands. The shorter of the two operands is adjusted to the length of the longer operand according to the rules of arithmetic operations outlined in Arithmetic Operations.
When one operand is signed numeric and the other operand unsigned numeric, the unsigned operand is converted to a signed value with more precision than its current size. The length of the operation is equal to the length of the longer of the two compare operands. A negative signed numeric value will always be less than a positive unsigned value.
Floating-point comparisons use exponent comparison and significand comparison. For a denormalized floating-point number, the comparison is performed as if the denormalized number had first been normalized.
For floating-point, two values compare unordered when at least one comparand is NaN. Every NaN compares unordered with everything including another NaN value.
Floating-point comparisons ignore the sign of zero. Positive zero always compares equal with negative zero.
A floating-point invalid operand (hex 0C09) exception is signaled when two floating-point values compare unordered and no branch or indicator option exists for any of the unordered, negation of unordered, equal, or negation of equal resultant conditions.
When a comparison is made between a floating-point compare operand and a fixed-point decimal compare operand that contains fractional digit positions, a floating-point inexact result (hex 0C0D) exception may be signaled because of the implicit conversion from decimal to floating-point.
Resultant Conditions
- High–The first compare operand has a higher numeric value than the second compare operand.
- Low–The first compare operand has a lower numeric value than the second compare operand.
- Equal–The first compare operand has a numeric value equal to the second compare operand.
- Unordered–The first compare operand is unordered compared to the second compare operand.
Authorization Required
- None
Lock Enforcement
- None
Exceptions
- 06 Addressing
- 0601 Space Addressing Violation
- 0602 Boundary Alignment
- 0603 Range
- 08 Argument/Parameter
- 0801 Parameter Reference Violation
- 0C Computation
- 0C02 Decimal Data
- 0C03 Decimal Point Alignment
- 0C09 Floating-Point Invalid Operand
- 0C0D Floating-Point Inexact Result
- 10 Damage Encountered
- 1004 System Object Damage State
- 1044 Partial System Object Damage
- 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
- 2C Program Execution
- 2C04 Branch Target 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