ack/mach/minix/libsys/catchsig.s

43 lines
885 B
ArmAsm
Raw Permalink Normal View History

1992-05-15 13:31:19 +00:00
.define __begsig
1988-04-20 16:47:41 +00:00
.sect .text; .sect .rom; .sect .data
1992-05-15 13:31:19 +00:00
.extern __begsig
.extern __vectab, __M
1988-04-20 16:47:41 +00:00
mtype = 2 ! M+mtype = &M.m_type
.sect .text
1996-11-26 15:05:10 +00:00
__begsig:
1988-04-20 16:47:41 +00:00
push ax ! after interrupt, save all regs
1988-04-19 10:19:15 +00:00
push bx
push cx
push dx
push si
push di
push bp
push ds
push es
mov bx,sp
1988-04-20 16:47:41 +00:00
mov bx,18(bx) ! bx = signal number
mov ax,bx ! ax = signal number
dec bx ! vectab[0] is for sig 1
add bx,bx ! pointers are two bytes on 8088
1992-05-15 13:31:19 +00:00
mov bx,__vectab(bx) ! bx = address of routine to call
push (__M+mtype) ! push status of last system call
1988-04-20 16:47:41 +00:00
push ax ! func called with signal number as arg
1988-04-19 10:19:15 +00:00
call (bx)
back:
1988-04-20 16:47:41 +00:00
pop ax ! get signal number off stack
1992-05-15 13:31:19 +00:00
pop (__M+mtype) ! restore status of previous system call
1988-04-20 16:47:41 +00:00
pop es ! signal handling finished
1988-04-19 10:19:15 +00:00
pop ds
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
1988-04-20 16:47:41 +00:00
pop (dummy) ! remove signal number from stack
1988-04-19 10:19:15 +00:00
iret
1988-04-20 16:47:41 +00:00
.sect .data
dummy: .data2 0