DATA - BASIC Stamp Command Reference
Page 92
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
DATA 72, 69, 76, 76, 79
DATA 104, 101, 108, 108, 111
The first DATA directive will start at location 0 and increment the pointer
for each data value it stores (1, 2, 3, 4 and 5). The second DATA directive
will start with the pointer value of 5 and work upward from there. As a
result, the first 10 bytes of EEPROM will look like the following:
EEPROM Location (address)
0
1
2
3
4
5
6
7
8
9
Contents
72
69
76
76
79
104
101
108
108
111
What if you don’t want to store values starting at location 0? Fortunately,
the DATA directive has an option to specify the next location to use. You
can specify the next location number (to set the pointer to) by inserting a
DataItem in the form @x ;where x is the location number. The following
code writes the same data in Table 5.4 to locations 100 through 109:
DATA @100, 72, 69, 76, 76, 79, 104, 101, 108, 108, 111
In this example, the first DataItem is @100. This tells the DATA directive to
store the following DataItem(s) starting at location 100. All the DataItems to
the right of the @100 are stored in their respective locations (100, 101,
102… 109).
In addition, the DATA directive allows you to specify new starting
locations at any time within the DataItem list. If, for example, you wanted
to store 56 at location 100 and 47 at location 150 (while leaving every other
location intact), you could type the following:
DATA @100, 56, @150, 47
If you have multiple DATA directives in your program, it may be difficult
to remember exactly what locations contain the desired data. For this
reason, the DATA directive can optionally be prefixed with a unique
symbol name. This symbol becomes a constant that is set equal to the
location number of the first byte of data within the directive. For example,
MyNumbers DATA @100, 72, 73
This would store the values 72 and 73 starting with location 100 and will
create a constant, called MyNumbers, which is set equal to 100. Your
Table 5.4: Example EEPROM
storage.
W
RITING DATA TO OTHER LOCATIONS
.
A
UTOMATIC CONSTANTS FOR DEFINED
DATA
.
Содержание 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...