Page 22 • BASIC Stamp II Manual 0.94 • Parallax, Inc. • (916) 624-8333
BASIC Stamp II
The DATA pointer may be altered at any time by an @ sign followed
by a new pointer value:
list
DATA
@$100,”some data”
DATA has a few variations of use to allocate defined and undefined
data. Defined data is fully declared and known at compile time. Un-
defined data is the mere allocation of data space, while not assigning
values into the bytes of EEPROM (to be done at run-time, instead).
Defined and undefined data are declared as follows:
for defined data:
fee
DATA
0,1,2,3,4,5,6,7,8,9
‘actual bytes
fie
DATA
word 1000
‘make two bytes: $E8 and $03
foe
DATA
0 (256)
‘256 bytes initialized as 0
for undefined data:
fum
DATA
(1024)
‘reserved 1K byte of undefined data
abc
DATA
word (16)
‘reserve 16 words of undefined data
Important concept: Defined DATA and BASIC program memory are
always downloaded to the BS2. Undefined data and unused EEPROM
memory are not downloaded. This allows you to change programs
while keeping data, assuming both programs defined the same stretch
of memory as undefined DATA. Alt-M will show you maps of EEPROM
allocation. This download/don’t-download rule is applied to 16-byte
blocks. If any byte within a 16-byte block is defined DATA or BASIC
program, that whole block is downloaded. Use Alt-M to see this.
In summary, DATA is used to define EEPROM byte usage that doesn’t
conflict with the BASIC program storage:
• DATA can be preceeded by a symbol which will be assigned the
constant value of the current DATA pointer.
• Byte-size data is assumed, but ‘word’ can be used to break a word
into two bytes of storage.
• The @ sign is used to redirect the DATA pointer. If a symbol preceeds
Summary of Contents for BASIC Stamp II
Page 2: ...BLANK PAGE...