An SC61860 bug since 25 years

Incredible — a bug in the SC61860 CPU used in classic Sharp devices has been fixed after 25 years!

Usually, a CPU bug is spotted quickly because everything crashes. But this one was a subtle side effect in batch instruction processing.

When I requested a batch of 0xFF, the loop exited without doing anything, instead of executing 256 times.

Turns out, it was just a while () {} that needed to be replaced with a do {} while ().

Now, the LC-3 compiler works correctly — it’s the one that uses 0xFF batches, unlike the standard ROM which never does.

It took me ages to find this bug, I was so convinced my algorithm was solid. obviously, after 25 years of faithful service…

Leave a Reply

Your email address will not be published. Required fields are marked *