koreth%panarthea.ebay@sun.com (Steven Grimm) (07/22/89)
Submitted-by: usqb015@liverpool.ac.uk (Mark Powell) Posting-number: Volume 2, Issue 62 Archive-name: postmort * Postmortem information analyser * Copyright 1989 By M.S.Powell (usqb015@uk.ac.liv) * Permission granted to examine and modify this source for; personal use, * no profit and as long as this header is left intact. * Written on Devpac v1.22 by Hisoft clr.l -(sp) move #32,-(sp) trap #1 addq.l #6,sp move.l d0,ssp dc.w $a00a move #4,-(sp) trap #14 addq.l #2,sp move d0,oldres bne.s resokay move #1,-(sp) pea -1.w move.l (sp),-(sp) move #5,-(sp) trap #14 lea 12(sp),sp move $8246.w,oldcol3 move $825e.w,$8246.w resokay lea mess0(pc),a6 bsr prmes cmp.l #$12345678,$380.w bne invalid moveq #0,d7 move.b $3c4.w,d7 cmp #25,d7 bcc invalid lea vector(pc),a5 moveq #0,d6 move.b 0(a5,d7),d6 beq invalid lea 0(a5,d6),a6 move d7,-(sp) bsr printd7 move (sp)+,d7 bsr prmes cmp #4,d7 bcc.s normal move #1,type lea mess4(pc),a6 bsr prmes move $3cc.w,d7 btst #3,d7 bne.s notins addq.l #4,a6 notins bsr prmes btst #4,d7 bne.s read addq.l #5,a6 read bsr prmes normal bsr cr bsr cr lea $384.w,a3 lea $3a4.w,a4 move.l $3c8.w,d0 move.l $3c0.w,$3c8.w move.l d0,$3c0.w moveq #'0',d7 prreglp move #'D',d0 move.l (a3)+,d3 bsr reg moveq #26,d6 prspace bsr space dbra d6,prspace move.l (a4)+,d3 cmp #'7',d7 bne.s prnorm move #'U',d0 bsr prmess3 bra.s donereg prnorm move #'A',d0 bsr reg bsr cr addq #1,d7 bra.s prreglp donereg lea mess21(pc),a6 bsr prmes move.l $3c8.w,d3 move.l $3c0.w,$3c8.w move.l d3,$3c0.w bsr prmes3 bsr cr lea $3cc.w,a3 tst type beq.s notba lea mess5(pc),a6 bsr prmes move (a3)+,d6 and #7,d6 moveq #0,d7 move d6,d7 bsr printd7 lea funcode(pc),a5 moveq #0,d7 move.b 0(a5,d6),d7 lea 0(a5,d7),a6 bsr prmes bsr cr lea mess6(pc),a6 bsr prmes move.l (a3)+,d3 bsr prhex32 bsr prmes move (a3)+,d3 bsr prhex16 bsr cr notba lea mess7(pc),a6 bsr prmes move (a3)+,d5 move d5,d3 bsr prhex16 bsr space lea flagdat(pc),a5 moveq #6,d6 prflags cmp #4,d6 bne.s not4 move d5,d7 lsr #8,d7 and #7,d7 add #48,d7 move d7,-(sp) bsr prchar not4 move.b (a5)+,d7 move.b (a5)+,d4 move d4,-(sp) btst d7,d5 bne.s bitset move #32,(sp) bitset bsr prchar dbra d6,prflags bsr prmes move.l (a3)+,d3 bsr prhex32 bsr cr lea $3cc.w,a3 move.l $3c0.w,a4 moveq #1,d7 linelp bsr cr move.l a4,d3 bsr prhex32 bsr space move #'>',-(sp) bsr prchar moveq #7,d6 wordlp bsr space move (a3)+,d3 bsr prhex16 dbra d6,wordlp addq.l #8,a4 dbra d7,linelp bra.s out invalid lea mess1(pc),a6 bsr.s prmes out lea mess2(pc),a6 bsr.s prmes wait bsr.s getkey cmp #13,d0 bne.s wait desktop move oldres(pc),-(sp) pea -1.w move.l (sp),-(sp) move #5,-(sp) trap #14 lea 12(sp),sp tst oldres bne.s notlo move oldcol3(pc),$8246.w notlo move.l ssp(pc),-(sp) move #32,-(sp) trap #1 addq.l #6,sp clr -(sp) trap #1 prmes move.b (a6)+,d0 beq.s exit move d0,-(sp) bsr.s prchar bra.s prmes prchar move.l (sp)+,return pea $30002 trap #13 addq.l #6,sp move.l return(pc),-(sp) exit rts getkey pea $10002 trap #13 addq.l #4,sp tst d0 beq.s getky bsr.s getky bra.s getkey getky pea $20002 trap #13 addq.l #4,sp rts printd7 move #'#',-(sp) bsr.s prchar divu #10,d7 tst d7 beq.s less10 add #48,d7 move d7,-(sp) bsr.s prchar less10 swap d7 add #48,d7 move d7,-(sp) bsr.s prchar move #32,-(sp) bsr.s prchar rts reg move d0,-(sp) bsr.s prchar move d7,-(sp) bsr.s prchar bsr.s space move #'=',-(sp) bsr.s prchar bsr.s space bsr.s prhex32 rts prhex32 move d3,-(sp) swap d3 bsr.s prhex16 move (sp)+,d3 prhex16 move d3,-(sp) lsr #8,d3 bsr.s prhex8 move (sp)+,d3 prhex8 move d3,-(sp) lsr #4,d3 bsr.s prhex4 move (sp)+,d3 prhex4 and #15,d3 moveq #$90-1,d4 addq #1,d4 abcd d4,d3 moveq #$40,d4 abcd d4,d3 move d3,-(sp) bsr prchar rts space move #32,-(sp) bsr prchar rts cr move #13,-(sp) bsr prchar move #10,-(sp) bsr prchar rts prmess3 move d0,-(sp) bsr prchar lea mess3(pc),a6 bsr prmes prmes3 bsr.s prhex32 bra.s cr oldcol3 dc.w 0 mess0 dc.b 27,'E',27,'Y',32+1,32+23 dc.b 'Postmortem information analyser v2' dc.b 27,'Y',32+3,32+26 dc.b 'Copyright 1988 By M.S.Powell' dc.b 13,10,10,0 mess1 dc.b ' ' dc.b 'Postmortem information invalid',0 mess2 dc.b 13,10,10,' ' dc.b 'Press RETURN to exit',0 mess21 dc.b 27,'Y',32+15,32+40,'S' mess3 dc.b 'SP= ',0 mess4 dc.b ' during ',0 dc.b 'non ' dc.b 'instruction ',0 dc.b 'read',0 dc.b 'write',0 mess5 dc.b 'Function code = ',0 mess6 dc.b 'Access address = ',0 dc.b 27,'Y',32+18,32+40,'Instruction register = ',0 mess7 dc.b 'Status register = ',0 mess8 dc.b ' Program counter = ',0 ssp dc.l 0 oldres dc.w 0 return dc.l 0 type dc.w 0 flagdat dc.b 15,'T',13,'S',4,'X',3,'N',2,'Z',1,'V',0,'C' vector v dc.b 0,0,v2-v,v3-v,v4-v,v5-v,v6-v,v7-v,v8-v,v9-v,0,0,0,0,0 dc.b v15-v,0,0,0,0,0,0,0,0,v24-v v2 dc.b 'Bus error',0 v3 dc.b 'Address error',0 v4 dc.b 'Illegal instruction',0 v5 dc.b 'Zero divide',0 v6 dc.b 'CHK instruction',0 v7 dc.b 'TRAPV instruction',0 v8 dc.b 'Privilege violation',0 v9 dc.b 'Trace',0 v15 dc.b 'Uninitialised interrupt vector',0 v24 dc.b 'Spurious interrupt',0 funcode fc dc.b fc0-fc,fc1-fc,fc2-fc,fc0-fc,fc0-fc,fc5-fc,fc6-fc,fc7-fc fc0 dc.b '(Undefined, reserved)',0 fc1 dc.b 'User data',0 fc2 dc.b 'User program',0 fc5 dc.b 'Supervisor data',0 fc6 dc.b 'Supervisor program',0 fc7 dc.b 'Interrupt acknowledge',0