BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – PUT
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 351
PUT
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
PUT Location, { WORD } Value { , { WORD } Value... }
Function
Write one or more values to the Scratch Pad RAM (SPRAM), starting at
Location.
• Location is a variable/constant/expression (0 – 62 for BS2e and
BS2sx, and 0 – 126 for BS2p, BS2pe, and BS2px) that specifies the
SPRAM location to write to.
• Value is a variable/constant/expression (0 – 255, or 0 – 65535 if
using the optional WORD modifier) to store in the SPRAM.
Quick Facts
Table 5.85: PUT Quick Facts.
NOTE: When the WORD modifier
is used, the low byte of the value
is written to Location, the high
byte to Location + 1.
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
GET
GET and STORE,
and SPSTR formatter.
PBASIC 2.5
Syntax Options
Multiple sequential variables may be written to the Scratch Pad RAM.
The optional WORD modifier may be specified to store 16-bit values.
Explanation
The PUT command writes value into the specified Scratch Pad RAM
(SPRAM) location. All values in the general-purpose locations can be
written to 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 write the value 100 to
location 25, read it back out with GET, and display it:
U
SES FOR SCRATCH PAD RAM.
NOTE: The optional arguments require
PBASIC 2.5.