MOVEADDR Examples


Example 1:

 

DIM1

DIM

1

FORM1

FORM

1

INT1

INTEGER

1

PTRDIM

DIM

^

PTRFORM

FORM

^

PTRINT

INTEGER

^

PRTVAR

VARLIST

^

PTRDIM2

DIM

^

VARLIST

VARLIST

DIM1,FORM1,INT1

.

 

 

  

MOVEADDR

DIM1,PTRDIM

 

 

Variable

PL

FP

LP

Contents

Before:

DIM1

1

1

1

A

 

PTRDIM

 

 

 

N/A

 

After:

DIM1

1

1

1

A

 

PTRDIM

 

 

 

Address of DIM1

 

After this instruction was executed, any further PL/B instructions that referenced PTRDIM would perform as if they were referencing DIM1. Thus if we MOVEd 'A' to PTRDIM or DIM1, the result would be the same.

 

Example 2:

 

  

MOVEADDR

PTRDIM,PTRDIM2

(DIM Pointer to DIM Pointer)

 

 

Variable

Contents

Before:

PTRDIM

Address of DIM1

 

PTRDIM2

N/A

 

After:

PTRDIM

Address of DIM1

 

PTRDIM2

Address of PTRDIM

 

Thus, any further PL/B instructions that referenced PTRDIM or PTRDIM2 would perform as if they were referencing DIM1. Thus if we MOVEd 'A' to PTRDIM, PTRDIM2 or DIM1, the result would be the same.

 

Example 3:

 

  

MOVEADDR

FORM1,PTRFORM

(FORM to FORM)

 

 

Variable

PL

Contents

Before:

FORM1

5

•••43

 

PTRFORM

 

N/A

 

After:

FORM1

5

•••43

 

PTRFORM

 

Address of FORM1

 

Thus, any further PL/B instructions that referenced PTRFORM would perform as if they were referencing FORM1. Thus if we MOVEd '123' to PTRFORM or FORM1, the result would be the same.

 

Example 4:

 

  

MOVEADDR

INT1,PTRINT

(INTEGER to INTEGER)

 

 

Variable

PL

Contents

Before:

INT1

2

0x135

 

PTRINT

 

N/A

 

After:

INT1

2

0x135

 

PTRINT

 

Address of INT1

 

Thus, any further PL/B instructions that referenced PTRINT would perform as if they were referencing INT1. Thus if we MOVEd '256' to PTRINT or INT1, the result would be the same.

 

Example 5:

 

  

MOVEADDR

VARLIST,PTRVAR

(VARLIST to VARLIST)

 

 

Variable

Contents

Before:

VARLISTX

N/A

 

PTRVAR

N/A

 

After:

VARLISTX

N/A

 

PTRVAR

Address of VARLISTX

 

After this instruction was executed, any further PL/B instructions that referenced PTRVAR would perform as if they were referencing the variables defined in VARLISTX. Thus, if we UNPACKed a 'null' variable into PTRVAR or VARLISTX, the result would be the same.

 

Example 6:

 

BUTTON1

BUTTON

 

BUTTON1P

BUTTON

^

.

 

 

  

MOVEADDR

BUTTON1,BUTTON1P

 

 

Variable

Contents

Before:

BUTTON

N/A

 

BUTTON1P

N/A

 

After:

BUTTON1

N/A

 

BUTTON1P

Address of BUTTON1

 

After this instruction was executed, any further PL/B instructions that referenced BUTTON1P would perform as if they were referencing the object BUTTON1.

 



PL/B Language Reference MOVE - VARLIST to VARLIST Example MOVEFPTR Examples