MOVE - Arithmetic Expression to Numeric Field
The MOVE arithmetic expression to numeric field instruction combines multiple PL/B arithmetic operations (addition, subtraction, multiplication, division, modulo, and power) within a single instruction. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
num
Required. A Numeric Variable or a numeric constant value or equivalent {ctrl} character.
op
Required. One of the supported arithmetic operation types (+, -, *, /, %, **).
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
dest
Required. A Numeric Variable that serves as the destination operand.
Flags Affected: ZERO
Note the following:
MOVE analyzes the mathematical equation and generates the appropriate PL/B arithmetic operations to perform the equation(s).
The {num} variables or constants remain unchanged. The result of the operation(s) is placed in {dest}.
Any numeric constants within the equation are treated as INTEGER variables, unless they contain a decimal that designates they are treated as a FORM variable. A numeric constant may be enclosed in double quotes.
|
|
|
|
|
|
|
|
|
|
The arithmetic operations in an equation are executed such that multiplication (*), division (/), and modulo (%) operations are performed before addition (+) and subtraction (-). Otherwise, the arithmetic operations are performed left to right. Nesting of operations is allowed using parentheses. The '%" operator peforms a modulo operation. The instruction must start with an open parentheses and must end with a close parentheses and the parentheses must be balanced (an equal number of left and right parenthesis). Nested operations are performed first beginning at the lowest nesting level and working outward. The '%' operator peforms a modulo operation.
Internal MOVE precision is dependent upon the type of variables and literals used within the expression. Integer significance is maintained with the precision of a FORM 32 variable for all operations that do not involve a decimal point. Real significance is maintained with the precision of a FORM 32.32 variable for all operations that involve a decimal point. Take care when replacing multiple PL/B math instructions with a single MOVE instruction.
The maximum number of operands in an equation is 100.
Only the ZERO Condition Flag is set after a MOVE instruction.
Due to MOVE's use of three operand arithmetic instructions and its FORM 32.32 precision, MOVE generated code is not as fast as that generated in-line using two operand arithmetic instructions and temporary variables only of the sizes required.
The instruction may be continued on multiple lines only then the compiler is operating in Sunbelt mode. When the compiler is in ANSI mode, continuation lines are not supported.
See Also: Example Code, CALC, MOVE
![]() |