System information

mov l, a ;l=disk number 0, 1, 2, 3
mvi h, 0 ;high order zero
dad h ;*2
dad h ;*4
dad h ;*8
dad h ;*16 (size of each header)
lxi d, dpbase
dad 0 ;hl=,dpbase (diskno*16)
ret
;
settrk: ;set track given by register c
mov a, c
sta track
ds 10h ;space for track select
ret
;
setsec: ;set sector given by register c
mov a, c
sta sector
ds 10h ;space for sector select
ret
;
;
sectran:
;translate the sector given by bc using the
;translate table given by de
xchg ;hl=.trans
dad b ;hl=.trans (sector)
mov l, m ;l=trans (sector)
mvi h, 0 ;hl=trans (sector)
ret ;with value in hl
;
setdma: ;set dma address given by registers b and c
mov l, c ;low order address
mov h, b ;high order address
shld dmaad ;save the address
ds 10h ;space for setting the dma address
ret
;
read: ;perform read operation (usually this is similar to write
; so we will allow space to set up read command, then use
; common code in write)
ds 10h ;set up read command
jmp waitio ;to perform the actual i/o
;
Appendix B : A Sekletal CBIOS CP/M Operating System Manual
B-6