Table of Contents

Two Address Add (INC)/OP=01

Format

OP AF BF A Syllable B Syllable

OP = 01

AF is the length of the A Syllable field. AF may be indirect or may indicate the A Syllable is a literal. A value of 00 is equal to a length of 100 units.
BF is the length of the B Syllable field. BF may be indirect. A value of 00 is equal to a length of 100 units.

The A Syllable is the address of the addend field. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA.
The B Syllable is the address of the augend and sum fields. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA.

Function

The two address Add instruction adds the contents of one memory location A to the contents of a second memory location B and stores the sum in the second memory location B unless an overflow condition exists. If the number of significant digits in the result is greater than the sum field length, the sum field will be unchanged, the Comparison Flags will be unchanged and the Overflow Flag will be set.

Store the absolute value of the sum when the sum field data type is unsigned (UN or UA). Store the standard EBCDIC form of the result sign as the first digit of the result when the sum field data type is SN. Fill the zone digit with the EBCDIC numeric subset code (F) when the sum field data type is alphanumeric (UA).

The sign of a zero sum is always considered to be positive.

If addend and augend are of unequal lengths (AF not equal to BF), the shorter of the two is treated as if it has been left filled with zero's.

Only the numeric digits of an alphanumeric field enter into the operation. Unsigned (UN or UA) operands are assumed to be positive.

If the operand data contains undigits other than in the sign digit, cause an Invalid Arithmetic Data fault. See Compatibility Notes A.16.

Comparison Flags

In all cases except overflow, set the Comparison Flags to indicate whether the sum is greater than (HIGH), equal to (EQUAL) or less than (LOW) zero.

Overlap

A and B may totally overlap or may have matching type-address overlap (see 3.5.3). Partial overlap of A and B other than matching type-address overlap may produce incompatible results. See Compatibility Notes A.08.

Examples

Example (1) Add an Alpha field to a Signed field

OP AF BF A Syllable B Syllable
01 02 04 A field UA B field SN
                    BEFORE         AFTER
  A FIELD            01B7        unchanged
  B FIELD           +0257          C0274
  COMPARISON          nn            HIGH
  OVERFLOW            nn         unchanged

Example (2) Add with Overflow Condition

OP AF BF A Syllable B Syllable
01 02 03 A field UN B field UN
                    BEFORE         AFTER
  A FIELD             18         unchanged
  B FIELD            985            985
  COMPARISON          nn         unchanged
  OVERFLOW            nn             ON