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 |
---|---|---|---|
ORA #const |
|
2 |
|
ORA zp |
|
3 |
|
ORA zp,x |
|
4 |
|
ORA addr |
|
4 |
|
ORA addr,x |
|
4-5 |
|
Absolute+Y |
ORA addr,y |
|
4-5 |
ORA (zp,x) |
|
6 |
|
ORA (zp),y |
|
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