Table C-4. Eight - Bit Arithmetic and Logical Group
Hags
Op-Code
Symbolic
P
No.
of
No.
of M
No.
of T
Mnemonic
Operation
C Z
V S N 11 76 543 210
Bytes
Cycles
States
Comments
ADD r
A -- A+ r
I I
V
I 0 1
10 000 r
1
1
4
r Reg.
ADDn
A--A+n
I I
V
t 0 1
II 000 110
2
2
7
000 B
001
C
n
010
D
ADD (HL)
A- A+ (HL)
I I
V
I 0 I
10 000 110
1
2
7
011 E
ADD (IX+d)
A-A+ (IX+d)
I I
V
I 0 I
11 oil 101
3
5
19
100 H
B
000 110
10
L
I
1I1
A
d
ADD (IY+d)
A-A+(IY+d)
I I
V
I 0 L
I I 111 101
3
S
19
0 000 110
d
ADCs
A -- A+s+CY I I
V I 0 I
001
sis any of I, r,
SUBS
tA^A-s
I I
V 2 I I
010
(HL), (IX+d),
SBCs
A - A - s - CY
I I
V I I I
©
fIY+d) as shown for
ADD instruction
AND,
A-A A s
0 1
P
I 0 I
100
OR
A ,A V s
0 1
P
I 0 I
110
The mdicatcd bits
XOR s
A A ®s
0 1
P
1 0 1
101
replace the 000 in
CPs
A-s
I I
V
I I I
III
the ADD set above
INCr
r-r+I
I
V
I 0 I
Off r 100
I
1
4
INC (If L)
(HL) - (HL)+I
• I
V
1 0 1
00 110 100
I
3
II
INC (IX+d)
(lX+d) .-
I
V
1 0 1
II Oil 101
3
6
23
)IX+d)+1
011 I10 100
J
INC UY+d)
(IY+d)•-
I
V
t 0 I
II Ill 101
3
6
23
(IY+d)+I
00 11(1 10(1
1)I.C d
2.-d-I
V
I I I
1111
sl any utr(HLI.
(IX+d). IIY+d) as
shown for INC
Same format and
states as IN(
Ite p1cc e 11111 sv ith
101 in OP code.
Notes: The V symbol in the P/V flag column indicates that the I"V flag contains the overflow of the result of the
operation Similarly the 1' rymbol indicates parity. V = I in c, n. overt ow, V = 0 means nol overllos. P = I
means parity of the result is even, P = 0 means panty of the result is odd
Flag Notation : = flag not affected, 0 = flag reset, I = Ila_ act, X = (lay is unknown.
I - flag is affected according to the result of the operation
287
Need help?
Do you have a question about the Z80 and is the answer not in the manual?
Questions and answers