MOVE Instructions
The MOVE instruction transfers the contents of the source operand to the destination operand. The contents of the source operand remain unchanged. The instruction uses the following format:
|
|
|
|
|
Enhanced array processing is supported with the MOVE instruction. Consider the following examples that are applicable to all MOVE examples in this chapter.
|
|
|
|
|
|
|
|
|
|
|
|
This would move all array elements from ARR1 to their corresponding elements in ARR2.
|
|
|
|
|
|
|
|
This would move 'abc' to all array elements in ARR1.
Arithmetic expressions are also supported in the MOVE instruction. If arithmetic expressions are used, the destination operand must be Numeric Variable. The arithmetic expression must also be enclosed in parentheses.
|
|
|
|
|
|
|
|
|
|
|
|
This would calculate the Fahrenheit temperature from the Celsius temperature.
The MOVE instruction also supports RECORDS. The MOVE must be performed between two identically defined records. The contents of each member in the source record is moved to the corresponding member in the destination.
MOVE operations are allowed between RECORD POINTERs and VARLIST or VARLIST pointers (9.6A). Since a RECORD pointer actually contains the address of a varlist of the members of a RECORD, a member to member MOVE operation of every variable in the source and destination variable lists is done. RECORD pointers can be used for both the source and destination operands of a MOVE instruction.
Example:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following topics contain specific information regarding the MOVE instruction:
|
MOVE - Variable or Expression to Multiple Variables or Lists |
![]() |