5: BASIC Stamp Command Reference – GET
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 127
GET
BS1 BS2
BS2e BS2sx BS2p
GET
Location, Variable
Function
Read value from Scratch Pad RAM Location and store in Variable.
•
Location
is a variable/constant/expression (0 – 63 for Bs2e and BS2sx
and 0 – 127 for BS2p) that specifies the Scratch Pad RAM location to
read from.
•
Variable
is a variable (usually a byte) to store the value into.
Quick Facts
BS2e, BS2sx
BS2p
Scratch Pad
RAM size and
organization
64 bytes (0 – 63). Organized as
bytes only.
128 bytes (0 – 127). Organized as
bytes only.
General purpose
locations
0 - 62
0 – 126
Special use
location
Current program slot number in
read-only location 63.
Current program slot number in
lowest nibble of read-only location
127. Current read/write slot number
in highest nibble of location 127.
Explanation
The GET command reads a byte-sized 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.
Scratch Pad RAM 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:
Temp VAR BYTE
GET 25, Temp
DEBUG DEC Temp
Scratch Pad RAM locations 0 though 62 are available for general use. The
highest location (63 for BS2e and BS2sx and 127 for the BS2p) is a special,
read-only, location that always contains the number of the currently
running program slot. On the BS2p, the upper nibble of location 127 also
e
2
sx
2
p
2
U
SES FOR
S
CRATCH
P
AD
RAM.
S
CRATCH
P
AD
RAM
LOCATIONS AND
THEIR PURPOSE
.
Table 5.13: GET Quick Facts.
Summary of Contents for BASIC Stamp 2e
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...