MOVEADDR
The MOVEADDR instruction (which may be abbreviated as MOVEADR) is one way to attach a Pointer Definition to a Data Definition or Object variable. MOVEADDR links the memory address of a variable to a Pointer of the same data type. Pointers are useful for allowing a single subroutine, using Pointer Definition Labels, to process different variables simply by attaching the variables to the subroutine Pointers prior to invoking the subroutine. The instruction uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source1
Required. A previously defined Character String Variable, Numeric Variable, VAR, or Object whose address is moved to the {dest} operand.
source2
Required. A previously defined Pointer variable that whose value is moved to the {dest} operand.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
dest
Required. A previously defined Pointer or VAR variable that receives the address from the {source} operand.
Flags Affected: NONE
Note the following:
The {source} and {dest} operands must be the same data type unless using the typeless VAR variables. Otherwise, a compiler error occurs.
MOVEADDR moves the address of {ptr} or {var} to another {ptr}. The Pointer(s) attached to a variable may be used transparently to process the single data item in memory that is referenced.
MOVEADDR dereferences the destination pointer one level only. If the destination pointer points to a pointer, the second level pointer is modified. To eliminate dereferencing, zero the destination pointer before the MOVEADDR statement.
For PLBCMP, Pointers become invalid after a ROLLOUT. They must be reattached if they are referenced again.
Enhanced ARRAY processing is supported.
See Also: Example Code, MOVEGADDR, System Interface Instructions
![]() |