Z80 Assembly 09: BCD Arithmetic and the RST (Restart) Interrupts
BCD Arithmetic: The DAA Instruction Binary-Coded Decimal (BCD) is a way to store numbers where each byte holds two decimal digits (0-9). This is vital for financial or numerical applications where decimal accuracy is required, as standard binary math can introduce rounding errors when converting to decimal. The Problem: If you add 9 and 1 in binary, the result is 10 (0A Hex). In BCD, the result should be 10 (10 Hex). ...