Basic programming guide – Remote Processing BASIC for the CX-10 Modbus User Manual
Page 76
BASIC PROGRAMMING GUIDE
2-67
ST@
Syntax:
ST@ expr
Where: expr = 0 to 65535
Function:
Takes a floating-point number from the argument stack and stores it to data memory at the address.
Mode:
Command, run
Use:
PUSH B : ST@7E00
DESCRIPTION
ST@ is used in conjunction with PUSH, POP, and LD@. 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 PEEK and POKE 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
LD@, PUSH, POP
ERROR
expr location should be above MTOP. Otherwise the data may be overwritten.
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