rdos/kernel/intr.asm

23 lines
373 B
NASM
Raw Normal View History

; Register a interrupt handler
; in: sp:bp+0 interrupt number
; +2 handler offset
; out: sp:bp+4
intr_register:
; use data stack
xchg sp, bp
; ES := 0
2019-03-31 22:54:51 +02:00
xor ax, ax
mov es, ax
; DI := intnum * 4
pop di
sal di, 1
sal di, 1
; copy offset from arguments
pop ax
stosw
; copy our segment
mov ax, cs
stosw
; use code stack
xchg sp, bp
ret