Ld@ -43, Purpose, Syntax – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 233: Example

Advertising
background image

Publication 1746-RM001A-US-P

Input Functions 13-43

LD@

Purpose

Use the LD@ statement to retrieve floating point numbers that were stored with a
ST@ statement. The expression [expr] following the LD@ statement specifies the
address where the number is stored after executing the LD@. The LD@ statement
places the number on the ARGUMENT STACK at the address location specified
by [expr].

This statement can be used with CALL 77 to retrieve variables from a protected
area of memory. This protected area is not zeroed on powerup or when the RUN
command is issued.

Syntax

LD@ [expr]

Example

>P. MTOP

24515

P. 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 9

>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 9

>90

LD@ 5FFFH–I*6

>100 POP B(I) : REM GET NUMBER FROM STACK

>110 PRINT B(I)

>120 NEXT I0

IMPORTANT

This instruction is not associated with any port designation.

IMPORTANT

LD@ is not used with any port designation.

Advertising