Datasheet
Chapter 2: EEPROM Tricks and Program Tips ยท Page 43
Figure 2-1 shows what the DATA directives will store in the EEPROM bytes with
addresses 0 to 31. It also points out the first byte address of each
DATA directive with
Symbol names. Keep in mind that the BASIC Stamp Editor makes each DATA directive's
Symbol name a constant equal to the address of the first byte in the DATA directive. That
way, you can always use the
Symbol name to reference the first DataItem in a given
DATA directive.
When the program is downloaded, the values 7, 20, 11, 2, and 80 get stored in EEPROM
bytes at addresses 0, 1, 2, 3, and 4. The BASIC Stamp Editor assigns the
Numbers
Symbol name the constant value 0. The RunStatus DATA directive stores the value 0 in
the EEPROM byte at address 5, so
RunStatus becomes the constant value 5.
UndefData sets aside 20 bytes of EEPROM for use by the program. No values are
written to those EEPROM bytes, and if values are already stored there, they won't be
overwritten. As with the rest of the
DATA directives, UndefData can now be used in
place of the number 6. Since
UndefData reserves 20 bytes, the Alphabet DATA
directive doesn't start until byte 26 in EEPROM.
Alphabet becomes the constant value
26, and "A" is stored at address 26, "B" at address 27, and so on.
Figure 2-1 EEPROM Addresses 0 to 32