I feel like I should know this one, but I can't seem to find the answer easily, so I'll ask the gurus on this forum.
Does that first line of a BASIC program always have to start at address 16509? I'm not talking about using RUN with a line number to change the starting point of a program. I'm talking about where the BASIC program is actually located in memory, and can it be moved somewhere else and run from there. It's easy to make relocatable assembly, but how about relocatable BASIC?
Someone must know.
Hi,
The BASIC start offset is set at $400/1024 in the BASIC ROM. ( LD HL,$407D)
The TS1000 demonstrator card change the $402 value to $20 (Was $40), and launch the BASIC at $207D)
I seen a POKE to change the memory bottom (MEMBOT, beatween 16477 and 16506.
It was able to store two basic programs, and swap both listings.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
XavSnap wrote: ↑Fri Feb 28, 2025 8:10 am
The BASIC start offset is set at $400/1024 in the BASIC ROM. ( LD HL,$407D)
The TS1000 demonstrator card change the $402 value to $20 (Was $40), and launch the BASIC at $207D)
Actually, the modified location in ZX81 ROM is $9DB, but the gist of what you're saying is spot on.
The big difference between the ZX81 and the ZX Spectrum is that the later machine came as standard with 16K bytes of RAM (or more).
Additionally, the ZX Spectrum was supposed to support a more flexible I/O system. So it was essential to have space in RAM for that. That meant that the program area (as per the design of the ROM code) could no longer start at a fixed hard coded position in RAM.
The ZX81 was an evolution of the ZX80. The ZX Spectrum was an evolution of the ZX81. But with the increase in both ROM and RAM, the writers of the ROM took the opportunity to make some improvements.
I get that it's all part of the evolution of computer design. I was wondering if anyone had come up with a clever way to relocate a BASIC program on the Zeddy. It appears to not be possible. That is the answer I'm looking for.
The closest thing I've seen is a program called SWAP. Here you can have 2 Basic programs loaded, and SWAP can swap them around, but it is only the first one in the right location you can run.