# `daa`

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

Web page: https://asm-editor.specy.app/documentation/z80/instruction/daa

**Decimal adjust A**

Category: Arithmetic

Adjusts A after a BCD addition or subtraction so that each nibble holds a decimal digit.

1 byte · 4 cycles

## Flags

| Flag | Effect |
| --- | --- |
| S | depends on the result |
| Z | depends on the result |
| H | changed as the description says |
| P/V | holds the parity of the result |
| N | not changed |
| C | changed as the description says |

## Forms

- `daa` · Adjusts A for BCD addition and subtraction operations. Sets the carry flag if A was greater than 99h, and otherwise leaves it unchanged. Sets the half-carry flag if the adjustment carries or borrows between the low and high digits, and resets it otherwise.

## Example

```z80
        .org 0x8000
        ld a, 5
        daa
        halt
```
