include z180reg.inc\r
\r
\r
-bdos equ 5\r
-\r
ccpsize equ 0c80h\r
\r
+ ; CP/M BDOS Function Interfaces\r
+\r
+resetdsk equ 13\r
+open equ 15\r
+read equ 20\r
+setdma equ 26\r
+setmulti equ 44\r
+bdos equ 5\r
+\r
+\r
if banked\r
tpa$bank equ 1\r
else\r
\r
?ldccp:\r
; First time, load the A:CCP.COM file into TPA\r
- call resetdsk\r
+ ld c,resetdsk\r
+ call bdos\r
xor a\r
ld (ccp$fcb+15),a ; zero extent\r
ld hl,0\r
ld (fcb$nr),hl ; start at beginning of file\r
ld de,ccp$fcb\r
- call open ; open file containing CCP\r
+ ld c,open ; open file containing CCP\r
+ call bdos\r
inc a\r
jp z,no$ccp ; error if no file...\r
ld de,0100h\r
- call setdma ; start of TPA\r
+ ld c,setdma ; start of TPA\r
+ call bdos\r
ld de,128\r
- call setmulti ; allow up to 16k bytes\r
+ ld c,setmulti ; allow up to 16k bytes\r
+ call bdos\r
ld de,ccp$fcb\r
- call read ; load the thing\r
+ ld c,read ; load the thing\r
+ call bdos ; read records\r
; now,\r
; copy CCP to bank 0 for reloading\r
ld hl,0100h\r
call ?bnksl ; select extra bank\r
pop af\r
ld (hl),a ; save the byte\r
- inc hl\r
- dec bc ; bump pointer, drop count\r
- ld a,b\r
- or c ; test for done\r
- jp nz,ld$1\r
+ cpi ; bump pointer, drop count\r
+ jp pe,ld$1\r
pop af\r
call ?bnksl ; restore original bank\r
ret\r
ret\r
\r
\r
- ; CP/M BDOS Function Interfaces\r
-\r
-resetdsk:\r
- ld c,13\r
- jp bdos ; reset disk system\r
-\r
-open:\r
- ld c,15\r
- jp bdos ; open file control block\r
-\r
-setdma:\r
- ld c,26\r
- jp bdos ; set data transfer address\r
-\r
-setmulti:\r
- ld c,44\r
- jp bdos ; set record count\r
-\r
-read:\r
- ld c,20\r
- jp bdos ; read records\r
-\r
-\r
-\r
ccp$fcb:db 1,'CCP ','COM',0,0,0,0\r
ds 16\r
fcb$nr: db 0,0,0\r