Specifications
BASIC Stamp II
Parallax, Inc. • BASIC Stamp Programming Manual 1.8 • Page 245
2
REV
Returns a reversed (mirrored) copy of a specified number of bits of a
value, starting with the rightmost bit (lsb). For instance, %10101101
REV 4 would return %1011, a mirror image of the first four bits of the
value. Example:
debug bin ? %11001011 REV 4 ' Mirror 1st 4 bits (%1101)
&
Returns the bitwise AND of two values. Each bit of the values is sub-
ject to the following logic:
0 AND 0 = 0
0 AND 1 = 0
1 AND 0 = 0
1 AND 1 = 1
The result returned by & will contain 1s in only those bit positions in
which both input values contain 1s. Example:
debug bin ? %00001111 & %10101101 ' Show AND result (%00001101)
|
Returns the bitwise OR of two values. Each bit of the values is subject
to the following logic:
0 OR 0 = 0
0 OR 1 = 1
1 OR 0 = 1
1 OR 1 = 1
The result returned by | will contain 1s in any bit positions in which
one or the other or both input values contain 1s. Example:
debug bin ? %00001111 | %10101001 ' Show OR result (%10101111)










