Kernal RDTIM returns time wrong way
Posted: Thu Dec 07, 2023 7:08 pm
The function RDTIM in KERNAL R46 should be fully compatible with the C64 KERNAL RDTIM, but unfortunately, it isn't. According to the C64 Programmer's reference, three bytes are returned by the routine, with the accumulator containing the most significant byte, the X index register containing the next most significant byte, and the Y index register containing the least significant byte.
However, in the X16 KERNAL RDTIM, the most significant byte is returned in .Y, the next most significant byte in .X, and the least significant byte in .A. This is essentially in reverse order compared to the C64 KERNAL RDTIM.
It is uncertain if this is by design, but if so, the function should be documented in the X16 Programmer's guide. Currently, for all C64 KERNAL routines, users are referred to the C64 documentation.
However, in the X16 KERNAL RDTIM, the most significant byte is returned in .Y, the next most significant byte in .X, and the least significant byte in .A. This is essentially in reverse order compared to the C64 KERNAL RDTIM.
It is uncertain if this is by design, but if so, the function should be documented in the X16 Programmer's guide. Currently, for all C64 KERNAL routines, users are referred to the C64 documentation.