A curious bug in the Commodore BASIC tokenizer routine

BASIC abbreviations on Commodore 8-bit machines are well known – and allegedly this isn’t a feature, but rather a bug. However, this (quite comfortable) bug has a curious bug of its own!

What happens, if we try to abbreviate on the very last character of a keyword, e.g., by entering “10 gosuB 2000”?

10 gosuB 2000
list
 10 mid$su 2000

What? How did “gosub” become “mid$su”?

cbm-tokenizing-gosub

More on this at

5 Likes