2019-05-02 22:14:31 +02:00
|
|
|
; 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
|
2019-05-02 22:14:31 +02:00
|
|
|
mov es, ax
|
|
|
|
; DI := intnum * 4
|
|
|
|
pop di
|
|
|
|
sal di, 1
|
|
|
|
sal di, 1
|
|
|
|
; copy offset from arguments
|
|
|
|
pop ax
|
|
|
|
stosw
|
|
|
|
; copy our segment
|
2019-04-10 00:38:20 +02:00
|
|
|
mov ax, cs
|
2019-05-02 22:14:31 +02:00
|
|
|
stosw
|
|
|
|
; use code stack
|
|
|
|
xchg sp, bp
|
|
|
|
ret
|