ack/mach/minixST/libsys/stcatch.s

34 lines
761 B
ArmAsm
Raw Permalink Normal View History

1988-04-19 09:34:37 +00:00
#define FREEREGS d0-d1/a0-a1
1992-05-15 13:55:14 +00:00
.define __begsig
.extern __vectab
.extern __M
.sect .text
.sect .rom
.sect .data
.sect .bss
1988-04-19 09:34:37 +00:00
mtype = 2 ! M+mtype = &M.m_type
1992-05-15 13:55:14 +00:00
.sect .text
__begsig:
1988-04-19 09:34:37 +00:00
movem.l FREEREGS,-(sp)
clr.l d0
#ifdef ALCYON
move.w 24(sp),d0 ! d0 = signal number
#else
move.w 16(sp),d0 ! d0 = signal number
#endif
1992-05-15 13:55:14 +00:00
move.w __M+mtype,-(sp) ! push status of last system call
1988-04-19 09:34:37 +00:00
move.w d0,-(sp) ! func called with signal number as arg
asl.l #2,d0 ! pointers are four bytes on 68000
1992-05-15 13:55:14 +00:00
move.l #__vectab,a0
1988-04-19 09:34:37 +00:00
move.l -4(a0,d0),a0 ! a0 = address of routine to call
jsr (a0)
back:
add.l #2,sp ! get signal number off stack
1992-05-15 13:55:14 +00:00
move.w (sp)+,__M+mtype ! restore status of previous system call
1988-04-19 09:34:37 +00:00
movem.l (sp)+,FREEREGS
add.l #2,sp ! remove signal number from stack
rtr