Adjust flag

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The Adjust flag (also known as the Auxiliary flag) is a flag stored in the FLAGS register on all x86 compatible CPUs. It is bit 4. It is used to indicate when an arithmetic carry or borrow has been generated out of the 4 least significant bits. It is primarily used in BCD arithmetics.

Auxiliary flag is set (AF=1) if there is a carry from low nibble to high nibble or a borrow from a high nibble to low nibble of the low order 8-bit of a 16-bit number.(for example, in BCD addition or subtraction.)

See also[edit]

Status register
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 (bit position)
- - - - O D I T S Z - A - P - C Flags