beautypg.com

Rpbasic-52 programming guide, Warning – Remote Processing BASIC 52 User Manual

Page 70

background image

RPBASIC-52 PROGRAMMING GUIDE

2-51

LD@

Syntax:

L D @ expr
Where: expr = valid integer address of 00H through 0FFFFH (65535)

Function:

Retrieves a floating-point number previously saved with ST@

Mode:

Comm and, run

Use:

LD@ 3000

Cards:

All

D E S C R IP T I ON

LD@ is used in conjunction with PUSH, POP, and ST@ . Use these commands to save and retrieve floating
p o in t n u mb e rs to p ro g ra m R A M .

NOTE: LD@ and ST@ cannot use ex tended RA M. Only se gment 0 R AM (u sed for running B asic

programs) is used. Use PEEKF and POKEF commands to access this memory.

WARNING:

Wh en 128 K and 512K RA M are installe d, all of m emo ry is cle ared o n pow er up a nd rese t.
Do not use LD@ or ST @ to save floating point numbers in segment 0. Use POKE and
PEEK type comm ands instead.

32K R AM sy stems hav e address 7E 00H set as M TOP. T his location up to 7F FFH m ay be used to sto re
variables.

expr is the ad dress in RA M of w here a num ber is sto red.

Each floatin g-poin t num ber req uires si x byte s of m emo ry. expr in the ST@ and LD@ instructions specify the
high address. A number is stored at locations expr through expr-6.

RELATED

ST@, PUSH, POP, PEEKF POKEF

E R R O R

BAD A RGUM ENT when expr > 65535

EXAMPLE

100 A=AIN(0)*.234
110 PUSH A
120 ST@7F00H

.
.

300 LD@7F00H
310 POP B
320 PRINT "Analog value retrieved=",B

>run

Analog value retrieved=",B