
12.6 8-Bit Arithmetic
(Continued)
7
6
5
4
3
2
1
0
1
0
0
1
0
1
1
0
SUB (HL)
Timing:
M cyclesD2
T statesD7 (4, 3)
Addressing Mode:
SourceDRegister Indirect
DestinationDImplied
0
SUB (IX
a
d) (for N
X
e
0)
1
SUB (IY
a
d) (for N
X
e
1)
7
6
5
4
3
2
1
1
1
N
X
1
1
1
0
1
0
0
1
0
1
1
0
d
Timing:
M cyclesD5
T statesD19 (4, 4, 3, 5, 3)
Addressing Mode:
SourceDIndexed
DestinationDImplied
SBC
A, m
1
Subtract, with carry, the contents of memory location m
1
from the Accumulator.
A
w
A
b
m
1
b
CY
S: Set if result is negative
Z: Set if result is zero
H: Set if carry from bit 3
P/V: Set if result exceeds 8-bit 2’s
complement range
N: Set
C: Set according to borrow
condition
0
7
6
5
4
3
2
1
1
0
0
1
1
1
1
0
SBC A, (HL)
Timing:
M cyclesD2
T statesD7 (4, 3)
Addressing Mode:
SourceDRegister Indirect
DestinationDImplied
7
6
5
4
3
2
1
0
SBC A, (IX
a
d) (for N
X
e
0)
1
1
N
X
1
1
1
0
1
SBC A, (IY
a
d) (for N
X
e
1)
1
0
0
1
1
1
1
0
d
Timing:
M cyclesD5
T statesD19 (4, 4, 3, 5, 3)
Addressing Mode:
SourceDIndexed
DestinationDImplied
AND
m
1
The data in memory location m
1
is logically AND’ed to the
Accumulator.
A
w
A
!
m
1
S: Set if result is negative
Z: Set if result is zero
H: Set
P/V: Set if result parity is even
N: Reset
C: Reset
0
7
6
5
4
3
2
1
1
0
1
0
0
1
1
0
AND (HL)
Timing:
M cyclesD2
T statesD7 (4, 3)
Addressing Mode:
SourceDRegister Indirect
DestinationDImplied
0
AND (IX
a
d) (for N
X
e
0)
1
AND (IY
a
d) (for N
X
e
1)
7
6
5
4
3
2
1
1
1
N
X
1
1
1
0
1
0
1
0
0
1
1
0
d
Timing:
M cyclesD5
T statesD19 (4, 4, 3, 5, 3)
Addressing Mode:
SourceDIndexed
DestinationDImplied
OR
m
1
The data in memory location m
1
is logically OR’ed with the
Accumulator.
A
w
A
m
1
S: Set if result is negative
Z: Set if result is zero
H: Reset
P/V: Set if result parity is even
N: Reset
C: Reset
0
7
6
5
4
3
2
1
1
0
1
1
0
1
1
0
OR (HL)
Timing:
M cyclesD2
T statesD7 (4, 3)
Addressing Mode:
SourceDRegister Indexed
DestinationDImplied
0
OR (IX
a
d) (for N
X
e
0)
1
OR (IY
a
d) (for N
X
e
1)
7
6
5
4
3
2
1
1
1
N
X
1
1
1
0
1
0
1
1
0
1
1
0
d
Timing:
M cyclesD5
T statesD19 (4, 4, 3, 5, 3)
Addressing Mode:
SourceDIndexed
DestinationDImplied
41