carlsson said:
Ayep, that is what I meant. Machine code which doesn't make any assumptions (or at least no assumptions which can not be looked up by reviewing hard coded memory positions) about the target machine. I know too little about the Z80 to know if there are certain memory addresses which have to contain specific information, like memory address of graphics memory or I/O chips, stack pointer, maybe even some typical ROM calls.
As I understand the Z80, it isn't p'ticular about such things. Other processors that I use regularly are, like the Hitachi 6301, which is more than just a microprocessor. It is a single-chip microcomputer, with it's own memory space (RAM & ROM) on-chip, as well as it's own I/O ports. Writing to or reading from certain memory locations on that chip will obviously access that memory or I/O port.
With CP/M, system calls are sacred in that they mustn't be changed, and if they are, then it's no longer CP/M. The system calls are what make CP/M portable among many different types of hardware. The system call will do exactly the same thing on any hardware it's run on. The differences in hdwre are accounted for in the BIOS, which is different for each different combination of hardwares that the different machines use. The TRS-80, which also uses a Z80, is a whole 'nother animal. It uses memory-mapped I/O, in which certain memory locations are for certain purposes. F'rinstance, if you want to write something to the screen, you don't have to use a system call, you can just write to a specific memory address and that is where the screen's memory lives, so writing to that address automatically writes on to the screen. That's the big reason they had so much trouble porting CP/M to the Trash-80, and even when they did port it over, it wasn't-quite-the-same.
In an operating system, I believe you should differ between system (OS) calls and ROM (BIOS) calls, as you should not bypass the system anyway. Since neither ZX81 nor Jupiter does CP/M (AFAIK - I may be wrong here), they would not bother about a common jump table or otherwise. Perhaps sir Clive would not even have liked if a machine, designed by the same people who designed his, even was partitially firmware compatible...
In some computers there is little or no difference between the two. When the OS lives in ROM, then you have to CALL the ROM to CALL the system (like the TRS, running in BASIC mode, without TRSDOS being loaded). CP/M, OTOH, keeps it's system on disk, where it is read into memory at boot-time. The OS is always memory-resident, but it's modular design allows certain portions to be overwritten by the user's program, provided the program handles the functions of the OS that have been over-written. The BIOS is the only part that cannot be overwritten, except by another BIOS version, which still must be compatible with the hardware. The IBM-PC & compatibles OTOOH, keep thier BIOS in ROM, and the BIOS must be the same on every different set of hdwre it's run on. That's what made it so difficult (at first) for other manufacturers to clone the IBM, without stepping on IBM's copyrights.
Well, I guess that sufficiently confuses the issue...ok, daddy, I'll shut up now...
--T