The DAA instruction is used in GameBoy programming to perform arithmetic with Binary Coded Decimal (BCD) numbers. BCD is a decimal number whose digits are encoded in binary. The DAA instruction corrects the result of an arithmetic operation to ensure it remains in BCD form. It applies rules such as adding a value of 6 when the unit digit is greater than 9, and adding a value of 60 when the result exceeds 99.

9m read timeFrom blog.ollien.com
Post cover image
Table of contents
What the Heck is Binary Coded Decimal?Adding Binary Coded Decimal NumbersSubtracting Binary Coded Decimal NumbersDAA’s FlagsWrapping it up

Sort: