You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
movah,0cpu186shlax,9extended_read_diskshrax,9cpu8086movah,0x02 ; Put read code backcmpal,0je rd_error
The extended_read_disk instruction writes the error to AL. But right after the read we shift AX back 9 bits to right (shr ax, 9) which overrides AL. So what's even the point of cmp al, 0 and setting AL in extended_read_disk?
And even when you fix the bios, the read function in 8086tiny.c is still wrong. You use AX as length to read. But read() returns, for example 512, which is 0 inside AL because of the overflow. So even if we don't shift bits after the read AL indicates "error".
The text was updated successfully, but these errors were encountered:
Look at this block in the bios:
The
extended_read_disk
instruction writes the error toAL
. But right after the read we shiftAX
back 9 bits to right (shr ax, 9
) which overridesAL
. So what's even the point ofcmp al, 0
and settingAL
inextended_read_disk
?And even when you fix the bios, the read function in
8086tiny.c
is still wrong. You useAX
as length to read. Butread()
returns, for example 512, which is0
insideAL
because of the overflow. So even if we don't shift bits after the readAL
indicates "error".The text was updated successfully, but these errors were encountered: