BASIC stamp manual v2.2
PUT – BASIC Stamp Command Reference
Page 352 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
temp VAR byte
PUT 25, 100 ' put low byte
GET 25, temp ' read byte value
DEBUG DEC temp ' display byte value
When using the $PBASIC 2.5 directive, multiple sequential values may be
stored to SPRAM, starting at Location, and the WORD modifier may be
specified to store 16-bit values.
' {$PBASIC 2.5}
temp VAR Word
PUT 25, Word 2125 ' write word value
GET 25, Word temp ' read word value
DEBUG DEC temp ' display 2125
Most Scratch Pad RAM locations are available for general use. The highest
locations have a special, read-only purpose; see the GET command for
more information.
Demo Program (GET_PUT1.bsx)
' GET_PUT1.bsx
' This example demonstrates the use of the GET and PUT commands. First,
' slot location is read using GET to display the currently running program
' number. Then a set of values are written (PUT) into locations 0 TO 9.
' Afterwards, program number 1 is RUN. This program is a BS2SX project
' consisting of GET_PUT1.BSX and GET_PUT2.BSX, but will run on the BS2e,
' BS2p, BS2pe, and BS2px without modification.
' {$STAMP BS2sx, GET_PUT2.BSX}
' {$PBASIC 2.5}
#SELECT $STAMP
#CASE BS2
#ERROR "BS2e or greater required."
#CASE BS2E, BS2SX
Slot CON 63
#CASE BS2P, BS2PE, BS2PX
Slot CON 127
#ENDSELECT
value VAR Byte
idx VAR Byte
Setup:
GET Slot, value
S
CRATCH PAD RAM LOCATIONS AND
THEIR PURPOSE
.
NOTE: This is written for the BS2sx but
can be used with the BS2e, BS2p,
BS2pe and BS2px also. This program
uses conditional compilation
techniques; see Chapter 3 for more
information.