!Revision history: ! 24-FEB-88 PSR Modified to follow change to ARM calling stack frame ! - Changed signal report to print extra in hex ! 28-JAN-88 PSR Replaced call on EXIT(1) with an explicit SWI _ Brasil Exit ! as signal failure result from general corruption. This can ! leave files open. ! %from IMP %include Console, Mcode, SysSpecs %externalrecord(Eventfm) EVENT %alias "3L_EVENT" = 0 %externalroutinespec Show Event %alias "3L_IMP_SHOW_EVENT" - (%record(Eventfm)%name E, %integer Language) %externalinteger Diag Ep %alias "3L___diagnose_ep" = 0 %constinteger PSb=R9, PFp=R10 %externalroutine Signal %alias "3L___signal" { -20 -16 -12 -8 -4 0 } {Stack frame is: [display] [SB] [FP] [SP] [RA] [PC] } { ^ } { | } { Fp } ! The following parameters are assumed to be stacked: {%integer Ev, Sub, Ext, Sig Sb, Sig Fp, Sig Ra, PrimRa?} { 4 8 12 16 20 24 28 } %owninteger Marker = 16_F82F0000 %label Top, F1, Magic, De %constinteger Ib = 0, {code block pionter} Cb = 1, {code base} Em = 2, {event mask = 1< {pick up event mask & limit & entry point} { W1 W2 W3} *TSTNES _ W1, Em {test all masked bits} {correct event, are we within the event block?} *ADDNE _ W2, W2, Cb {limit, relative -> absolute limit} *CMPNES _ Ra, W2 {reenter the program if GT} *MOVGT _ Psb, Sb {reset user's static base} *MOVGT _ Pfp, Fp {reset user's frame pointer} *ADDGT _ Pc, W3, Cb { -> (W2+Cb) } {no event trapped, back off} { -20 -16 -12 -8 -4 0 } {Stack frame is: [display] [SB] [FP] [SP] [RA] [PC] } { ^ } { | } { Fp } *TSTS _ F, #16_10 0000 {in prim?} *LDRNE _ Ra, PrimRa {restore old R14} *STRNE _ Ra, MdiagRa {Remember in case of diags} *BNE _ Top {and try again} *TSTS _ F, #16_4 0000 {display updated?} *LDRNE _ W2, [Fp, #-20] {saved display value} *MOVNE _ W1, F, %ASR #24 {get signed displacement (in words)} *STRNE _ W2, [Sb, W1, %LSL #2] *TSTS _ F, #16_20 0000 {main program?} *LDREQ _ Sb, [Fp, #-16] {previous static base} *LDREQ _ Ra, [Fp, #-4] {previous return address} *LDREQ _ Fp, [Fp, #-12] {previous stack frame} *BEQ _ Top {round again} {at the main program - give up} Event_Ra = MdiagRa Exit(0) %if Event_Event = 0 = Event_Sub Select Output(0) Printstring("Execution error -- ") Show Event(Event, 0) Newline *LDR _ 0, Diag Ep *BLNE _ DE Exit(1) DE:*MOV _ Pc, 0 %end