jac_goudsmit wrote:
The machine language part of the program was hidden in some smart way: It loads from tape, but you can't see it when you do a LIST and if you try to save the program and load it back from tape, it won't work because a SAVE won't save the machine language part of the program.
That is a common technique, in which a short piece of BASIC code says something like SYS 2063 (on the Commodore 64).
At the time when the program was created, the save was from the machine language monitor so that memory beyond the end-of-BASIC-text address was saved along with the BASIC text. When a program of any kind is LOADed with
LOAD "<prog name>" (tape) or
LOAD "<prog name>",8 (disk), a relocating load will occur. Once the load from tape or disk has finished, the BASIC interpreter will set its end-of-text pointer to a null that immediately follows the tokenized form of
SYS 2063. This action is part of the normal linking process performed once the program has been read into memory (starting at $0800 in the Commodore 64). Due to these actions on the part of BASIC, the only thing that will be seen when the program is LISTed will be
SYS 2063, even though all of the following machine code was LOADed as well. Also, as the end-of-program-text pointer points to the end of the BASIC text, not the entire program, an attempt to SAVE the program will "fail," since only the BASIC text will be saved.