Second representation requires at least 6 bits to represent numbers between 0 to 59. But 5 bits are not just enough - 25 = 32, which can only represent from 0 up to 31 seconds.

According to K.N. King:

You may be wondering how it 's possible to store the seconds - a number between 0 and 59 in a field with only 5 bits. Well. DOS cheats: it divides the number of seconds by 2, so the seconds member is actually between 0 and 29.

That really makes no sense?

  • j4k3@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 hours ago

    Probably need to go as deep as the ALU operations available and clock cycles to really see what is going on.

    I know nearly nothing of value in this space, but have seen lots of little tricks like this in passing with hobbyist hardware or ROMs. Intuitively, it feels like one of those kinds of situations. You might even find there is a clever use of a carry flag or something of that nature where there is essentially a free bit on an operation. I’m not sure how x86 does the ALU or whatnot here or even if this advice is relevant with an overlay tree. Feel free to inform/correct.