Going down to assembler to do date math does count as retro, right? It’s a whole series, this is one of the articles.
All well and good, if you have hardware multiply and divide.
Maybe study them again. Yes, you do need multiply but the divides are shifts, so easy.
And any system that doesn’t have hardware multiply - well, you’re going to have to write a software multiply anyway, so there really isn’t an issue. This will still be more efficient tha a divide or modulo.
I think it’s quite elegant - take a number of days from a fixed point - classically (or naively) reduce it modulo 7 to get the day of the week. This formula is effectively multiplying by the reciprocal, suitably scaled and adjusted to suit.
So maybe there’s still life left for assembly language programmers… for a while, anyway…
And for a bit of fun; If you want divides, then I suggest Zellers congruence. Plenty there. I use it in my Biorhythm program.
Looks like a bad week for Unix…
-Gordon
I was hoping for a 6502 or 8080 as the retro cpu. I don’t mind reading assembly but every cpu has problems
for a orthogonal instruction set that you need to be aware of. I will look at again when I have more time to spend on it.
