1986-12-09 11:13:14 +00:00
|
|
|
.sect .text
|
|
|
|
.sect .rom
|
|
|
|
.sect .data
|
|
|
|
.sect .bss
|
|
|
|
.sect .text
|
1984-12-18 17:11:35 +00:00
|
|
|
_sigtrp: move.l (sp)+,d2 !save return address
|
|
|
|
mov (sp)+,d1 !trapno in d1
|
1984-07-23 11:49:00 +00:00
|
|
|
mov (sp)+,d4 !signo in d4
|
|
|
|
extend d4
|
|
|
|
extend d1
|
|
|
|
comp #16,d4
|
|
|
|
bhi sig_bad
|
|
|
|
tst.l d4
|
|
|
|
beq sig_bad
|
|
|
|
move.l d4,a0
|
|
|
|
add.l a0,a0
|
|
|
|
add.l a0,a0
|
1987-10-16 17:57:09 +00:00
|
|
|
move.l #sig_trp-4,a1
|
|
|
|
add.l a0,a1
|
1987-03-31 09:23:20 +00:00
|
|
|
move.l (a1),d2 !previous trap number in d2
|
1984-07-23 11:49:00 +00:00
|
|
|
comp #256,d1 !-2 and -1 special
|
|
|
|
bcc 1f
|
1987-10-16 17:57:09 +00:00
|
|
|
move.l #sig_adr-4,d3
|
|
|
|
add.l a0,d3 !Get the pointer to the trap-
|
1984-07-23 11:49:00 +00:00
|
|
|
bne 2f !procedure to give as argument to
|
1987-03-30 09:39:38 +00:00
|
|
|
sig_bad: mov 22,-(sp) !_Xsignal. If pointer 0 trapping is
|
1984-07-23 11:49:00 +00:00
|
|
|
mov 22,-(sp) !not legal
|
|
|
|
jmp (a4)
|
|
|
|
1: comp #-3,d1 !-2:reset default , -3: ignore
|
|
|
|
bmi sig_bad
|
|
|
|
move.l d1,d3
|
|
|
|
ad #2,d3 !0:reset default for signal, -1: ignore
|
1987-03-31 09:23:20 +00:00
|
|
|
2: move.l d1,(a1) !set new trapno
|
1984-07-23 11:49:00 +00:00
|
|
|
move.l d3,-(sp) !set arguments to signal:
|
|
|
|
mov d4,-(sp) !pointer ,signo to be trapped
|
1987-03-30 09:39:38 +00:00
|
|
|
bsr _Xsignal
|
1984-12-18 17:11:35 +00:00
|
|
|
jmp (a4)
|
1986-12-09 11:13:14 +00:00
|
|
|
.sect .data
|
|
|
|
sig_adr: .data4 sig1 ; .data4 sig2 ; .data4 sig3 ; .data4 0
|
|
|
|
.data4 0 ; .data4 0 ; .data4 0 ; .data4 0
|
|
|
|
.data4 0 ; .data4 0 ; .data4 sig11 ; .data4 sig12
|
|
|
|
.data4 sig13 ; .data4 sig14 ; .data4 sig15 ; .data4 sig16
|
|
|
|
sig_trp: .data4 -2 ; .data4 -2 ; .data4 -2 ; .data4 -2
|
|
|
|
.data4 -2 ; .data4 -2 ; .data4 -2 ; .data4 -2
|
|
|
|
.data4 -2 ; .data4 -2 ; .data4 21 ; .data4 25
|
|
|
|
.data4 -2 ; .data4 -2 ; .data4 -2 ; .data4 -2
|
|
|
|
.sect .text
|
1984-07-23 11:49:00 +00:00
|
|
|
!the next procedures map the catched signal to em errors. The em error
|
|
|
|
!procedure will handle this.
|
1984-12-18 17:11:35 +00:00
|
|
|
sig1: pea retutrap
|
|
|
|
move.l sig_trp,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
sig2: pea retutrap
|
|
|
|
move.l sig_trp+4,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
sig3: pea retutrap
|
|
|
|
move.l sig_trp+8,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
sig8: pea retutrap
|
|
|
|
move.l sig_trp+28,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
sig13: pea retutrap
|
|
|
|
move.l sig_trp+48,d0
|
|
|
|
mov d0,-(sp)
|
1984-07-23 11:49:00 +00:00
|
|
|
bra error
|
1984-12-18 17:11:35 +00:00
|
|
|
sig14: pea retutrap
|
|
|
|
move.l sig_trp+52,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
sig15: pea retutrap
|
|
|
|
move.l sig_trp+56,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
sig16: pea retutrap
|
|
|
|
move.l sig_trp+60,d0
|
|
|
|
mov d0,-(sp)
|
|
|
|
bra error
|
|
|
|
retutrap: add.l #4,sp !remove signumber
|
|
|
|
rtr
|
1984-07-23 11:49:00 +00:00
|
|
|
|
|
|
|
sig12: pea sig12
|
|
|
|
mov #12,-(sp)
|
1987-03-30 09:39:38 +00:00
|
|
|
bsr _Xsignal
|
1984-07-23 11:49:00 +00:00
|
|
|
bsr e_badmon
|
|
|
|
rtr
|
1987-03-31 09:23:20 +00:00
|
|
|
sig11: move.l 4(a5),d0
|
1984-07-23 11:49:00 +00:00
|
|
|
sub.l sp,d0
|
|
|
|
bcs e_memflt !in this case error handling possible
|
|
|
|
move.l ml,sp !refresh stack and stop .
|
|
|
|
bra notrap1
|
|
|
|
|