This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

ADC Add with Carry

Addition with carry

Table of Contents

The ADC instruction performs an addition with carry. If carry is set then it will be included in the calculation whilst any overflow from the addition will be passed on to the carry flag.

1 - ADC 8 bit add with Carry

Addition with carry
76543210
 
\(A \longleftarrow A + r + Carry\)
ADC A,r
10001r
 
\(A \longleftarrow A + n + Carry\)
ADC A,n
11001110CE
n
 
\(A \longleftarrow A + (HL) + Carry\)
ADC A, (HL)
100011108E
 
\(A \longleftarrow A + (IX+d) + Carry\)
ADC A, (IX + d)
11011101DD
100011108E
d
 
\(A \longleftarrow A + (IY+d) + Carry\)
ADC A, (IY + d)
11111101FD
100011108E
d
Registers
Registerr
B000
C001
D010
E011
H100
L101
A111
Flags Affected
Flags
sz-h-p/v-c
sset if result negative
zset if result is 0
hset if carry from bit 3
p/vset if overflow
cset if carry from bit 7
Opcode Matrix
ABCDEHL(HL)(IX+d)(IY+d)n
A
ADC A,A
8F14
ADC A,B
8814
ADC A,C
8914
ADC A,D
8A14
ADC A,E
8B14
ADC A,H
8C14
ADC A,L
8D14
ADC A,(HL)
8E17
ADC A,(IX+d)
DD8Enn319
ADC A,(IY+d)
FD8Enn319
ADC A,n
CEnn27
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register Memory Implicit

2 - ADC 16 bit add with Carry

Addition with carry
76543210
 
\(HL \longleftarrow HL + ss + Carry\)
ADC HL, dd
11101101ED
01dd1010
Registers
Valuedd
00BC
01DE
10HL
11SP
Flags Affected
Flags
sz-h-p/v-c
sset if result negative
zset if result is 0
hset if carry from bit 11
p/vset if overflow
cset if carry from bit 15
Opcode Matrix
BCDEHLSP
HL
ADC HL,BC
ED4A215
ADC HL,DE
ED5A215
ADC HL,HL
ED6A215
ADC HL,SP
ED7A215
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register