Table of Contents

Multiply (MPY)/OP=05

Format

OP AF BF A Syllable B Syllable C Syllable

OP = 05

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 multiplier 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 multiplicand field. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA.
The C Syllable is the address of the product field. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA.

Function

The Multiply instruction multiplies the contents of one memory location B by the contents of a second memory location A and stores the product in a third memory location C. The product field length is equal to the sum of AF and BF and could be as long as 200 units.

Store the absolute value of the sum when the product 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 product field data type is SN. Fill the zone digit with the EBCDIC numeric subset code (F) when the product field data type is alphanumeric (UA).

The Overflow Flag is not affected by this instruction.

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

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 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 partially or totally overlap.

Overlap of A and B with C, other than matching type-address overlap may produce incompatible results. See Compatibility Notes A.10.

Examples

Example (1) Multiply an ALpha field by an Unsigned field

OP AF BF A Syllable B Syllable C Syllable
05 02 05 A field UA B field UN C Field SN
                    BEFORE         AFTER
  A FIELD            D1D2        unchanged
  B FIELD           00011        unchanged
  C FIELD         nnnnnnn         C0000132
  COMPARISON          nn            HIGH

Example (2) Multiply two Signed numbers

OP AF BF A Syllable B Syllable C Syllable
05 02 02 A field SN B field SN C Field SN
                    BEFORE         AFTER
  A FIELD             D15        unchanged
  B FIELD             D17        unchanged
  C FIELD           nnnnn          C0255
  COMPARISON          nn            HIGH