3 ms·
Looks like a converter to BCD. It'll take e.g. 42 and turn it into 0x42. No clue why this would be necessary, but that looks like what it does.
by mikeash 14y ago
Looks like a converter to BCD. It'll take e.g. 42 and turn it into 0x42. No clue why this would be necessary, but that looks like what it does.
- sounds 14y agoYes, some links on why BCD: http://wiki.osdev.org/RTC http://wiki.osdev.org/RTC http://wiki.osdev.org/CMOS#Format_of_Bytes http://wiki.osdev.org/CMOS#Format_of_Bytes
- mikeash 14y agoThanks for the links. And, holy crap is PC hardware bizarre.
- Someone 14y agoBCD isn't _that_ bizarre. Many architectures had and have instructions for BCD arithmetic: x86: http://en.wikipedia.org/wiki/Intel_BCD_opcode http://en.wikipedia.org/wiki/Intel_BCD_opcode 68k: http://meseec.ce.rit.edu/eecc250-winter99/250-1-20-2000.pdf http://meseec.ce.rit.edu/eecc250-winter99/250-1-20-2000.pdf 6502: http://www.6502.org/users/dieter/bcd/bcd_0.htm http://www.6502.org/users/dieter/bcd/bcd_0.htm 6800: http://fundamentals-digital-electronics.blogspot.com/2010/09/motorola-6800-eight-bit-microprocessor.html http://fundamentals-digital-electronics.blogspot.com/2010/09... Several others, such as Power6 and Sparc64: http://speleotrove.com/decimal/ http://speleotrove.com/decimal/ (also shows this is is both still useful today)