rulimine/stage1/cd/read_2k_sectors.asm

36 lines
617 B
NASM
Raw Normal View History

2021-09-21 15:39:43 +03:00
bits 16
2021-02-21 05:45:24 +03:00
; --- Read sectors from disk ---
; IN:
; eax <- start LBA (2k sectors)
; cx <- number of 2k sectors
; dl <- drive number
; ds <- ZERO
2021-09-21 15:39:43 +03:00
; bx <- buffer offset
; es <- buffer segment
2021-02-21 05:45:24 +03:00
; OUT:
; Carry if error
align 8
dapack:
dapack_size: db 0x10
dapack_null: db 0x00
dapack_nblocks: dw 0
2021-02-25 03:40:02 +03:00
dapack_offset: dw 0
dapack_segment: dw 0
2021-02-21 05:45:24 +03:00
dapack_LBA: dq 0
read_2k_sectors:
pusha
mov dword [dapack_LBA], eax
mov word [dapack_nblocks], cx
2021-09-21 15:39:43 +03:00
mov word [dapack_offset], bx
mov word [dapack_segment], es
2021-02-21 05:45:24 +03:00
mov ah, 0x42
mov si, dapack
int 0x13
popa
ret