Logical Operators and Bit Shifting
The 6502 Microprocessor supports the logical operators AND, OR, and XOR and Shift Left and Shift Right bit shifting.
ANDAND performs a logical AND on an entire byte. The result switches all bits to 0 unless both are 1. Below is a truth table for every possible condition at the bit level.

OROR performs a logical OR on an entire byte. The result switches all bits to 1 if any bit is 1, and 0 if both bits are 0. Below is a truth table for every possible condition at the bit level.

XORXOR performs a logical Exclusive OR on an entire byte. The result switches all bits to 1 if they are different or 0 if they are the same. Below is a truth table for every possible condition at the bit level.

Shift LeftShift Left moves each bit in a byte one space to the left. The leftmost bit is thrown away, and a the empty space is filled with a 0.

Shift RightShift Right moves each bit in a byte one space to the right. The rightmost bit is thrown away, and a the empty space is filled with a 0.
