DAA
Decimal Adjust Accumulator
Operation
A ← Decimal Adjust (A)
Description
This instruction conditionally adjusts the accumulator, A, following addition and subtrac-
tion operations on binary-coded-decimal (BCD) values. For addition (ADD, ADC, INC)
or subtraction (SUB, SBC, DEC, NEG),
the DAA instruction.
Table 51. Operations of the DAA Instruction
Operation
ADD, ADC,
or INC
SUB, SBC,
DEC, or
NEG
Condition Bits Affected
S
Z
H
UM007714-0908
Hex
Value in
Upper
C Before
Digit
DAA
(Bits 7:4)
0
0–9
0
0–8
0
0–9
0
A–F
0
9–F
0
A–F
1
0–2
1
0–2
1
0–3
0
0–9
0
0–8
1
7–F
1
6–F
Set if the msb of the result is 1 after the operation; reset
otherwise.
Set if result is 0; reset otherwise.
See
.
Table 51
Table 51
indicates the operation performed by
Hex
Value in
Lower
Number
H Before
Digit
Added to
DAA
(Bits 3:0)
Byte
0
0–9
00
0
A–F
06
1
0–3
06
0
0–9
60
0
A–F
66
1
0–3
66
0
0–9
60
0
A–F
66
1
0–3
66
0
0–9
00
1
6–F
FA
0
0–9
A0
1
6–F
9A
®
eZ80
CPU
User Manual
C After
H After
DAA
DAA
0
0
0
1
0
0
1
0
1
1
1
0
1
0
1
1
1
0
0
0
0
0
1
0
1
0
CPU Instruction Set
129
Need help?
Do you have a question about the eZ80 and is the answer not in the manual?
Questions and answers