5: BASIC Stamp Command Reference – PUT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 245
PUT
BS1 BS2
BS2e BS2sx BS2p
PUT
Location, Value
Function
Put Value into Scratch Pad RAM Location.
•
Location
is a variable/constant/expression (0 – 63: BS2e/BS2sx, 0 -
127: BS2p) that specifies the Scratch Pad RAM location to write to.
•
Value
is a variable/constant/expression (0 - 255) to store in RAM.
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 PUT command writes a byte-sized value into the specified Scratch
Pad RAM location. All values in the general-purpose locations can be
written to 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 write
the value 100 to location 25, read it back out with GET, and display it:
Temp VAR BYTE
PUT 25, 100
GET 25, Temp
DEBUG DEC Temp
Most Scratch Pad RAM locations are available for general use. The highest
location (63 for BS2e/BS2sx and 127 for 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 contains
e
2
sx
2
p
2
Table 5.64: PUT Quick Facts.
U
SES FOR
S
CRATCH
P
AD
RAM.
S
CRATCH
P
AD
RAM
LOCATIONS AND
THEIR PURPOSE
.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...