rdos/kernel/intr.asm

42 lines
567 B
NASM
Raw Normal View History

2019-03-24 18:59:03 +01:00
; out ds:si copy of interrupt table
ivt_backup:
push ax
push cx
push di ; backup original value
push ds
mov ax, 0x80
call malloc
push di
mov cx, 0x80
mov ax, cs
mov es, ax
mov si, 0x0000
mov ds, si
rep movsb
pop si ; this was di after malloc
pop ds
pop di ; restore original di
pop cx
pop ax
ret
; set item in interrupt vector table
; in: bx interrupt number
; ds:dx new handler address
ivt_set:
push es
push ax
xor ax,ax
mov es,ax
sal bx,1
sal bx,1
mov [es:bx], dx
mov [es:bx+2], ds
pop ax
pop es
ret