sorry as I'm asking this too late, but could you verify me please?
I'm writing a pmode floppy disk driver. If a "bad hardware" error is encountered, the bits 6-7 of the status byte (now loaded to AL let's say) should be "11" in binary, like this:
11000000
What should I do to detect them if they are 1?
I tried this:
Code: Select all
test al,0C0h
jnz BadHardwareErrorBut when I set the floppy speed to "reserved" (1 mbps) which shouldn't be used, on a real machine it displays "bad HW" message. That same applies if I'll remove out the floppy before reading
My snippet of code looks like this:
Code: Select all
...
mov al,[FDD_StatusByte0]
test al,0C0h
jnz FDD_ErrorBadHW
test al,80h
jnz FDD_ErrorBadCommand
test al,40h
jnz FDD_ErrorCantDone
test al,20h
jnz FDD_ErrorSectorError
...10000000, etc. And if I would put the "bad command" error handler before the Bad HW handler, it would show "Bad command error" right instead of "Bad HW error", so I'm making a mistake somewhere.
Could somebody post me some "templates" in assembly on how to e.g. check if bytes 2-3 are 1, or 0, or if only a single bit is 0, etc?


