LDA
Load Accumulator from Memory
Load the accumulator with data from memory.
On all processors, the data loaded from memory is 8-bit. However, for 16-bit processors with the m flag is clear then the data added is 16-bit with the low-order 8-bits at the effective address and the high-order 8-bits at the effective address plus one.
Flags Affected
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
n | Set if most-significant bit of result is set | ||||||||
z | Set if result is zero |
Instructions
Syntax | Opcode | Available on: | # of | # of | Addressing Mode | ||
---|---|---|---|---|---|---|---|
(hex) | 6502 | 65C02 | 65816 | bytes | cycles | ||
LDA #const | A9 | x | x | x | 21 | 22 | Immediate |
LDA addr | AD | x | x | x | 3 | 42 | Absolute |
LDA long | AF | x | 4 | 52 | Absolute Long | ||
LDA dp | A5 | x | x | x | 2 | 32, 3 | Direct Page |
LDA (dp) | B2 | x | x | 2 | 52, 3 | Direct Page Indirect | |
LDA [dp] | A7 | x | 2 | 62, 3 | Direct Page Indirect Long | ||
LDA addr,X | BD | x | x | x | 3 | 42, 4 | Absolute Indexed X |
LDA long,X | BF | x | 4 | 52 | Absolute Long Indexed X | ||
LDA addr,Y | B9 | x | x | x | 3 | 42, 4 | Absolute Indexed Y |
LDA dp,X | B5 | x | x | x | 2 | 42, 3 | Direct Page Indexed X |
LDA (dp,X) | A1 | x | x | x | 2 | 62, 3 | Direct Page Indexed Indirect X |
LDA (dp),Y | B1 | x | x | x | 2 | 52, 3, 4 | Direct Page Indirect Indexed Y |
LDA [dp],Y | B7 | x | 2 | 62, 3 | Direct Page Indirect Long Indexed Y | ||
LDA sr,S | A3 | x | 2 | 42 | Stack Relative | ||
LDA (sr,S),Y | B3 | x | 2 | 72 | Stack Relative Indirect Indexed Y |
Notes:
- 65816: Add 1 byte if m=0 (16-bit memory/accumulator)
- 65816: Add 1 cycle if m=0 (16-bit memory/accumulator)
- 65816: Add 1 cycle if low byte of Direct Page register is not 0
- Add 1 cycle if adding index crosses a page boundary
Last modified November 5, 2021: Add instruction categories (6b74ff9)