halfcarry
Half carry, or the half-carry flag, is a status indicator used in several 8-bit CPU architectures to signal a carry or borrow that occurs within the lower nibble of a byte (the lowest four bits) during arithmetic. In practice, it flags a carry from bit 3 to bit 4 in additions, or a borrow from bit 4 in subtractions. The exact behavior can vary by processor, but the common purpose is to assist binary-coded decimal (BCD) arithmetic and related low-nibble operations.
In addition, the half-carry flag is typically set when the sum of the low nibbles exceeds 0x0F.
The half-carry flag is used by decimal adjust operations such as DAA (Decimal Adjust after Addition) in
Architectures that implement a half-carry concept include the Z80 family, the Intel 8080 lineage, the Game Boy’s