BASIC stamp manual v2.2
BASIC Stamp Architecture – &/, |/
Page 120 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
DEBUG BIN8 ? %00001111 ^ %10101001 ' Show result of XOR (%10100110)
The And Not operator (&/) returns the bitwise AND NOT of two values.
Each bit of the values is subject to the following logic:
0 AND NOT 0 = 0
0 AND NOT 1 = 0
1 AND NOT 0 = 1
1 AND NOT 1 = 0
The result returned by &/ will contain 1s in any bit positions in which the
first value is 1 and the second value is 0. Example:
SYMBOL value1 = B2
SYMBOL value2 = B3
SYMBOL result = B4
value1 = %00001111
value2 = %10101001
result = value1 &/ value2
DEBUG %result ' Show result of AND NOT (%00000110)
The Or Not operator (|/) returns the bitwise OR NOT of two values. Each
bit of the values is subject to the following logic:
0 OR NOT 0 = 1
0 OR NOT 1 = 0
1 OR NOT 0 = 1
1 OR NOT 1 = 1
The result returned by |/ will contain 1s in any bit positions in which the
first value is 1 or the second value is 0. Example:
SYMBOL value1 = B2
SYMBOL value2 = B3
SYMBOL result = B4
value1 = %00001111
value2 = %10101001
result = value1 |/ value2
DEBUG %result ' Show result of OR NOT (%01011111)
A
ND NOT: &/
O
R NOT: |/
All
2
1
1
1
1