Instruction manual

CHKSUM1: ADD A,(HL) ;and compute sum ignoring carries.
INC HL
DEC C
JP NZ,CHKSUM1
RET
;
Those are the only code changes that must be made. However, as mentioned in the Serial Interface
Instruction Manual, in the section “A Word about Assemblers”, each assembler program has some
quirks that may affect the success of your assembly. The TASM assembler, for example, wants all
directives to begin with a period (“.”). Thus, you need .EQU instead of EQU, and .ORG instead of
ORG. The DEFB and DEFW directives are not recognized by TASM, and need to be changed to .DB and
.DW respectively. The .DB directive will not accept strings in single quotes, it wants to see double
quotes, but single characters in single quotes are fine – except the semicolon, which it doesn't like for
some reason (just substitute the ASCII value 0x3B if this gives you an error). And, in TASM, the .DB
directive doesn't like long lines of characters, you may need to break some of them up. The z80asm
program under Linux wants all labels to end with a colon (“:”), even those for the EQU statements.
Whichever assembler you use, you will probably need to massage the source code to get it to assemble
properly.
At the end of the CPM22.ASM file you will find the BIOS jump table, with fake destinations. This is
present because the BDOS needs to have the addresses of the jump table items in order to assemble
properly. The real jump table belongs to the BIOS, and we will overlay this fake BIOS table with the
real one when we put the system together in memory. In making your changes to the source code, you
might introduce or remove a byte or two from some of the strings if you aren't careful. Then, if you
assemble the file, the jump table addresses might be off a little. This has to be fixed before CP/M is
installed. You should look at a listing of your assembled CPM22 code, and make sure that the BOOT
subroutine address comes out to be 0xFA00, which is the proper start of the BIOS in a 64K system. If
not, you should probably go over your changes again, trying not to introduce or remove any characters.
If you are off a little, and can't figure out why, you have a few bytes at the end of the file, labeled
“Extra space?” that you can remove, or add to, to make the BOOT address exactly 0xFA00:
; Extra space ?
;
DEFB 0,0,0,0
;
;**************************************************************
;*
;* B I O S J U M P T A B L E
;*
;**************************************************************
One more tiny irritant in this code is that the disk drive letter used in the CP/M prompt is lower case.
The system will work fine, but if you want it to look like all the other CP/M systems in the world you
should change this to upper case:
;
20