# `das`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/das

**Packed BCD adjust after subtraction**

Category: Arithmetic

Adjusts al after a packed BCD subtraction so each nibble holds one decimal digit, setting CF and AF as needed.

8086 and later · Not available in 64-bit mode

[Intel's reference: DAS](https://intel.github.io/SDM/instruction/DAS.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | depends on the result |
| PF | depends on the result |
| AF | depends on the result |
| ZF | depends on the result |
| SF | depends on the result |
| DF | not changed |
| OF | undefined (do not rely on it) |

Reads: CF, AF

## Forms

- `das`

## Description

For the unpacked
equivalents, see [`AAA`](https://asm-editor.specy.app/documentation/x86/instruction/aaa.md).

`DAA` should be used after a one-byte `ADD` instruction whose
destination was the `AL` register: by means of examining the value
in the `AL` and also the auxiliary carry flag `AF`, it
determines whether either digit of the addition has overflowed, and
adjusts it (and sets the carry and auxiliary-carry flags) if so. You
can add long BCD strings together by doing `ADD`/`DAA` on the
low two digits, then doing `ADC`/`DAA` on each subsequent pair
of digits.

`DAS` works similarly to `DAA`, but is for use after `SUB`
instructions rather than `ADD`.
