Re: Standard ROM entrypoints?
Posted: Fri Jul 20, 2018 4:46 pm
I think the point that may have been missed is this: the ZX80, ZX81 and ZX Spectrum did not, and do not have an operating system.
The ZX80 ROM is 4K bytes in size and contains BASIC and just enough code to process the keyboard and screen.
The ZX81 ROM is 8K bytes in size. The BASIC was developed from the ZX80 and is enhanced, but again, there is no OS.
Yep, same story with the ZX Spectrum. The ROM is 16k bytes in size. The intent at the time was to include code to handle the forthcoming microdrives (but instead ended up with some unused space). Again, the BASIC was developed from the ZX81 and is enhanced, but again, there is no OS.
Compare this with a Acorn BBC. This has a 16k OS ROM (approx 3/4 k byte is mapped out for the I/O hardware area). Plus one or more sideways ROMs (each up to 16k bytes) containing language(s), filing systems or other programs, one of which is the BASIC. The Master 128 can even be used without BASIC being active as it has a simple command line.
Of course, Z80 code can be made more compact compared to 6502 code. But even so, it's a big difference.
The print RESTART routine when fed with the correct data is the most useful routine, as it can output any character to the screen or the ZX printer. Read the BASIC manual to understand the control codes/control characters that BASIC can use.
In the ROM, there is also a keyboard reading routine. And there is the BASIC bleeper routine.
As alluded to above, the writers of the ROM were aiming for as much functionality as possible in 16k bytes, as that is apparently what Sir Clive wanted. Hence the ROM routines are slow. Hence machine code programmers preferred to write and read from the hardware directly.
The screen is a memory mapped bit-map. The only strange thing being the actual layout.
Apart from the 'unused' space and a couple of other areas which were altered in the 128k, +2, +2A, +2B, +3 and +3B, the 'original' ROM (often called the 48k ROM, even though it's exactly the same as the ROM in the 16k ZX Spectrum) is the same across all ZX Spectrums (there was ONLY one official ZX Spectrum ROM until the Spanish developed the 128k machine). So most useful routines stayed in the same place. In the 128k etc models, it's wise to ensure that this ROM image is mapped in rather than the editor ROM or disk OS ROM.
Mark
The ZX80 ROM is 4K bytes in size and contains BASIC and just enough code to process the keyboard and screen.
The ZX81 ROM is 8K bytes in size. The BASIC was developed from the ZX80 and is enhanced, but again, there is no OS.
Yep, same story with the ZX Spectrum. The ROM is 16k bytes in size. The intent at the time was to include code to handle the forthcoming microdrives (but instead ended up with some unused space). Again, the BASIC was developed from the ZX81 and is enhanced, but again, there is no OS.
Compare this with a Acorn BBC. This has a 16k OS ROM (approx 3/4 k byte is mapped out for the I/O hardware area). Plus one or more sideways ROMs (each up to 16k bytes) containing language(s), filing systems or other programs, one of which is the BASIC. The Master 128 can even be used without BASIC being active as it has a simple command line.
Of course, Z80 code can be made more compact compared to 6502 code. But even so, it's a big difference.
The print RESTART routine when fed with the correct data is the most useful routine, as it can output any character to the screen or the ZX printer. Read the BASIC manual to understand the control codes/control characters that BASIC can use.
In the ROM, there is also a keyboard reading routine. And there is the BASIC bleeper routine.
As alluded to above, the writers of the ROM were aiming for as much functionality as possible in 16k bytes, as that is apparently what Sir Clive wanted. Hence the ROM routines are slow. Hence machine code programmers preferred to write and read from the hardware directly.
The screen is a memory mapped bit-map. The only strange thing being the actual layout.
Apart from the 'unused' space and a couple of other areas which were altered in the 128k, +2, +2A, +2B, +3 and +3B, the 'original' ROM (often called the 48k ROM, even though it's exactly the same as the ROM in the 16k ZX Spectrum) is the same across all ZX Spectrums (there was ONLY one official ZX Spectrum ROM until the Spanish developed the 128k machine). So most useful routines stayed in the same place. In the 128k etc models, it's wise to ensure that this ROM image is mapped in rather than the editor ROM or disk OS ROM.
Mark