← Back to context

Comment by djmips

8 hours ago

At least the 6502 has a BCD mode built in!

The Z80 does have a DAA (decimal adjust arithmetic) instruction to facilitate BCD arithmetic. I don't think I ever used it in my Z80 years and I'm not familiar with the details. Sadly I have much less experience with the 6502, I didn't even know it had a BCD mode.

I'd like to amplify this. Decimal math using nibbles containing 0 through 9 was standard operating procedure, one of the things that made the 6502 nice. Unfortunately you had to use a short loop to convert between 2s complement and BCD.