If a line holds SAVE then the next line is run.
LOAD continues then where SAVE ended.
Normally a LOAD ends in a screendisplay at #207 which will decrease FRAMES 1x, that is why I suggest doing that too.
You will need it to load my 1K games.
No, this just crashes the ZX81.
The entry point you are proposing is mid way in the NEXT-LINE routine at #066C
So I can't see how this will work.
Or am I missing something here?
OK I see what you are doing with #676
I can also see that I can manipulate NXTLIN to start at any address within the program.
In answer to your question, at the moment I am testing by using the space between #2000-#3ffff for now. I will be doing some ROM page swapping when I have sorted out the basic load and run problem.
I am sure the issue I am having is on the return, as the Z80 pops the return address of the stack into the program counter and then continues execution. If in the mean time the basic program and variables have been changed then this return address will not be valid, so I need to work out a direct jump to address to continue from.
I looked at the Z80s stack in a monitor and could see the number of items were pushed on at any one time.
It would appear that when the ZX81 is in SLOW mode, the stack holds information related to the screen display, because when I went FAST the stack decreased in size by 8 bytes.
Therefor it is important to be in FAST mode when copying the system variables into storage, and the same when bringing them back into RAM. It is also important not to have PUSHed anything onto the stack at the point of copying the program/data, else this would screw up the return address.
This is not so much an issue if you are just copying the basic program on its own, as the problem is to do with the system variables that are included in a tape save.
In the end I used CALL 3875 to go fast, then I re-entered basic via slow with a JP 3883,
or for those who only speak hex CALL f23h to go fast, then I re-entered basic via slow with a JP f2bh
I will now have to experiment with the ZX81 with the ROM paged out altogether, making sure that the NMI and INT are both disabled. I am hoping that I will be able to use the lower block of ROM for data storage, thus removing the need to have multiple copies of the original ROM in the lower 8k of various ROM banks.
Thanks to all those who contributed. You were a help as it was good to have other peoples input.