This is the wait for floppy int in my driver
Code:
;----------------------------------------------------;
; Wait Done ;waits for a floppy int. ;
;----------------------------------------------------;
WaitDone:
mov [Timer],30 ; 20 = about 1 second,we use (1.5 seconds).
mov [TimerOn],1 ; start couting.
WaitDoneLoop:
mov al,[TimerOn] ; we test if
or al,al ; timeout is up yet?.
jz WaitDoneError ; if it is we exit,with error.
mov ax,[done] ; if not we check for floppt int.
or ax,ax
jz WaitDoneLoop ; if not do another loop.
clc ; we end here if we have a int:-)
ret
WaitDoneError: ;we end up here if we run out of time:-(.
stc
ret
It is called like this:
Code:
mov [done],0 ; we need to wait
call WaitDone ; for floppy int.
jc FddReadError ; jump to error exit,if timeout.
And here is what appans whan a floppy int comes
Also Note this code go in your ISR, so when it firers, it sets [done] to 1.
Code:
or [done],1
Thats how it works, if your using C, you will need to convert it.