1990-01-12 10:29:26 +00:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
|
|
|
.define .trp
|
|
|
|
! $Header$
|
1985-01-18 14:30:03 +00:00
|
|
|
|
|
|
|
.trp:
|
1985-01-22 15:20:19 +00:00
|
|
|
pushl r0
|
1985-01-18 14:30:03 +00:00
|
|
|
movl 8(sp),r0
|
|
|
|
movl 4(sp),8(sp)
|
|
|
|
movl (sp)+,(sp)
|
|
|
|
cmpl r0,$16
|
1990-01-12 10:29:26 +00:00
|
|
|
bgequ I1 ! a trapnumber >= 16 cannot be ignored
|
|
|
|
bbc r0,.trpim,I1
|
1985-01-18 14:30:03 +00:00
|
|
|
movl (sp)+,r0
|
|
|
|
rsb
|
1990-01-12 10:29:26 +00:00
|
|
|
I1:
|
|
|
|
pushr $017776 ! save registers
|
|
|
|
pushl r0 ! trapnumber on stack
|
1985-01-18 14:30:03 +00:00
|
|
|
movl .trppc,r0
|
1990-01-12 10:29:26 +00:00
|
|
|
beql I2 ! is there a user defined traphandler?
|
1985-01-18 14:30:03 +00:00
|
|
|
clrl .trppc
|
1990-01-12 10:29:26 +00:00
|
|
|
calls $1,(r0) ! if so, call it
|
|
|
|
popr $017776 ! restore registers
|
1985-01-18 14:30:03 +00:00
|
|
|
movl (sp)+,r0
|
|
|
|
rsb
|
1985-01-22 15:20:19 +00:00
|
|
|
|
1990-01-12 10:29:26 +00:00
|
|
|
I2:
|
|
|
|
! Put the (octal) trapnumber in the zeroes in Iemes[].
|
1985-01-22 15:20:19 +00:00
|
|
|
|
1990-01-12 10:29:26 +00:00
|
|
|
movl $Iemesend-9,r1 ! Addres after last '0'.
|
|
|
|
movl $5,r2 ! Max number of digits.
|
|
|
|
movl (sp),r0 ! Trap number in r0.
|
|
|
|
I3:
|
|
|
|
bicw3 $0177770,r0,r3 ! Lower 3 bits form lower octal digit.
|
|
|
|
bisb2 r3,-(r1) ! Put them in the '0'.
|
|
|
|
ashl $-3,r0,r0 ! Shift the 3 bits off.
|
|
|
|
sobgtr r2,I3
|
1985-01-22 15:20:19 +00:00
|
|
|
movl ap,r2
|
1990-01-12 10:29:26 +00:00
|
|
|
movl $Iwr,ap
|
|
|
|
chmk $4 ! write
|
1985-01-22 15:20:19 +00:00
|
|
|
movl r2,ap
|
1985-01-18 14:30:03 +00:00
|
|
|
bpt
|
1990-01-12 10:29:26 +00:00
|
|
|
.sect .data
|
|
|
|
Iemes:
|
|
|
|
.data1 'E','M',' ','t','r','a','p',' ','0','0','0','0','0',' ','(','o','c','t','a','l',')',0xa
|
|
|
|
Iemesend:
|
1985-01-22 15:20:19 +00:00
|
|
|
.align 2
|
1990-01-12 10:29:26 +00:00
|
|
|
Iwr:
|
|
|
|
.data4 3 ! 3 arguments.
|
|
|
|
.data4 2 ! File descriptor 2.
|
|
|
|
.data4 Iemes ! Address of character buffer.
|
|
|
|
.data4 Iemesend - Iemes ! Number of characters to write.
|