From NES Hacker Wiki
Jump to: navigation, search
Or Memory With Accumulator
Opcode: ORA
Operation: A | M → A
Status Register: Status-List.png

ORA (Or Memory With Accumulator) performs a logical OR on the operand and the accumulator and stores the result in the accumulator. This opcode is similar in function to AND and EOR.


This pseudo C code shows how the ORA opcode functions when it is executed.

Operand |= ACCUMULATOR        // OR the two values together.
SET_NEGATIVE(Operand);        // Clears the Negative Flag if the Operand is $#00-7F, otherwise sets it.
SET_ZERO(Operand);            // Sets the Zero Flag if the Operand is $#00, otherwise clears it.
ACCUMULATOR = Operand;        // Stores the Operand in the Accumulator Register.

Addressing Modes

Addressing Mode Assembly Language Form Opcode # Bytes # Cycles
Immediate ORA #Operand 09 2 2
Zero Page ORA Operand 05 2 3
Zero Page, X ORA Operand, X 15 2 4
Absolute ORA Operand 0D 3 4
Absolute, X ORA Operand, X 1D 3 4*
Absolute, Y ORA Operand, Y 19 3 4*
(Indirect, X) ORA (Operand, X) 01 2 6
(Indirect), Y ORA (Operand), Y 11 2 5*
* Add 1 if page boundary is crossed.