Specifications
BASIC Stamp I and Stamp II Conversions
Page 378 • BASIC Stamp Programming Manual 1.8 • Parallax, Inc.
The other thirteen words are general purpose registers for use by the
PBASIC program. There are two methods of referencing these regis-
ters within the Stamp II as follows:
1.They may be referenced via their direct name or by defining sym-
bols as aliases.
- OR -
2. They may be referenced by defining variables of specific types (byte,
word, etc.). The software will automatically assign variables to
registers in an efficient manner.
The first method is used in the Stamp I, and supported in the Stamp II,
as a means of directly allocating register space. The second method
was introduced with the Stamp II as a means of indirectly allocating
register space and is the recommended method.
It is important to note that defining variables of specific types in the
Stamp II is not directly equivalent to assigning symbols to registers in
the Stamp I. Defining variables of specific types on the Stamp II al-
lows the software to efficiently and automatically organize variable
space within the general purpose registers while assigning symbols to
registers allows you to organize variable space yourself. While both
methods of register allocation are legal in the Stamp II, care should be
taken to implement only one method of register use within each pro-
gram. Each PBASIC program should either reference all registers by
their predefined names (or symbols assigned to them) or reference all
registers by defining variables of specific types and let the software do
the organization for you. If you use both methods within the same
program, it is likely that variables will overlap and your program will
behave erratically. The following diagram may serve to clarify the use
of the register allocation methods within a single Stamp II program:
TheByte VAR B0
TheByte=25
:
B4=15
Using only method 1 within a
program is safe.
TheByte VAR BYTE
TheByte=34
:
TheByte=10/7
Using only method 2 within a
program is safe.
TheByte VAR BYTE
TheByte=120
:
W0=2
B1=10
Using both methods within a
program leads to erratic execution.










