Instruction manual

disk
fbc7 11 72 fd ld de,hstbuf ;host buffer
fbca 06 80 ld b,128 ;size of CP/M sector
fbcc 1a rd_sector_loop: ld a,(de) ;get byte from host buffer
fbcd 77 ld (hl),a ;put in memory
fbce 23 inc hl
fbcf 13 inc de
fbd0 10 fa djnz rd_sector_loop ;put 128 bytes into memory
fbd2 db 0f in a,(0fh) ;get status
fbd4 e6 01 and 01h ;error bit
fbd6 c9 ret
fbd7
fbd7 write:
fbd7 ;Write one CP/M sector to disk.
fbd7 ;Return a 00h in register a if the operation completes properly, and 0lh if an error occurs
during the read or write
fbd7 ;Disk number in 'diskno'
fbd7 ;Track number in 'track'
fbd7 ;Sector number in 'sector'
fbd7 ;Dma address in 'dmaad' (0-65535)
fbd7 2a 33 fc ld hl,(dmaad) ;memory location of data to write
fbda 11 72 fd ld de,hstbuf ;host buffer
fbdd 06 80 ld b,128 ;size of CP/M sector
fbdf 7e wr_sector_loop: ld a,(hl) ;get byte from memory
fbe0 12 ld (de),a ;put in host buffer
fbe1 23 inc hl
fbe2 13 inc de
fbe3 10 fa djnz wr_sector_loop ;put 128 bytes in host buffer
fbe5 21 72 fd ld hl,hstbuf ;location of data to write to disk
fbe8 db 0f wr_status_loop_1: in a,(0fh) ;check status
fbea e6 80 and 80h ;check BSY bit
fbec c2 e8 fb jp nz,wr_status_loop_1 ;loop until not busy
fbef db 0f wr_status_loop_2: in a,(0fh) ;check status
fbf1 e6 40 and 40h ;check DRDY bit
fbf3 ca ef fb jp z,wr_status_loop_2 ;loop until ready
fbf6 3e 01 ld a,01h ;number of sectors = 1
fbf8 d3 0a out (0ah),a ;sector count register
fbfa 3a 31 fc ld a,(sector)
fbfd d3 0b out (0bh),a ;lba bits 0 - 7 = "sector"
fbff 3a 2f fc ld a,(track)
71