5: BASIC Stamp Command Reference - DATA
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 93
program can then use the MyNumbers constant as a reference to the start of
the data within a READ or WRITE command. Each DATA directive can
have a unique symbol preceding it, allowing you to reference the data
defined at different locations.
There may be a time when you wish to reserve a section of EEPROM for
use by your BASIC code, but not necessarily store data there to begin with.
To do this, simply specify a DataItem within parentheses, as in:
DATA @100, (20)
The above DATA directive will reserve 20 bytes of EEPROM, starting with
location 100. It doesn’t store any values there, rather it simply leaves the
data as it is and increments DATA’s location pointer by 20. A good reason
to do this is when you have a program already downloaded into the
BASIC Stamp that has created or manipulated some data in EEPROM. To
protect that section of EEPROM from being overwritten by your next
program (perhaps a new version of the same program) you can reserve the
space as shown above. The EEPROM’s contents from locations 100 to 119
will remain intact. NOTE: This only "reserves" the space for the program
you are currently downloading; the BASIC Stamp does not know to
"reserve" the space for future programs. In other words, make sure use
this feature of the DATA directive in every program you download if you
don't want to risk overwriting valuable EEPROM data.
It is important to realize that EEPROM is not overwritten during
programming unless it is needed for program storage, or is filled by a
DATA directive specifying data to be written. During downloading,
EEPROM is always written in 16-byte sections if, and only if, any
location within that section needs writing.
DATA can also store the same number in a block of consecutive locations.
This is similar to reserving a block of EEPROM, above, but with a value
added before the first parenthesis. For example,
DATA @100, 0 (20)
This statement writes the value 0 in all the EEPROM locations from 100 to
119.
R
ESERVING
EEPROM
LOCATIONS
.
W
RITING A BLOCK OF THE SAME
VALUE
.
I
MPORTANT CONCEPT
:
H
OW DATA
AND PROGRAMS ARE DOWNLOADED
EEPROM.
Содержание BASIC Stamp 1
Страница 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...