Instruction manual
CMMND1: LD SP,CCPSTACK ;set stack straight.
CALL CRLF ;start a new line on the screen.
CALL GETDSK ;get current drive.
ADD A,'a'
CALL PRINT ;print current drive.
LD A,'>'
CALL PRINT ;and add prompt.
CALL GETINP ;get line from user.
;
Change the character in the ADD A,'a' instruction to an upper case A:
;
CMMND1: LD SP,CCPSTACK ;set stack straight.
CALL CRLF ;start a new line on the screen.
CALL GETDSK ;get current drive.
ADD A,'A'
CALL PRINT ;print current drive.
LD A,'>'
CALL PRINT ;and add prompt.
CALL GETINP ;get line from user.
;
Assemble to a binary output file cpm22.sys. This file contains the machine code for the CP/M Console
Command Processor (CCP) and Basic Disk Operating System (BDOS).
The third part of CP/M, the customized Basic Input Output System (CBIOS) for the CPUville system
with the Disk and Memory Expansion, I have written and assembled for you. You can download the
CBIOS source and binary files, and other binary helper files mentioned below, from the CPUville web
site. The binary file for the CBIOS is z80_cbios.bin. The other files you will need are format.bin,
putsys.bin, cpm_loader.bin, and monitor.bin.
Preparing the disk for CP/M
The CP/M file system directory entries are very simple. The first byte of a directory entry gives the
status of the entry. If the entry is inactive (the file has been deleted or not yet created), the status byte
has a value of 0xE5. To prepare a disk for the CP/M system, one needs only create a number of
directory entries that start with this value.
But it is easier than that, because if a directory entry is inactive, CP/M does not care what else is in the
directory. It will create a completely new entry when it needs to. So, all we need to do is write the value
0xE5 to all the sectors of the CP/M disk in order to prepare it.
Note that I refer to the “CP/M disk”. This is a logical construct, created by the disk parameter tables in
the CBIOS. These tables may or may not accurately represent the physical disk system. In the CBIOS I
created, I left the CP/M disk system as it originally was, with four disks, each with 77 tracks, 26 sectors
per track. A CP/M call to read or write a particular disk, track, and sector is translated into a unique
LBA address for the hard disk by the disk read and write subroutines in the CP/M CBIOS.
21










