Datasheet
PBASIC Instruction Set
The following gives a complete list of PBASIC commands for both versions of the Stamp. It does not
include arithmetic or logical operators. Many enhancements were made to the PBASIC language with
the release of the BASIC Stamp II and thus some commands only exist on one version of the BASIC
Stamp. For more detailed information on the differences between PBASIC1 and PBASIC2, download
the BASIC Stamp I to BASIC Stamp II Conversion document.
Indicates instruction is only available on BASIC Stamp D and BS1-IC.
Indicates instruction is only available on BS2-IC.
BRANCHING
IF . . .THEN Compare and conditionally branch.
BRANCH Branch to address specified by offset.
GOTO Branch to address.
GOSUB Branch to subroutine at address.
RETURN Return from subroutine.
LOOPING
FOR . . . NEXTEstablish a FOR - NEXT loop.
NUMERICS
LET Perform variable manipulation, such as A=5, B=A+2, etc. Possible operations
are add, subtract, multiply, divide, max. limit, min. limit, and logical
operations AND, OR, XOR, AND NOT, OR NOT, and XOR NOT.
LOOKUP Lookup data specified by offset and store in variable. This instruction
provides a means to make a lookup table.
LOOKDOWN Find target's match number (0-N) and store in variable.
RANDOM Generate a pseudo-random number.
DIGITAL I/O
INPUT Make pin an input
OUTPUT Make pin an output
05/18/98 15:19:10
Parallax, Inc. -- PBASIC Instruction Set http://www.parallaxinc.com/stamps/pbasic.htm