ack/mach/m68k4/libem/trp.s
ceriel 3d016f7385 Did not work properly, printed wrong trap number. Does not work
properly now, because it does no save the registers.
1986-10-27 09:57:42 +00:00

42 lines
514 B
ArmAsm

.define .trp
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.trp:
move.l d0,-(sp)
cmp.l #16,8(sp)
bcc 1f
move.l 8(sp),d0
btst d0,.trpim
bne 3f
1:
move.l a0,-(sp)
move.l .trppc,a0
move.l a0,d0
beq 9f
clr.l .trppc
move.l 12(sp),-(sp)
jsr (a0)
add.l #4,sp
move.l (sp)+,a0
3:
move.l (sp)+,d0
move.l (sp)+,(sp)
rts
9:
move.l (sp)+,a0
move.l (sp)+,d0
move.l 4(sp),-(sp)
pea fmt
jsr .diagnos
add #4,sp
jsr __cleanup
jmp EXIT
.sect .data
fmt: .asciz "EM trap %d called\n"
.align 2