Instruction manual

fb03 ;
fb03 01 80 00 LD BC, 80h ;default dma address is 80h
fb06 cd 77 fb call setdma
fb09 ;
fb09 fb ei ;enable the interrupt system
fb0a 3a 04 00 LD A,(cdisk) ;get current disk number
fb0d fe 04 cp disks ;see if valid disk number
fb0f da 14 fb jp c,diskok ;disk valid, go to ccp
fb12 3e 00 ld a,0 ;invalid disk, change to disk 0
fb14 4f diskok: LD c, a ;send to the ccp
fb15 c3 00 e4 JP ccp ;go to cp/m for further processing
fb18 ;
fb18 ;
fb18 ; simple i/o handlers (must be filled in by user)
fb18 ; in each case, the entry point is provided, with space reserved
fb18 ; to insert your own code
fb18 ;
fb18 const: ;console status, return 0ffh if character ready, 00h if not
fb18 db 03 in a,(3) ;get status
fb1a e6 02 and 002h ;check RxRDY bit
fb1c ca 22 fb jp z,no_char
fb1f 3e ff ld a,0ffh ;char ready
fb21 c9 ret
fb22 3e 00 no_char: ld a,00h ;no char
fb24 c9 ret
fb25 ;
fb25 conin: ;console character into register a
fb25 db 03 in a,(3) ;get status
fb27 e6 02 and 002h ;check RxRDY bit
fb29 ca 25 fb jp z,conin ;loop until char ready
fb2c db 02 in a,(2) ;get char
fb2e e6 7f AND 7fh ;strip parity bit
fb30 c9 ret
fb31 ;
fb31 conout: ;console character output from register c
fb31 db 03 in a,(3)
fb33 e6 01 and 001h ;check TxRDY bit
fb35 ca 31 fb jp z,conout ;loop until port ready
fb38 79 ld a,c ;get the char
fb39 d3 02 out (2),a ;out to port
67