Add Numeric (ADDN)


Op Code (Hex) Extender Operand 1 Operand 2 Operand 3 Operand [4-7]
ADDN 1043
Sum Addend Augend


ADDNR 1243
Sum Addend Augend


ADDNI 1843 Indicator options Sum Addend Augend Indicator targets


ADDNIR 1A43 Indicator options Sum Addend Augend Indicator targets


ADDNB 1C43 Branch options Sum Addend Augend Branch targets


ADDNBR 1E43 Branch options Sum Addend Augend Branch targets
Operand 1: Numeric variable scalar.

Operand 2: Numeric scalar.

Operand 3: Numeric scalar.

Operand 4-7:

Short forms


Op Code (Hex) Extender Operand 1 Operand 2 Operand [3-6]
ADDNS 1143
Sum/Addend Augend


ADDNSR 1343
Sum/Addend Augend


ADDNIS 1943 Indicator options Sum/Addend Augend Indicator targets


ADDNISR 1B43 Indicator options Sum/Addend Augend Indicator targets


ADDNBS 1D43 Branch options Sum/Addend Augend Branch targets


ADDNBSR 1F43 Branch options Sum/Addend Augend Branch targets
Operand 1: Numeric variable scalar.

Operand 2: Numeric scalar.

Operand 3-6:

Caution  If operands overlap but do not share all of the same bytes, results of operations performed on these operands are not predictable. If overlapped operands share all of the same bytes, the results are predictable when direct addressing is used or whenever the assume coincident operand overlap attribute has been specified in the program template. If the assume coincident operand overlap attribute has not been specified in the program template and indirect addressing is used (that is, based operands, parameters, strings with variable lengths, and arrays with variable subscripts), the results are not always predictable.

Description  The sum is the result of adding the addend and augend.

Operands can have floating-point, packed or zoned decimal, signed or unsigned binary type.

Source operands are the addend and augend. The receiver operand is the sum.

If operands are not of the same type, addends are converted according to the following rules:

  1. If any one of the operands has floating point type, addends are converted to floating point type.

  2. Otherwise, if any one of the operands has zoned or packed decimal type, addends are converted to packed decimal.

  3. Otherwise, the binary operands are converted to a like type. Note: unsigned binary(2) scalars are logically treated as signed binary(4) scalars.

Addend and augend are added according to their type. Floating point operands are added using floating point addition. Packed decimal addends are added using packed decimal addition. Unsigned binary addition is used with unsigned addends. Signed binary addends are added using two's complement binary addition.

Better performance can be obtained if all operands have the same type. Signed and unsigned binary additions execute faster than either packed decimal or floating point additions.

Decimal operands used in floating-point operations cannot contain more than 15 total digit positions.

For a decimal operation, alignment of the assumed decimal point takes place by padding with 0's on the right end of the addend with lesser precision.

Floating-point addition uses exponent comparison and significand addition. Alignment of the binary point is performed, if necessary, by shifting the significand of the value with the smaller exponent to the right. The exponent is increased by one for each binary digit shifted until the two exponents agree.

The operation uses the lengths and the precision of the source and receiver operands to calculate accurate results. Operations performed in decimal are limited to 31 decimal digits in the intermediate result.

The addition operation is performed according to the rules of algebra.

The result of the operation is copied into the sum 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 sum, aligned at the assumed decimal point of the sum operand, or both before being copied. Length adjustment and decimal point alignment are performed according to the rules of arithmetic operations outlined in the Arithmetic Operations. If nonzero digits are truncated on the left end of the resultant value, a size  (hex 0C0A) exception is signaled.

When the target of the instruction is signed or unsigned binary size, exceptions can be suppressed.

For the optional round form of the instruction, specification of a floating-point receiver operand is invalid.

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 a fixed-point receiver field, if nonzero digits would be truncated off the left end of the resultant value, an invalid floating-point conversion  (hex 0C0C) exception is signaled.

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

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 Conditions 

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

36 Space Management

44 Protection Violation