ZornsLemma/py8dis

Identify BASIC programs in the binary

Opened this issue · 0 comments

Automatically or manually identify a region of the binary that contains a BASIC program. Output the tokenised basic to a separate file, and include it in the assembly output. Possibly output a plain text (untokenised) version too?

acme has !bin, xa has .bin, and beebasm has incbin to include a binary file in the assembly.

For automatic recognition:
Basic files start with byte 13 (present at the start of every line), then a 2 byte line number and a 1 byte line length. Add the line length to get to the start of the next line. Skip through this way until the high byte of the line number is 255 marking the end of the program. If this succeeds then we have a valid BASIC program.

Road Runner looks like an interesting case, where there is BASIC embedded.