Page 18 • BASIC Stamp II Manual 0.94 • Parallax, Inc. • (916) 624-8333
BASIC Stamp II
The compiler will group all words, bytes, nibs, and bits, and respec-
tively arrange them into unused RAM. By pressing Alt-M, you can see
a picture of the RAM allocation. First, the three I/O words are shown,
then all words, bytes, nibs, and finally, bits, are seen. Empty RAM
follows. Alt-M is a quick way to assess how much RAM you’ve used.
The VAR usage options are as follows:
‘define unique variables
sym1 VAR bit ‘make a bit variable
sym2 VAR nib ‘make a nibble variable
sym3 VAR byte ‘make a byte variable
sym4 VAR word ‘make a word variable
‘After bit/nib/byte/word a value may be placed
‘within parentheses to declare an array size:
sym5 VAR nib (10) ‘make a 10 nibble array
‘define variables-within-variables or alias variables
sym6 VAR sym4.highbit ‘make a bit variable of sym4’s highbit
sym7 VAR sym4.lowbit ‘make a bit variable of sym4’s lowbit
sym8 VAR sym2 ‘make an alternate name for sym2
‘When using VAR to assign non-unique variables (a variable
‘name is used in lieu of bit/nib/byte/word(size)), a period may
‘be placed after the variable name and followed by modifiers.
‘Modifiers are used to identify sub-pieces of the initially-
‘mentioned variable.
sym9 VAR sym4.highbyte.lownib.bit2 ‘picky, picky...
Here are all the variable modifiers:
LOWBYTE ‘low byte of a word
HIGHBYTE ‘high byte of a word
BYTE0 ‘byte0 (low byte) of a word
BYTE1 ‘byte1 (high byte) of a word