muta...@gmail.com
2021-03-26 10:15:28 UTC
Today I did some investigation on CP/M and 8080
applications (which seemed to exclusively run under
CP/M).
Sufficient documentation is here:
http://www.cpm.z80.de/randyfiles/DRI/CPM_1_4_Interface_Guide.pdf
The interesting thing to note is that the 8080 instruction
set was a bit different from 8086 so it was necessary
to run a program to translate at the assembly code level.
Given that this was being done anyway, and given that
the assembly code used labels, not hardcoded addresses,
it should have been possible to provide relocation information,
and produce a tiny memory model .exe instead of a .com.
But it is offsets that need to be relocated, not segments.
And they also can't be depending on absolute address
5 containing an OS entry point. Basically the same
thing the Amiga did - having everything hinge on
absolute address 4.
In both cases a register could have been provided
with the address you need to use to get OS services.
Then the program would have been relocatable, so
that you could fit multiple executables into a 64k
segment.
Although I'm still a bit unclear as to whether this
would have allowed a larger segment bit shift.
Also, I'd like to know more details about this
8080 to 8086 assembler translation process.
Specifically were calls to address 5 replaced
with interrupts? Or was address 5 in the PSP
kept as a valid execution point so that CP/M
calls with a function code could continue
unchanged? If so, does that mean MSDOS, or
DRDOS (or a future PDOS/86) could have
maintained CP/M-compatibility?
And indeed, CP/M itself was directly available
for the 8086. So what did its interface look like?
Did they maintain that address 5, even if MSDOS
did not? Or did they themselves switch to INT 21H
with no address 5 (relative to cs:, so still relocatable
to some extent) option in any version of CP/M-86?
BFN. Paul.
applications (which seemed to exclusively run under
CP/M).
Sufficient documentation is here:
http://www.cpm.z80.de/randyfiles/DRI/CPM_1_4_Interface_Guide.pdf
The interesting thing to note is that the 8080 instruction
set was a bit different from 8086 so it was necessary
to run a program to translate at the assembly code level.
Given that this was being done anyway, and given that
the assembly code used labels, not hardcoded addresses,
it should have been possible to provide relocation information,
and produce a tiny memory model .exe instead of a .com.
But it is offsets that need to be relocated, not segments.
And they also can't be depending on absolute address
5 containing an OS entry point. Basically the same
thing the Amiga did - having everything hinge on
absolute address 4.
In both cases a register could have been provided
with the address you need to use to get OS services.
Then the program would have been relocatable, so
that you could fit multiple executables into a 64k
segment.
Although I'm still a bit unclear as to whether this
would have allowed a larger segment bit shift.
Also, I'd like to know more details about this
8080 to 8086 assembler translation process.
Specifically were calls to address 5 replaced
with interrupts? Or was address 5 in the PSP
kept as a valid execution point so that CP/M
calls with a function code could continue
unchanged? If so, does that mean MSDOS, or
DRDOS (or a future PDOS/86) could have
maintained CP/M-compatibility?
And indeed, CP/M itself was directly available
for the 8086. So what did its interface look like?
Did they maintain that address 5, even if MSDOS
did not? Or did they themselves switch to INT 21H
with no address 5 (relative to cs:, so still relocatable
to some extent) option in any version of CP/M-86?
BFN. Paul.