MOVEGADDR


7.8.6

 

The MOVEGADDR instruction (which may be abbreviated as MOVEGADR) moves the physical address of a global data item to a pointer variable. This instruction differs from the MOVEADDR instruction. MOVEGADDR gets the address of a variable based on the name contained in a character variable or literal, instead of the name of a character variable. The instruction uses the following format:

 

 

[label]

MOVEGADDR

{source}{sep}{dest}

 

Where:

label

Optional. A Program Execution Label.

source

Required. A previously defined Character String Variable or Literal variable whose address 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 variable that receives the address from the {source} operand.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The Global Data Area is searched for an item that matches the contents of {source} and has the same data type as {dest}. If found, and the data types match, its address is moved to {dest} and the OVER flag is cleared and the ZERO flag is set.

  2. If a matching item is found and it is not the same type as {dest}, the OVER and ZERO flags are both set and {dest} is not changed.

  3. The address of any element of an ARRAY may be retrieved by specifying the array element after the variable name. The array element may be specified as an immediate or a global variable.

  4. If no matching item is found, the OVER flag is set and the ZERO flag is cleared and {dest} is not changed.

  5. {dest} must be null prior to the execution of this instruction. If it is not null, the EOS flag is set and nothing is done.

 

 

See Also: Example Code, MOVEADDR, System Interface Instructions

 



PL/B Language Reference MOVEADDR MOVELABEL