Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The analysis done by Robert Zeidman in 2014[1] published in the Journal of Software Engineering and Applications comes to the conclusion that no code was copied from CP/M by SCP.

Tim Paterson has stated that API and structure compatibility were explicit goals. That can be achieved w/o copying any code.

re: "5" as the system call interrupt - I've never seen an SCP machine or QDOS, but on an IBM PC interrupt 5 handled print screen (and on the 80186 and up it was a CPU-generated interrupt for BOUND exceptions).

[1] https://www.scirp.org/html/4-9301871_46362.htm



> re: "5" as the system call interrupt - I've never seen an SCP machine or QDOS, but on an IBM PC interrupt 5 handled print screen (and on the 80186 and up it was a CPU-generated interrupt for BOUND exceptions).

Not an interrupt, a CALL. In 8080/Z80 systems, a system call is just a subroutine call to the OS kernel, there is no memory protection so no need for any special type of instruction. (I suppose on 8086 there is no memory protection either–but software interrupts are beneficial in isolating software from direct knowledge of memory addresses, which simplifies memory management; 8080 systems had far less need for simplified memory management–you can't fit much in so little memory, so there is not much to manage.)

So, on CP/M-80 and CP/M-8086, you CALL 5 (call to memory address 5), where there is a jump instruction which redirects your call to the actual entry system call dispatcher entrypoint in the OS kernel (CP/M BDOS). QDOS/PC-DOS 1.0 preserve the same mechanism for source backward compatibility with CP/M, and their system calls are a subset of CP/M's (with equivalent numbers/arguments). Except, of course, in 8086, it is not a CALL to absolute address 5 (0:5), since that would be calling into the IVT, it is a call to CS:5 – DOS puts at offset 5 in the PSP a JMP FAR which eventually lands you in MSDOS.SYS, via some bizarre mechanism involving address wraparound (the infamous "A20 gate" was introduced to keep this mechanism working on 286+). "CALL 5" ends up being essentially equivalent to INT 21, and very little software ever used it – basically only software directly ported from CP/M-80 (such as, possibly, very early versions of WordStar for DOS–surviving copies appear to use INT 21 instead, but the earliest versions are quite possibly lost.)


OP used the word "interrupt" so I was thinking about the INT 21h API into MS-DOS. I never did any coding under CP/M. What assembler coding I did under MS-DOS that touched the PSP was mostly concerned w/ pulling the command line out. I can't say that I ever noticed the stuff in there that's clearly for CP/M compatibility. I do remember exiting COM programs using "RET", which transferred control to CS:0000 where an INT 20h was always present. I'm reading that was for CP/M compatibility, too. Neat.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: