MOVEGADDR Examples


Example 1:

 

ACCTNO

DIM

%8

ACCTPTR

DIM

^

  

...

 

  

MOVEGADDR

"ACCTNO",ACCTPTR

 

This instruction moves the address of "ACCTNO" in the global data area to ACCTPTR. The OVER flag is cleared and the ZERO flag is set.

 

Example 2:

 

ZIPCODE

DIM

%9

ZIPPTR

FORM

^

ZIPLBL

INIT

"ZIPCODE"

  

...

 

  

MOVEGADDR

ZIPLBL,ZIPPTR

 

This instruction does not modify ZIPPTR because even though "ZIPCODE" is in the global data area, the data type is different from ZIPPTR. Both the OVER and ZERO flags are set.

 

Example 3:

 

ZIPCODE

DIM

%9

ZIPPTR

DIM

^

  

...

 

  

MOVEGADR

"ZIPCODES",ZIPPTR

 

This instruction does not modify ZIPPTR because "ZIPCODES" is not in the global data area. The OVER flag is set and the ZERO flag is cleared.

 

Example 4:

 

MTOTAL

FORM

%6.2(12)

TOTALPTR

FORM

^

  

...

 

  

MOVEGADR

"MTOTAL(4)",TOTALPTR

 

This instruction moves the address of "MTOTAL(4)" in the global data area to TOTALPTR. The OVER flag is cleared and the ZERO flag is set.

 

Example 5:

 

MTOTAL

FORM

%6.2(12)

MNDX

FORM

%2

TOTALPTR

FORM

^

  

...

 

  

MOVE

"10",MNDX

  

MOVEGADR

"MTOTAL(MNDX)",TOTALPTR

 

This instruction moves the address of "MTOTAL(MNDX)" in the global data area to TOTALPTR. MNDX is in the global data area and has a value of ten (10). The OVER flag is cleared and the ZERO flag is set.

 



PL/B Language Reference MOVEFPTR Examples MOVELPTR Examples