First page Back Continue Last page Overview Graphics
Logic Instructions: OR
OR - Performs a bit-by-bit OR operation.
An OR gate output is high if any input is high.
Destination registers are A (ORAA) or B (ORAB).
All addressing modes are available.
What is the value in A after the following code executes?
- ldaa #$bb
- oraa #$f0
- 1011 1011 ⋁ 1111 0000 = 1111 1011 = $fb
The truth table (A and B are inputs and X is an output) for an OR gate is:
A B X
0 0 0
0 1 1
1 0 1
1 1 1
The oraa instruction performs a bit-by-bit ORing of the bits in the destination register with the operand. In this example bit 0 of register A is ORed with bit 0 of the number f0 hex, and bit 1 of A is ORed with bit 1 of the number f0 hex etc.