home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
UTILITYS
/
C10CPM.ARC
/
C10CPM.DOC
next >
Wrap
Text File
|
1990-07-21
|
6KB
|
113 lines
CPM OVERLAY FOR THE CROMEMCO C-10
Written by Brett and John Hunter. Copyright (c) 8/8/1986.
Cdos is suppose to be CPM compatiable, but all C-10 users know that Cdos
has certain small differences that, although easily fixed, can cause major
problems in running public domain software. The major problems are with
system calls 17,18 and 27. These are all disk function calls and lead to
programs giving the wrong disk space free and more importantly a major
malfunction in the disk directory.
Calls 17,18 are Find and Search for directory entries. In CPM the returned
value (in the A register) is a value between 0 and 3, which specifies where
in the 128 record the directory entry is (each entry is 32 bytes long).
But in Cdos the A register contains any value, but the value is such that
(A register) AND 3 gives that correct CPM like value. So all we had to do
was intercept the Cdos calls on returning to the calling program and change
the A register to AREG := AREG AND 3 .
System call 27 gets the allocation map address. In CPM the bitmap address is
returned in the HL register, whereas CDOS returns the Last Address in cdos
in the HL, and the BC contains the bitmap address. It is a simply matter
to swap the DE and BC registers when CDOS returns.
CDOS also returns more values than CPM but this should not effect the running
of any program, since all normal programs should push all essential registers
before calling CDOS or CPM.
Other problems with CDOS and the C-10 that have not been fixed as yet are:-
(1) The use of IM 1 mode. This makes all CPM programs that use location 38H
crash the computer since the C-10 uses this location as a jump to
the screen refreshing routines. So programs such as DDT will not work.
The screen will blank out if this location is used, so this way you can
easily recognize what the problem is.
(2) Cdos has no bios jump table, so any programs using direct bios calls will
undoubtedly hang the computer.
We have made two different versions, both for version 5 and above. The
first called CPM.Z80 (.COM) is the simplest and most used. It does all the
above and for good measure also calls 15 and 16. These calls may not have
to be changed and so that code relevant to these calls may be omitted. I
have left them in as an insurance since they will not effect it if the
calls work the "CPM way".
The second version is the fully documented one since it is the one with
the most features in. This version includes a rudimentary user area facility.
CDOS uses the first byte of the FCB as its Attribute bits (4) and the
drive code (4), whereas CPM uses it as the User code and drive code.
So we have used the attr bits as the user code. To set a file in a certain
user area you use the ATTR or ATTRIBUTE commands in Cdos. ie.
ATTR FILENAME.EXT ATTRBIT where FILENAME.EXT can be an ambiguous filename
and ATTRBIT can be either E,W,S,R,or U corresponding to
Erase protect,Write protect, System file, Read protect, and User file.
ATTRBIT can be any combination of these. eg EWS or US or SW etc.
The Erase protect bit does not appear in the first byte of the entry, and the
others are such that:
bit 7 = write protect
6 = read "
5 = SYS file
4 = USER file
You have 16 different combinations for "fake" user areas. I recommend that
the read attr is not used since you can not even look at the file when it
is set. At the time of release of this document the code did not fully work.
It DOES work but I seem to be only able to get 4 user areas and that is by
combinations of W and U. ie U,W,WU and nothing. This may have something to
do with the fact that the only none working attr bit is the SYS and CDOS
may use this in a yet undocumented way.
So at the time of writting this I have made a working copy of vers 1.01
and a semi (but functional) copy of vers 1.02.
These vers's will only work on the C-10 version 5 and above although it would
be very easy to change to version 4 and less (or to the S-100 CDOS versions or
the CROMIX CDOS emulator).
The following is an extra for people with versions 4 and less. To convert
to version 4 and less you need to change the destination and find the locations
and values of the RET etc. But also you may like to add a small supplement
as so to have system call 31. This is a MAJOR problem with version 4 and less.
The code will be somthing like this:
add to the CP statements a CP 31 and JP Z,M31 and the followin code:
M31: EQU $+OFFSET
LD HL.DPB
pop's
RET
DPB: EQU $+OFFSET
DEFB 28H,00H, ; Number of logical rec's/track
04H, ; Block shift factor
0FH, ; Block mask
00H, ; Extent mask
0C2H,00H, ; Total storage cap. (n-clusters -1)
7FH,00H, ; No. of DIR entries -1
0C0H,00H, ; Reserved dir clusters
21H,00H, ; DRM/4 + 1
01H,00H, ; No. of reserved system tracks
02H, ; Physical record shift factor
03H ; Physical record mask
This will probably work, so if you have version 4 or less, just add the
above and compile on the Cromemco Z80 Assembler and the Link it.
These programs were written by an L-plate Z80 language programmer, so if
you have any improvements then please let me know either by writting
to Brett Hunter, 7 Gilbert St, Sylvania, NSW, 2224, Australia, or
leave a message on Tesseract RCPM (02) 651-1404 or ring me on (02) 522-8669.
The following is a small list of the programs that never used to work
at all or only partially :
IMP, CROSSTALK, TURBO PASCAL, DIR programs, LIBRARY programs (NULU etc) , UNSQZ programs, SQ programs, CATALOGING progs (CAT, FATCAT etc), etc, etc...
There are still a few programs that don't work but they are becoming rarer.
(Also version 1.02 is good for ROS).
I hope you enjoy the programs.
BRETT HUNTER.