Extract Magnitude (EXTRMAG)

Instruction Syntax

Op Code (Hex) Extender Operand 1 Operand 2 Operand [3-6]
EXTRMAG 1052 Receiver Source
EXTRMAGI 1852 Indicator options Receiver Source Indicator targets
EXTRMAGB 1C52 Branch options Receiver Source Branch targets
Operand 1: Numeric variable scalar.

Operand 2: Numeric scalar.

Operand 3-6:

  • Branch Form–Branch point, instruction pointer, relative instruction number, or absolute instruction number.
  • Indicator Form–Numeric variable scalar or character variable scalar.

Short forms

Op Code (Hex) Extender Operand 1 Operand [2-5]
EXTRMAGS 1152 Receiver/Source
EXTRMAGIS 1952 Indicator options Receiver/Source Indicator targets
EXTRMAGBS 1D52 Branch options Receiver/Source Branch targets
Operand 1: Numeric variable scalar.

Operand 2-5:

  • Branch Form–Branch point, instruction pointer, relative instruction number, or absolute instruction number.
  • Indicator Form–Numeric variable scalar or character variable scalar.

Description:

The numeric value of the source operand is converted to its absolute value and placed in the numeric variable scalar receiver operand.

The absolute value is formed from the source operand as follows:

  • Signed binary
    • Extract the numeric value and form twos complement if the source operand is negative.
  • Unsigned binary
    • Extract the numeric value.
  • Packed/Zoned
    • Extract the numeric value and force the source operand's sign to positive.
  • Floating-point
    • Extract the numeric value and force the significand sign to positive.

The result of the operation is copied into the receiver operand according to the rules of the Copy Numeric Value (CPYNV) instruction. If this operand is not the same type as that used in performing the operation, the resultant value is converted to its type. If necessary, the resultant value is adjusted to the length of the receiver operand, or aligned at the assumed decimal point of the receiver operand, or both before being copied to it. Length adjustment and decimal point alignment are performed according to the rules of arithmetic operations outlined in Arithmetic Operations. If significant digits are truncated on the left end of the resultant value, a size (hex 0C0A) exception is signaled. An attempt to extract the magnitude of a maximum negative binary value to a binary scalar of the same size also results in a size (hex 0C0A) exception.

When the source floating-point operand represents not-a-number, the sign field of the source is not forced to positive and this value is not altered in the receiver.

If a decimal to binary conversion causes a size (hex 0C0A) exception to be signaled, the binary value contains the correct truncated result only if the decimal value contains 15 or fewer significant nonfractional digits.

For a fixed-point operation, if significant digits are truncated from the left end of the resultant value, a size (hex 0C0A) exception is signaled. An attempt to extract the absolute value of a maximum negative binary value into a binary scalar of the same size also results in a size (hex 0C0A) exception.

For floating-point operations that involve a fixed-point receiver field, if nonzero digits would be truncated from the left end of the resultant value, an invalid floating-point conversion (hex 0C0C) exception is signaled.

For a floating-point receiver operand, if the exponent of the resultant value is either too large or too small to be represented in the receiver, the floating-point overflow (hex 0C06) exception or the floating-point underflow (hex 0C07) exception is signaled.

Resultant Conditions

  • Positive–The algebraic value of the receiver operand is positive.
  • Zero–The algebraic value of the receiver operand is zero.
  • Unordered–The value assigned a floating-point receiver operand is NaN.

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
    • 0C06 Floating-Point Overflow
    • 0C07 Floating-Point Underflow
    • 0C09 Floating-Point Invalid Operand
    • 0C0A Size
    • 0C0C Invalid Floating-Point Conversion
    • 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
    • 4402 Literal Values Cannot Be Changed