Changes

Jump to: navigation, search

SYMBiFACE II:IDE routines

50 bytes removed, 23:31, 12 November 2006
;### IDE48B -> set 48bit address
;### Eingabe Input IX[32-47],HL[16-31],DE[0-15]=Sectornumber, A=SDH, B=Number of Sectors;### (you should reset the upper 8bits of the sector count register first)
;### Output CF=0 -> ok
;### CF=1 -> A=error code (...)
;### Destroyed AF,BC,DE
ide48b push af ;4
call iderdy ; wait for ready before first SDH write
jr c,ide48b1 ;2
pop af ;3
or #0f ;2
ld c,a ;1
push bc ;4
ld bc,ideprtsdh ;3
or and #0f f0 ;2 dec a ;1
out (c),a ;4 write SDH Register (low bytes)
call iderdy ; wait for ready after SDH write (maybe this can be skipped)
jr c,ide48b1 ;2
dec c ;1
out (c),l ;4 LBA 16-23
dec c ;1
out (c),e ;4 LBA 00-07
dec c ;1
pop de ;3
out (c),d ;4 Sector count
ld bc,ideprtsdh ;3
pop de ;3 inc e ;1 out (c),a e ;4 write SDH Register (high bytes)
dec c ;1
db #dd:ld a,h ;2
dec c ;1
out (c),h ;4 LBA 24-31
dec c ;1 out (c),d ;4 Sector count ret ;3 -> 79 77 microseconds
ide48b1 pop bc ;Return on Error
ret