The third system for printing numbers is very similar to the second – where we stored each digit of the number separately. This gave us complete control over how big the number could be, and removed some of the drawbacks of storing the number as an 8 or 16-bit value.
However… doesn’t it seem a little wasteful to store a single digit – 0 to 9 – using a whole byte? And doesn’t it also seem a little strange there there appears to be no support for doing this kind of thing in Z80 itself? Surely it’s not such a ‘custom’ concept?
Well, welcome to Binary Coded Decimal!