Scale (SCALE)


Op Code (Hex) Extender Operand 1 Operand 2 Operand 3 Operand [4-7]
SCALE 1063
Receiver Source Scale factor


SCALEI 1863 Indicator options Receiver Source Scale factor Indicator targets


SCALEB 1C63 Branch options Receiver Source Scale factor Branch targets
Operand 1: Numeric variable scalar.

Operand 2: Numeric scalar.

Operand 3: Binary(2) scalar.

Operand 4-7:

Short forms


Op Code (Hex) Extender Operand 1 Operand 2 Operand [3-6]
SCALES 1163
Receiver/Source Scale factor


SCALEIS 1963 Indicator options Receiver/Source Scale factor Indicator targets


SCALEBS 1D63 Branch options Receiver/Source Scale factor Branch targets
Operand 1: Numeric variable scalar.

Operand 2: Binary(2) scalar.

Operand 3-6:

Description  The scale instruction performs numeric scaling of the source operand based on the scale factor and places the results in the receiver operand. The numeric operation is as follows:

Operand 1 = Operand 2 *(B**N)
where:

N is the binary integer value of the scale operand. It can be positive, negative, or 0. If N is 0, then the operation simply copies the source operand value into the receiver operand.

B is the arithmetic base for the type of numeric value in the source operand.


Base Type B
Binary 2
Packed/Zoned 10
Floating-point 2
The operands must be of the numeric types indicated with any implicit conversions occurring according to the rules of arithmetic operations as outlined in the Arithmetic Operations. The scale operation is a shift of N unsigned binary, packed, or zoned digits. The shift is to the left if N is positive, to the right if N is negative. For a signed binary source operand, the scale operation is performed as if the source operand is multiplied by a signed binary value of 2**N.

For a floating-point source operand, the scale operation is performed as if the source operand is multiplied by a floating-point value of 2**N.

If the source and receiver operands have different attributes, the scaling operation is done in an intermediate field with the same attributes as the source operand. If a fixed-point scaling operation causes nonzero digits to be truncated on the left end of the intermediate field, a size  (hex 0C0A) exception is signaled. For a floating-point scaling operation, the floating-point overflow  (hex 0C06) exception and the floating-point underflow  (hex 0C07) exception can be signaled during the calculation of the intermediate result.

The resultant value of the calculation is copied into the receiver operand. 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, 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. For fixed-point operations, if nonzero digits are truncated off the left end of the resultant value, a size  (hex 0C0A) exception is signaled.

For floating-point operations involving fixed-point receiver fields, 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 floating-point receiver fields, if the exponent of the resultant value is either too large or too small to be represented in the receiver field, the floating-point overflow  (hex 0C06) exception or floating-point underflow  (hex 0C07) exception is signaled.

A scalar value invalid  (hex 3203) exception is signaled if the value of N is beyond the range of the particular type of the source operand as specified in the following table.

Source Operand Type Range of N
Signed Binary(2)
-14 <= N <= 14
Unsigned Binary(2)
-15 <= N <= 15
Signed Binary(4)
-30 <= N <= 30
Unsigned Binary(4)
-31 <= N <= 31
Decimal(P,Q)
-31 <= N <= 31

For a scale operation in floating-point, no limitations are placed on the values allowed for N other than the implicit limits imposed due to the floating-point overflow and underflow exceptions.

Limitations (Subject to Change)  The following are limits that apply to the functions performed by this instruction.

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.

Resultant Condition 

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0C Computation

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2C Program Execution

2E Resource Control Limit

32 Scalar Specification

36 Space Management

44 Protection Violation