diff --git a/kernel/intr.asm b/kernel/intr.asm index e08b764..2dbfa60 100644 --- a/kernel/intr.asm +++ b/kernel/intr.asm @@ -32,3 +32,29 @@ intr_register: pop es pop ax ret + +; Get address for a interrupt vector +; in AL interrupt number +; out DS:SI far ptr to routine/data +intr_load: + push ax + + ; SI = AL * 4 + mov ah, 4 + mul ah + mov si, ax + + ; ES = 0 + xor ax, ax + mov ds, ax + + ; load offset + lodsw + mov si, ax + + ; load segment + lodsw + mov ds, ax + + pop ax + ret