BASIC stamp manual v2.2
STORE – BASIC Stamp Command Reference
Page 452 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
GOSUB Show_Slot_Info
END
Show_Slot_Info:
GET 127, value
DEBUG CR, "Pgm Slot: ", DEC value.NIB0,
CR, "R/W Slot: ", DEC value.NIB1,
CR, CR
FOR idx = 0 TO 4
READ idx, value
DEBUG "Location: ", DEC idx, TAB,
"Value: ", DEC3 value, CR
NEXT
RETURN
The next Demo program, STOREALL.bsp, is not related to the previous
three programs. STOREALL.bsp demonstrates the use of the STORE
command to treat contiguous program slots as one block of memory (14
kBytes on the BS2p and BS2px, 30 kBytes on the BS2pe). This illustrates
one of the most powerful uses of the STORE command.
Demo Program (STOREALL.bsp)
' STOREALL.bsp
' This program demonstrates the STORE command and how it can be used to
' "flatten" the EEPROM space for applications requiring a lot of storage.
' This program writes to EEPROM locations within program slots 1 though 7
' on the BS2p and BS2px, and 1 through 15 on the BS2pe, thus, has access to
' 14- or 30-kBytes of space.
' {$STAMP BS2p}
' {$PBASIC 2.5}
#SELECT $STAMP
#CASE BS2, BS2E, BS2SX
#ERROR "This program requires BS2p, BS2pe, or BS2px."
#CASE BS2P, BS2PX
HiSlot CON 7
#CASE BS2PE
HiSlot CON 15
#ENDSELECT
LoSlot CON 1 ' first slot for "flat" EE
MemSize CON HiSlot - LoSlot + 1 * 2048
eeAddr VAR Word ' address pointer
value VAR Word ' cell value
slot VAR Byte ' current R/W slot
NOTE: This example program can be
used with the BS2p, BS2pe, and
BS2px. This program uses conditional
compilation techniques; see Chapter 3
for more information.