LD r, s
8-bit register instructions
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
\(r \longleftarrow r'\) | ||||||||
LD r, r' | ||||||||
0 | 1 | r | r' | |||||
\(r \longleftarrow n\) | ||||||||
LD r, n | ||||||||
0 | 0 | r | 1 | 1 | 0 | |||
n | ||||||||
\(A \longleftarrow (BC)\) | ||||||||
LD A, (BC) | ||||||||
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0A |
\(A \longleftarrow (DE)\) | ||||||||
LD A, (DE) | ||||||||
0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1A |
\(r \longleftarrow (HL)\) | ||||||||
LD r, (HL) | ||||||||
0 | 1 | r | 1 | 1 | 0 | |||
\(r \longleftarrow (IX+d)\) | ||||||||
LD r, (IX+d) | ||||||||
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
0 | 1 | r | 1 | 1 | 0 | |||
d | ||||||||
\(r \longleftarrow (IY+d)\) | ||||||||
LD r, (IY+d) | ||||||||
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | FD |
0 | 1 | r | 1 | 1 | 0 | |||
d | ||||||||
\(I \longleftarrow A\) | ||||||||
LD I,A | ||||||||
1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | ED |
0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 47 |
\(R \longleftarrow A\) | ||||||||
LD R, A | ||||||||
1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | ED |
0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 4F |
Register | r |
---|---|
B | 000 |
C | 001 |
D | 010 |
E | 011 |
H | 100 |
L | 101 |
A | 111 |
Flags Affected
None. |
Opcode Matrix
A | B | C | D | E | H | L | (HL) | (BC) | (DE) | (IX+d) | (IY+d) | n | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A |
LD A, A
7F14 |
LD A, B
7814 |
LD A, C
7914 |
LD A, D
7A14 |
LD A, E
7B14 |
LD A, H
7C14 |
LD A, L
7D14 |
LD A, (HL)
7E17 |
LD A, (BC)
0A17 |
LD A, (DE)
1A17 |
LD A, (IX+d)
DD7Enn319 |
LD A, (IY+d)
FD7Enn319 |
LD A, n
3Enn27 |
B |
LD B, A
4714 |
LD B, B
4014 |
LD B, C
4114 |
LD B, D
4214 |
LD B, E
4314 |
LD B, H
4414 |
LD B, L
4514 |
LD B, (HL)
4617 |
|
|
LD B, (IX+d)
DD46nn319 |
LD B, (IY+d)
FD46nn319 |
LD B, n
06nn27 |
C |
LD C, A
4F14 |
LD C, B
4814 |
LD C, C
4914 |
LD C, D
4A14 |
LD C, E
4B14 |
LD C, H
4C14 |
LD C, L
4D14 |
LD C, (HL)
4E17 |
|
|
LD C, (IX+d)
DD4Enn319 |
LD C, (IY+d)
FD4Enn319 |
LD C, n
0Enn27 |
D |
LD D, A
5714 |
LD D, B
5014 |
LD D, C
5114 |
LD D, D
5214 |
LD D, E
5314 |
LD D, H
5414 |
LD D, L
5514 |
LD D, (HL)
5617 |
|
|
LD D, (IX+d)
DD56nn319 |
LD D, (IY+d)
FD56nn319 |
LD D, n
16nn27 |
E |
LD E, A
5F14 |
LD E, B
5814 |
LD E, C
5914 |
LD E, D
5A14 |
LD E, E
5B14 |
LD E, H
5C14 |
LD E, L
5D14 |
LD E, (HL)
5E17 |
|
|
LD E, (IX+d)
DD5Enn319 |
LD E, (IY+d)
FD5Enn319 |
LD E, n
1Enn27 |
H |
LD H, A
6714 |
LD H, B
6014 |
LD H, C
6114 |
LD H, D
6214 |
LD H, E
6314 |
LD H, H
6414 |
LD H, L
6514 |
LD H, (HL)
6617 |
|
|
LD H, (IX+d)
DD66nn319 |
LD H, (IY+d)
FD66nn319 |
LD H, n
26nn27 |
L |
LD L, A
6F14 |
LD L, B
6814 |
LD L, C
6914 |
LD L, D
6A14 |
LD L, E
6B14 |
LD L, H
6C14 |
LD L, L
6D14 |
LD L, (HL)
6E17 |
|
|
LD L, (IX+d)
DD6Enn319 |
LD L, (IY+d)
FD6Enn319 |
LD L, n
2Enn27 |
I |
LD I, A
ED4724 |
|
|
|
|
|
|
|
|
|
|
|
|
R |
LD R, A
ED4F24 |
|
|
|
|
|
|
|
|
|
|
|
|
Instruction
Opcode hexSize bytesCycle count
| Register | Memory | Implicit | Special |
Last modified November 16, 2021: Update flag rendering so it can be reused for the Z80 (06001ea)