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:
|
|
|
|
|
|
|
|
|
|
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:
The result is placed in the last operand specified {dest} and the other operands always remain unchanged.
If format two (2) is specified, the value in {source2} is moved into {dest} then {dest} is multiplied by {source1}.
The EQUAL (or ZERO), OVER, and LESS Condition Flags are applicable.
The rounding and truncation rules described in the section on Numeric Variables are applicable.
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.
This operation supports the mixing of variable types (FORM and INTEGER).
Enhanced Array processing is supported.
See Also: Example Code, CALC, MOVE, Mathematical Instructions
![]() |