ORA (OR Accumulator with Memory)

A = A OR [operand]

ORA performs a bitwise OR operation on the accumulator register (A) and an operand. The result is then stored in the accumulator.

Addressing Modes

Addressing Mode

Opcode

Bytes

Cycles

Immediate

ORA #const

09 nn

2

ZeroPage

ORA zp

05 nn

3

ZeroPage+X

ORA zp,x

15 nn

4

Absolute

ORA addr

0D ll hh

4

Absolute+X

ORA addr,x

1D ll hh

4-5

Absolute+Y

ORA addr,y

19 ll hh

4-5

(Indirect+X)

ORA (zp,x)

01 nn

6

(Indirect)+Y

ORA (zp),y

11 nn

5-6

* Add 1 cycle if page boundary is crossed.

Flags Affected

  • N (Negative) – Set if the result has the most significant bit set (i.e., is negative); otherwise, it is cleared.

  • Z (Zero) – Set if the result is zero; otherwise, it is cleared.

Examples

; Sets A to 0x34
LDA #$10
ORA #$24

; Sets A to 0x3F
LDA #$B0
ORA #$8F

; Sets A to 0xFF
LDA #$00
ORA #$FF

See Also

  • AND (AND Accumulator with Memory)

  • EOR (Exclusive OR Accumulator with Memory)

Comments