Specifications

BASIC Stamp II
Parallax, Inc. • BASIC Stamp Programming Manual 1.8 • Page 239
2
Binary (two-argument) Operators
Sixteen Binary Operators are listed and explaned below.
Table M-6. Binary Operators
Operator Description
+ Addition
- Subtraction
/ Division
// Remainder of division
* Multiplication
** High 16-bits of multiplication
*/ Multiply by 8-bit whole and 8-bit part
MIN Limits a value to specified low
MAX Limits a value to specified high
DIG Returns specified digit of number
<< Shift bits left by specified amount
>> Shift bits right by specified amount
REV Reverse specified number of bits
& Bitwise AND of two values
| Bitwise OR of two values
^ Bitwise XOR of two values
+
Adds variables and/or constants, returning a 16-bit result. Works ex-
actly as you would expect with unsigned integers from 0 to 65535. If
the result of addition is larger than 65535, the carry bit will be lost. If
the values added are signed 16-bit numbers and the destination is a
16-bit variable, the result of the addition will be correct in both sign
and value. For example, the expression -1575 + 976 will result in the
signed value -599. See for yourself: