I wanted to discover if it's a bug in my code, and it is. The reason I didn't see an issue here is that I pasted your program, and hence tokenised it, on my Windows PC and then transferred the tokenised version onto the Mac to create the App bundle. Using that route it works. But if I paste/tokenise your program on the Mac, it doesn't. The difference arises because the Windows edition of BBCSDL is using the assembler version of the interpreter and the Mac edition is using the compiled-C version, and there is a difference between them (which there shouldn't be) in how ON GOTO and ON GOSUB statements get tokenised.
Specifically, in a statement like:
Code: Select all
ON j GOTO 1234,5678
Thus everything is explained. Thank you for helping to find this extremely subtle bug which could easily have gone unnoticed indefinitely (how many programs use ON GOTO, then get crunched, and can have the target line concatenated onto the previous one?).