Building CP/M 3
This is based on my experiences building the CP/M 3 utility programs from the source supplied at www.cpm.z80.de. This site also contains a PL/M compiler, which runs in an ISIS emulator under DOS.
I have uploaded the build scripts I wrote for this process to the Digital Research Source Code page of that site. There are two downloads: "DEVELOPERS BUILD DIRECTORY for CP/M 3" cross-compiles under DRDOS, while the next entry, "CP/M 3 source", cross-compiles under UNIX.
Setting up: DOS
Under DOS, install the ISIS-II emulator included in the "PLM compiler" download on this page. You then need to set up its mapping of ISIS drives to DOS directories. I created a file called ENV.BAT, which sets up the variables:
rem These variables are my guidelines, not law :-) rem :F0: should hold the source code rem :F1: should hold the PL/M-80 compiler rem :F2: should hold the ASM-80 assembler rem :F3: should hold the ISIS libraries and emulator SET :F0:=D:\TOOLS\PLM\DIR SET :F1:=D:\TOOLS\PLM\PLM80 SET :F2:=D:\TOOLS\PLM\ASM80 SET :F3:=D:\TOOLS\PLM\UTILS
It should now be possible to use the emulator. The easiest way of doing this is to have scripts that it runs - so you would type ISIS <DATE.MAK, and DATE.MAK would in turn contain:
:F1:plm80 date.plm pagewidth(100) debug optimize :F3:link mcd80a.obj,date.obj,:F1:plm80.lib to date.mod :F3:locate date.mod code(0100H) stacksize(100) :F3:objhex date to date.hex exit
Setting up: UNIX
ISIS_F0=/home/user/plm/src ISIS_F1=/home/user/plm/plm80 ISIS_F2=/home/user/plm/asm80 ISIS_F3=/home/user/plm/utils export ISIS_F0 ISIS_F1 ISIS_F2 ISIS_F3
The emulator does not have a command prompt; it should be invoked once for each file to compile. For example, the above DOS build script becomes:
thames :F1:plm80 date.plm pagewidth\(100\) debug optimize thames :F3:link mcd80a.obj,date.obj,:F1:plm80.lib to date.mod thames :F3:locate date.mod code\(0100H\) stacksize\(100\) thames :F3:objhex date to date.hex
(Note that the brackets have to be escaped to get them past the shell).
Some of the CP/M 3 build process uses the tools supplied with CP/M - MAC, RMAC, LINK, GENCOM and HEXCOM (instead of objcpm, which isn't supplied, it is necessary to use objhex within ISIS and HEXCOM outside it).
The program ZXCC is a miniature CP/M emulator which can run these tools. So where the SUB file reads
MAC DUMPyour script can read
ZXCC MAC.COM DUMP.
John Elliott 2011-01-23