Instruction manual
0855 19 add hl,de
0856 22 86 08 ld (dmaad),hl
0859 c3 40 08 jp rd_trk_1_loop
085c d3 01 done: out (1),a ;switch memory config to all-RAM
085e c3 00 fa jp cpm
0861
0861 read:
0861 ;Read one CP/M sector from disk 0
0861 ;Track number in 'track'
0861 ;Sector number in 'sector'
0861 ;Dma address (location in memory to place the CP/M sector) in 'dmaad' (0-65535)
0861 ;
0861 21 00 09 ld hl,hstbuf ;buffer to place raw disk sector (256 bytes)
0864 3a 84 08 ld a,(sector)
0867 4f ld c,a ;LBA bits 0 to 7
0868 3a 85 08 ld a,(track)
086b 47 ld b,a ;LBA bits 8 to 15
086c 1e 00 ld e,00h ;LBA bits 16 to 23
086e cd 94 02 call disk_read ;subroutine in ROM
0871 ;Transfer top 128-bytes out of buffer to memory
0871 2a 86 08 ld hl,(dmaad) ;memory location to place data read from disk
0874 11 00 09 ld de,hstbuf ;host buffer
0877 06 80 ld b,128 ;size of CP/M sector
0879 1a rd_sector_loop: ld a,(de) ;get byte from host buffer
087a 77 ld (hl),a ;put in memory
087b 23 inc hl
087c 13 inc de
087d 10 fa djnz rd_sector_loop ;put 128 bytes into memory
087f db 0f in a,(0fh) ;get status
0881 e6 01 and 01h ;error bit
0883 c9 ret
0884 00 sector: db 00h
0885 00 track: db 00h
0886 00 00 dmaad: dw 0000h
0888 end
78










