BASIC Stamp II Manual 0.94 • Parallax, Inc. • (916) 624-8333 • Page 21
BASIC Stamp II
+ add
- subtract
* multiply
/ divide
<< shift left
>> shift right
& logical AND
| logical OR
^ logical XOR
example:
growth CON 100-light/gel ‘“light” and “gel” are CON’s, too
The DATA statment - defining data
EEPROM memory not used by your BASIC program can be used for
data storage. Keep in mind that your BASIC program builds from the
end of memory towards the start of memory. This allocation is auto-
matic. Your data, on the other hand, builds from the start of memory
towards the end. The sum of program and data memory cannot ex-
ceed the 2K byte limit. The compiler will always tell you when you
have a conflict.
DATA statements are used to build data into unused memory. Ini-
tially, the DATA location is set to 0. It is advanced by 1 for each byte
declared. Here is an example DATA statement:
table DATA “Here is a string...”
Usually, you’ll want to precede DATA statements with a unique sym-
bol. The symbol will be assigned a constant value (as if via CON) which
is the current data pointer. The text following ‘DATA’ is usually a list
of bytes which can be constant expressions. In the above example (as-
suming this was the first DATA statement in the program), “table”
becomes a constant symbol of value 0; “Here is a string...” is broken
into individual bytes and placed into EEPROM memory sequentially.
Alt-M and two <SPACE>s will show you the result of this line.