I'm slowly trying to get into osdev just to play around.
This tutorial has a piece of assembly that waits for a drive to become ready:
reset_drive:
mov ah, 0
int 13h
or ah, ah
jnz reset_drive
I get that after the interrupt, ah
will be zero if the device is ready. But what does or ah,ah
do? Seems a bit redundant... it appears to do nothing. (at least by my logic) What does it do?
It sets/unsets the ZERO flag depending on whether ah
is zero.
Depending on the status of the flag, jnz reset_drive
will jump: Only if ah
is not zero.
In other words, it waits for the device to become ready since it stops repeating after ah
becomes zero.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With