BASIC stamp manual v2.2
STORE – BASIC Stamp Command Reference
Page 450 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
Demo Program (STORE0.bsp)
' STORE0.bsp
' This program demonstrates the STORE command and how it affects the READ
' and WRITE commands. This program "STORE0.BSP" is intended to be down-
' loaded into program slot 0. It is meant to work with STORE1.BSP and
' STORE2.BSP. Each program is very similar (they display the current
' Program Slot and READ/WRITE Slot numbers and the values contained in the
' first five EEPROM locations. Each program slot will have different data
' due to different DATA commands in each of the programs downloaded.
' {$STAMP BS2p, STORE1.BSP, STORE2.BSP}
' {$PBASIC 2.5}
#IF ($STAMP < BS2P) #THEN
#ERROR "This program requires BS2p, BS2pe, or BS2px."
#ENDIF
idx VAR Word ' index
value VAR Byte
LocalData DATA @0, 1, 2, 3, 4, 5
Main:
GOSUB Show_Slot_Info ' show slot info/data
PAUSE 2000
STORE 1 ' point READ/WRITE to Slot 1
GOSUB Show_Slot_Info
PAUSE 2000
RUN 1 ' run program in Slot 1
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
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.