The ADD
instruction performs an addition without carry.
Any overflow from the addition will be passed on to the carry flag.
This the multi-page printable view of this section.Click here to print.
The ADD
instruction performs an addition without carry.
Any overflow from the addition will be passed on to the carry flag.
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|
\(A \longleftarrow A + r\) | |||||||
ADD A, r | |||||||
1 | 0 | 0 | 0 | 0 | r |
Register | r |
---|---|
B | 000 |
C | 001 |
D | 010 |
E | 011 |
H | 100 |
L | 101 |
A | 111 |
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
s | set if result negative | ||||||||
z | set if result is 0 | ||||||||
h | set if carry from bit 3 |
A | B | C | D | E | H | L | |
---|---|---|---|---|---|---|---|
A |
ADD A,A
8714 |
ADD A,B
8014 |
ADD A,C
8114 |
ADD A,D
8214 |
ADD A,E
8314 |
ADD A,H
8414 |
ADD A,L
8514 |
Instruction
Opcode hexSize bytesCycle count
| Register |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
\(A \longleftarrow A + n\) | ||||||||
ADD A, n | ||||||||
1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | C6 |
n |
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
s | set if result negative | ||||||||
z | set if result is 0 | ||||||||
h | set if carry from bit 3 | ||||||||
p/v | set if overflow | ||||||||
c | set if carry from bit 7 |
n | |
---|---|
A |
ADD A,n
C6nn27 |
Instruction
Opcode hexSize bytesCycle count
| Implicit |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
\(A \longleftarrow A + (HL)\) | ||||||||
ADD A, (HL) | ||||||||
1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 86 |
\(A \longleftarrow A + (IX+d)\) | ||||||||
ADD A, (IX+d) | ||||||||
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 86 |
d | ||||||||
\(A \longleftarrow A + (IY+d)\) | ||||||||
ADD A, (IY+d) | ||||||||
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | FD |
1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 86 |
d |
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
s | set if result negative | ||||||||
z | set if result is 0 | ||||||||
h | set if carry from bit 3 | ||||||||
p/v | set if overflow | ||||||||
c | set if carry from bit 7 |
(HL) | (IX+d) | (IY+d) | |
---|---|---|---|
A |
ADD A,(HL)
8617 |
ADD A,(IX+d)
DD86nn319 |
ADD A,(IY+d)
FD86nn319 |
Instruction
Opcode hexSize bytesCycle count
| Memory |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
\(HL \longleftarrow HL + dd\) | ||||||||
ADD HL, dd | ||||||||
0 | 0 | dd | 1 | 0 | 0 | 1 | ||
\(IX \longleftarrow IX + pp\) | ||||||||
ADD IX, pp | ||||||||
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
0 | 0 | pp | 1 | 0 | 0 | 1 | ||
\(IY \longleftarrow IY + mm\) | ||||||||
ADD IY, mm | ||||||||
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | FD |
0 | 0 | mm | 1 | 0 | 0 | 1 |
Value | dd | mm | pp |
---|---|---|---|
00 | BC | BC | BC |
01 | DE | DE | DE |
10 | HL | IY | IX |
11 | SP | SP | SP |
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
s | set if result negative | ||||||||
z | set if result is 0 | ||||||||
h | set if carry from bit 11 | ||||||||
c | set if carry from bit 15 |
BC | DE | HL | SP | IX | IY | |
---|---|---|---|---|---|---|
HL |
ADD HL,BC
09111 |
ADD HL,DE
19111 |
ADD HL,HL
29111 |
ADD HL,SP
39111 |
|
|
IX |
ADD IX,BC
DD09215 |
ADD IX,DE
DD19215 |
|
ADD IX,SP
DD39215 |
ADD IX,IX
DD29215 |
|
IY |
ADD IY,BC
FD09215 |
ADD IY,DE
FD19215 |
|
ADD IY,SP
FD39215 |
|
ADD IY,IY
FD29215 |
Instruction
Opcode hexSize bytesCycle count
| Register |