从软盘上的扇区读取

时间:2014-03-03 09:42:55

标签: assembly

mov     ah, 0x02                ; read floppy sector function
    mov     al, 1                   ; read 1 sector
    mov     ch, 1                   ; we are reading the second sector past us, so its still on track 1
    mov     cl, 2                   ; sector to read (The second sector)
    mov     dh, 0                   ; head number
    mov     dl, 0                   ; drive number. Remember Drive 0 is floppy drive.
    int     0x13                    ; call BIOS - Read the sector

这是来自http://www.brokenthorn.com/Resources/OSDev5.html

的示例代码

我真的不明白这一部分:

        mov     ch, 1                   ; we are reading the second sector past us, so its still on track 1
        mov     cl, 2                   ; sector to read (The second sector)

好的,所以第一个扇区是引导扇区(扇区0)。因此,此后的行业是第1部门。

那不应该吗?:

mov ch, 0       ;First track
mov cl, 1       ;second sector on first track

1 个答案:

答案 0 :(得分:2)

扇区编号从1开始,而轨道编号从0开始。 Int13很时髦。

http://stanislavs.org/helppc/int_13-2.html