BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – GET
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 203
GET
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
GET Location, { WORD } Variable { , { WORD } Variable... }
Function
Read the value from Scratch Pad RAM (SPRAM) Location and store in
Variable.
Location is a variable/constant/expression (0 – 63 for BS2e and
BS2sx and 0 – 131 for BS2p, BS2pe, and BS2px) that specifies the
SPRAM location to read from.
Variable is a variable (usually a byte, or word if using the optional
WORD modifier) in which to store the value.
Quick Facts
Table 5.27: GET Quick Facts.
BS2e and BS2sx BS2p, BS2pe, and BS2px
Scratch Pad RAM
Size and
Organization
64 bytes (0 – 63). Organized as
bytes only.
136 bytes (0 – 135). Organized as
bytes only.
General Purpose
Locations
0 - 62 0 – 126
Special Use
Location
Location 63: Active program slot
number (read only).
Location 127: READ/WRITE slot and
Active Program slot (read only).
Locations 128-135: Polled Interrupt
status (read only).
Related
Commands
PUT
PUT and STORE,
and SPSTR formatter.
PBASIC 2.5
Syntax Options
Multiple sequential variables may be read from the Scratch Pad RAM.
The optional WORD modifier may be specified to retrieve 16-bit values.
Explanation
The GET command reads a value from the specified Scratch Pad RAM
location and stores it into Variable. All values in all locations can be
retrieved from within any of the 8 program slots.
SPRAM is useful for passing data to programs in other program slots and
for additional workspace. It is different than regular RAM in that symbol
names cannot be assigned directly to locations and each location is always
configured as a byte only. The following code will read the value at
location 25, store it in a variable called temp and display it:
U
SES FOR SCRATCH PAD RAM.
NOTE: The optional arguments require
PBASIC 2.5.