I was rewriting parts of my RTC module driver for the Commodore 64 when I stumbled into an issue for which none of the bytes read from the RTC were buffered correctly so it was consistently giving out an invalid date/time:
As I got enthusiastic about my Logic analyser I decided to look at the communication itself, trying to hunt down a bug in my new code. Oddly enough the signal looked perfect but read bytes were not stored as expected.
So I looked at the code and found the mistake. I had written:
64tass silently converted it into the closest supported addressing mode without giving me any warning:
Obviously that’s not what I meant. What I meant to write was:
Once fixed my new code was working perfectly! Driver + BASIC boot + little demo application are about 0x200 bytes and that includes a couple of text messages too 🙂