DAS (Decimal Adjust Subtract)
DAS
<Description>
Given that the result of a subtraction operation performed by the SUB.B, SUBX, or NEG
instruction on 4-bit BCD data is contained in an 8-bit general register and the carry and half-
carry flags, the DAA instruction adjusts the result by adding H'00, H'FA, H'A0, or H'9A to the
general register according to the table below.
Valid results are not assured if this instruction is executed under conditions other than those
stated above.
<Operation>
Rd (decimal adjust)
→
Rd
<Assembly-Language Format>
DAS
Rd
<Examples>
DAS R0H
<Operand Size>
Byte
<Condition Code>
I: Previous value remains unchanged.
H: Unpredictable.
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: Unpredictable.
C: Previous value remains unchanged.
I
H
N
Z
V
C
—
—
*
—
↕
↕
*
—
0
0 – 9
0
0 – 9
H'00
0
0
0 – 8
1
6 – F
H'FA
0
1
7 – F
0
0 – 9
H'A0
1
1
6 – F
1
6 – F
H'9A
1
C flag
Upper nibble
H flag
Lower nibble
Value
added
Resulting
C flag
Status before adjustment
71
Содержание H8/300 Series
Страница 2: ...H8 300 Programming Manual...