read a data block

This commit is contained in:
Kelvin Sherlock 2015-08-13 14:04:03 -04:00
parent f2eef6ce01
commit 1eaaf3c931
1 changed files with 36 additions and 0 deletions

View File

@ -34,5 +34,41 @@ device_write proc export
bra device_rw
endp
;
; inputs: a = block number. (1024 blocks)
;
;
read_data_block proc export
with dev_parms
; reads a data block.
; block 0 -> all zeros (sparse support)
cmp #0
bne read_it
; a = 0!
ldy #1024-2
loop
sta [dev_buff],y
dey
dey
bpl loop
clc
rts
read_it
sta dev_blk_num
stz dev_blk_num+2
lda #1024
sta dev_blk_size
sta dev_req_cnt
stz dev_req_cnt+2
bra device_read
endp
end