Basic programming guide – Remote Processing BASIC for the CX-10 Modbus User Manual

Page 37

Advertising
background image

BASIC PROGRAMMING GUIDE

2-28

LD@

Syntax:

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

Function:

Retrieves a floating-point number previously saved with ST@

Mode:

Command, run

Use:

LD@3000

DESCRIPTION

LD@ is used in conjunction with PUSH, POP, and ST@. Use these commands to save and retrieve floating
point numbers to program RAM.

NOTE: LD@ and ST@ cannot use extended RAM. Only segment 0 RAM (used for running Basic

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

WARNING:

When 128K and 512K RAM are installed, all of memory is cleared on power up and reset.
Do not use LD@ or ST@ to save floating point numbers in segment 0. Use POKE and
PEEK type commands instead.

32K RAM systems have address 7E00H set as MTOP. This location up to 7FFFH may be used to store
variables.

expr is the address in RAM of where a number is stored.

Each floating-point number requires six bytes of memory. 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

ERROR

BAD ARGUMENT when expr > 65535

EXAMPLE

100

A=REGREAD(9)*.007234

110

PUSH A

120

ST@7F00H

.
.

300

LD@7F00H

310

POP B

320

PRINT "Analog value retrieved=",B

>run

Analog value retrieved=",B

Advertising