Subject: Re: "CP/M compatible" vs. "MS-DOS Compatible" machines?
From: Jim Battle <frustum at pacbell.net>
Date: Thu, 31 Jan 2008 02:01:43 -0600
To: General Discussion: On-Topic and Off-Topic Posts <cctalk at
classiccmp.org>
Holger Veit wrote:
....
The interrupt and DMA handling was also lousy
thanks to DR abusing some
8080 and even worse Z80 RST vector locations for the BDOS and CCP
buffers and FCBs. ...
That is one thing I always wondered about. CP/M has "CALL 0005H" as the
BIOS entry point. Why didn't they map it to 0008H instead? Considering
that code space was at a premium, saving two bytes off of every BIOS
call would have been an obvious optimization, I would have thought.
If one takes a moment some of that was INTEL MDS artifact that were
programmed around. Also there are plenty of unused RST vectors.
For the later systems the 8259 was available and it inserted a
CALL XXXX where XXXX was anywere in addressable memory. The Z80
in mode2 interrupt also could vector anywhere in ram. DMA
is not impacted by how the low page is used.
Generally it's a non-issue and easy to work with.
On the other hand, I never wrote any 8080 code that
used RST, so maybe
there is some gotcha that I don't know about.
No it's a one byte call to 8 canned locations in the bottom of ram.
RST0 is to 0000h (warm boot)
(locations 0000-0007 are used by cpm)
RST1 is to 0008h (nothing there)
RST2 is to 0010h
RST3 is to 0018h
RST4 is to 0020h
RST5 is to 0028h
RST6 is to 0030h
RST7 is to 0038h (used by DDT as trap)
None of the 8085 hardware RSTx.5 or Trap interrupt
lines conflict with anything as they fall i the nothing
there range.
Z80 NMI lands at 66h which is in the default
FCB/DMA area that goes from 005Ch to 00FFh
Anyone have opinions why it was done with CALL 0005H
instead?
It's explicit either works but only one allows coding to look like:
Call BDOS ; Bdos defined as 0005h
which reads easier than
RST5 ; call location 005
The only thing I can come up with is that DR might have
entertained,
early on, making CP/M relocatable to different addresses (eg, some
vendor wants an OS that lives in high memory). In the process of
patching all the code for the high addresses, substituting "CALL 0FF05H"
instead of "CALL 0005H" is trivial, but substituting "CALL 0FF05H" for
"RST 1" would be a problem. Yes, one could require such systems to have
a "ORG 0005H / JMP 0FF05H" vector. I'm grasping at straws here.
Yes straws.
CP/M loads to the last typically 8k of high ram and sparsely uses the
first 256byte page as a system area. Everything inbetween is open land
but CP/M convention is executables start at 100H and have space that can
continue as high as the start of the BIOS (if you need cold boot) or 3.5K
lower if you need BDOS services. The CCP is considered overlayable.
Allison