Program that adds statements to a BASIC program
Posted: Sat Nov 07, 2015 9:30 am
Hi
I would like to modify a BASIC program via BASIC (or ML).
It’s easy to read from the BASIC program, as that starts at address PROGRAM 16509/407D.
It should also be relatively simple to modify the program, as long as it’s modifying from one char to another.
The problem arises when you want to insert new lines into the BASIC program. Then the whole memory has to be pushed forward in memory.
Is there any subroutines in ROM that does this, I can use?
I know from Commodore 64 it was possible to fill the keyboard buffer with chars e.g. “50 PRINT A$<NL>” and this statement would be executed resulting in a new line added to the program.
From reading the ‘ROM Disassembled’-book for ZX81, it seems like there’s no keyboard buffer, and routine that inserts statements into the BASIC program, reads directly from the keyboard.
Any thoughts on this?
/Martin
I would like to modify a BASIC program via BASIC (or ML).
It’s easy to read from the BASIC program, as that starts at address PROGRAM 16509/407D.
It should also be relatively simple to modify the program, as long as it’s modifying from one char to another.
The problem arises when you want to insert new lines into the BASIC program. Then the whole memory has to be pushed forward in memory.
Is there any subroutines in ROM that does this, I can use?
I know from Commodore 64 it was possible to fill the keyboard buffer with chars e.g. “50 PRINT A$<NL>” and this statement would be executed resulting in a new line added to the program.
From reading the ‘ROM Disassembled’-book for ZX81, it seems like there’s no keyboard buffer, and routine that inserts statements into the BASIC program, reads directly from the keyboard.
Any thoughts on this?
/Martin