Das (Decimal Adjust Subtract) - Renesas H8/300 Series Programming Manual

Table of Contents

Advertisement

DAS (Decimal Adjust Subtract)

<Operation>
Rd (decimal adjust) → Rd
<Assembly-Language Format>
DAS Rd
<Examples>
DAS R0H
<Operand Size>
Byte
<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.
C flag
0
0
1
1
Status before adjustment
Upper nibble
H flag
0 – 9
0 – 8
7 – F
6 – F
<Condition Code>
I
— —
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.
Lower nibble
0
0 – 9
1
6 – F
0
0 – 9
1
6 – F
71
H
N
Z
*
Value
Resulting
added
C flag
H'00
0
H'FA
0
H'A0
1
H'9A
1
DAS
V
C
*

Advertisement

Table of Contents
loading

Table of Contents