2.2.23 DAA
DAA (Decimal Adjust Add)
Decimal Adjust
Operation
Rd (decimal adjust)
→
Rd
Assembly-Language Format
DAA
Rd
Operand Size
Byte
Condition Code
H: Undetermined (no guaranteed value).
N: Set to 1 if the adjusted result is negative;
otherwise cleared to 0.
Z:
Set to 1 if the adjusted result is zero;
otherwise cleared to 0.
V: Undetermined (no guaranteed value).
C: Set to 1 if there is a carry at bit 7;
otherwise left unchanged.
I
UI
H
U
N
Z
V
C
—
—
*
—
↕
↕
*
↕
Description
Given that the result of an addition operation performed by an ADD.B or ADDX instruction on
4-bit BCD data is contained in an 8-bit register Rd (destination register) and the carry and half-
carry flags, the DAA instruction adjusts the general register contents by adding H'00, H'06, H'60,
or H'66 according to the table below.
C Flag
Upper 4 Bits
H Flag
Lower 4 Bits
C Flag
before
before
before
before
after
Adjustment
Adjustment
Adjustment
Adjustment
Adjustment
0
0 to 9
0
0 to 9
00
0
0
0 to 8
0
A to F
06
0
0
0 to 9
1
0 to 3
06
0
0
A to F
0
0 to 9
60
1
0
9 to F
0
A to F
66
1
0
A to F
1
0 to 3
66
1
1
1 to 2
0
0 to 9
60
1
1
1 to 2
0
A to F
66
1
1
1 to 3
1
0 to 3
66
1
Value Added
(hexadecimal)
75