MULTIPLY


ANSI

 

The MULTIPLY instruction (which may be abbreviated as MULT) multiplies the contents of the first operand by the contents of the second operand can, optionally, place the result in a third operand. It uses one of the following formats:

 

(1)

[label]

MULTIPLY

{source}{sep}{dest}

(2)

[label]

MULTIPLY

{source1}{sep}{source2}{sep}{dest}

 

Where:

label

Optional. A Program Execution Label.

source

Required. A Numeric Variable, numeric Literal, or Expression that is multiplied with the {dest} variable.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

dest

Required. A Numeric Variable to which the {source} variable is multiplied.

source1

Required. A Numeric Variable, numeric Literal, or Expression that is multiplied to the {dest} after the {source2} variable has been moved to {dest}.

sep2

Required. A comma or the keyword GIVING.

source2

Required. A Numeric Variable that is moved to {dest} before dest is multiplied by {source1}.

Flags Affected: LESS, OVER, ZERO

Note the following:

  1. The result is placed in the last operand specified {dest} and the other operands always remain unchanged.

  2. If format two (2) is specified, the value in {source2} is moved into {dest} then {dest} is multiplied by {source1}.

  3. The EQUAL (or ZERO), OVER, and LESS Condition Flags are applicable.

  4. The rounding and truncation rules described in the section on Numeric Variables are applicable.

  5. If the environment variable PLB_ROUND is present, the result is rounded in accordance with the ANSI PL/B specification. Otherwise, the source operand is aligned and rounded, as applicable, to the destination operand's format.

  6. This operation supports the mixing of variable types (FORM and INTEGER).

  7. Enhanced Array processing is supported.

 

 

See Also: Example Code, CALC, MOVE, Mathematical Instructions

 



PL/B Language Reference MODULO NFORMAT