Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 170

Chapter
Statements
11
11 -18
Use the LD@ statement to retrieve floating point numbers stored with a
ST@ statement (page 11 -35). The expression following the LD@
statement specifies the address where you want to store the number after
executing the LD@. The LD@ statement places the number on the
argument stack at the address location you specify with expr.
You can use this statement with CALL 77 (page 13 -6) to retrieve variables
from a protected area of memory. This protected area is not zeroed on
power up or when you issue the RUN command (page 10 -19).
Important: LD@ and ST@ are not used with any port designation.
Syntax
LD@
expr
Example
>PRINT MTOP
24515
>PRINT MTOP 10*6
24455
>PUSH 24455 : CALL 77
>1 REM EXAMPLE PROGRAM
>5 DIM A(10),B(10)
>10 REM *** ARRAY SAVE ***
>20 FOR I = 0 TO 3
>30 A(I) = I+20
>40 PUSH A(I) : REM PUT NUMBER ON STACK
>50 ST@ 5FFFH-I*6
>60 NEXT I
>70 REM *** GET ARRAY ***
>80 FOR I = 0 TO 3
>90 LD@ 5FFFH-I*6
>100 POP B(I) : REM GET NUMBER FROM STACK
>110 PRINT B(I)
>120 NEXT I0
READY
>RUN
20
21
22
23
READY
>PUSH 5FFFH : CALL 77
>PTINT MTOP
24575
LD@