
 1000  *SAVE S.IRQ TRAPPER
 1010  *--------------------------------
 1020  *      INTERRUPT TRACE UTILITY
 1030  *
 1040  *      BY: CHARLES H. PUTNEY
 1050  *          18 QUINNS ROAD
 1060  *          SHANKILL
 1070  *          COUNTY DUBLIN
 1080  *          IRELAND
 1090  *--------------------------------
 1100  A.REG       .EQ $45      A-REG SAVE AREA USED BY MONITOR
 1110  STACK       .EQ $100     STACK PAGE
 1120  INTVEC      .EQ $3FE     INTERRUPT VECTOR
 1130  BOTTOM.LINE .EQ $7D0     LINE 24 OF TEXT SCREEN
 1140  *--------------------------------
 1150  KEYBD  .EQ $C000    KEYBOARD DATA
 1160  KEYSTB .EQ $C010    KEYBOARD STROBE
 1170  MNTR   .EQ $FF69    MONITOR ENTRY POINT (CALL -151)
 1180  *--------------------------------
 1190         .OR $300     PAGE THREE
 1200  *--------------------------------
 1210  SETUP  LDA #INT     LOAD IRQ VECTOR
 1220         STA INTVEC   LOW BYTE
 1230         LDA /INT
 1240         STA INTVEC+1 HIGH BYTE
 1250         CLI          ALLOW IRQ'S
 1260         RTS
 1270  *--------------------------------
 1280  INT    STX XREG     SAVE X (A-REG SAVED BY MONITOR)
 1290         STY YREG     SAVE Y
 1300  *---DISPLAY REG TITLES-----------
 1310         LDX #39      PUT UP MESSAGE LINE
 1320  .1     LDA TITLES,X  GET MESSAGE CHAR
 1330         STA BOTTOM.LINE,X   PUT ON SCREEN
 1340         DEX
 1350         BPL .1       DONE ?
 1360  *---DISPLAY REG VALUES-----------
 1370         LDY #10      START OF REG DISPLAY AREA
 1380         LDA A.REG    ...A-REG
 1390         JSR DISPLAY.HEX
 1400         LDA XREG     ...X-REG
 1410         JSR DISPLAY.HEX
 1420         LDA YREG     ...Y-REG
 1430         JSR DISPLAY.HEX
 1440         TSX          GET STACK POINTER
 1450         INX          POINT AT PROCESSOR STATUS
 1460         LDA STACK,X  ...P-REG
 1470         JSR DISPLAY.HEX
 1480         INX          ADJUST S-REG
 1490         INX
 1500         TXA          ...S-REG AS WAS BEFORE INTERRUPT
 1510         JSR DISPLAY.HEX
 1520  *---DISPLAY PC-REG---------------
 1530         LDY #0       START OF PC-REG DISPLAY
 1540         LDA STACK,X  GET PC HIBYTE
 1550         JSR DISPLAY.HEX
 1560         DEX
 1570         LDY #2
 1580         LDA STACK,X  GET PC LOBYTE
 1590         JSR DISPLAY.HEX
 1600  *---WAIT FOR "S" OR "G"----------
 1610  .2     LDA KEYBD    KEY PRESSED ?
 1620         BPL .3       NO
 1630         STA KEYSTB   CLEAR THE KEY
 1640         CMP #"G"     GO AHEAD ?
 1650         BEQ .4       YES
 1660         CMP #"S"     STOP ?
 1670         BEQ .5       YES
 1680  .3     DEX          BLINK CURSOR
 1690         BNE .3
 1700         DEY          LONGER DELAY
 1710         BNE .3
 1720         LDA BOTTOM.LINE+39  LAST CHAR ON SCREEN
 1730         EOR #$80     INVERT IT
 1740         STA BOTTOM.LINE+39  REPLACE IT
 1750         BNE .2       BRANCH ALWAYS
 1760  *---"G" TYPED, RETURN------------
 1770  .4     LDA A.REG      RESTORE THE REGISTERS
 1780         LDX XREG
 1790         LDY YREG
 1800         RTI          BACK TO WORK
 1810  *---"S" TYPED, SO STOP-----------
 1820  .5     JMP MNTR     ENTER THE MONITOR
 1830  *--------------------------------
 1840  DISPLAY.HEX
 1850         PHA          SAVE THE A-REG
 1860         LSR          SHIFT INTO LOWER NIBBLE
 1870         LSR
 1880         LSR
 1890         LSR
 1900         JSR DIGIT    MAKE IT A DIGIT
 1910         STA BOTTOM.LINE,Y   SHOW HIGH NIBBLE
 1920         PLA          GET A-REG AGAIN 
 1930         AND #$0F     MASK IT
 1940         JSR DIGIT    MAKE IT A DIGIT
 1950         STA BOTTOM.LINE,Y   SHOW LOWER NIBBLE
 1960         INY
 1970         INY
 1980         INY
 1990         RTS
 2000  *--------------------------------
 2010  DIGIT  INY
 2020         ORA #$B0     ADD NUMBER ZERO
 2030         CMP #$BA     IS IT A LETTER
 2040         BCC .1       NO - DONE
 2050         ADC #$6      6 PLUS CARRY MAKES A
 2060  .1     RTS
 2070  *--------------------------------
 2080  TITLES .AS -/     -   A=   X=   Y=   P=   S=         /
 2090  *--------------------------------
 2100  XREG   .DA #*-*     X REGISTER SAVE AREA
 2110  YREG   .DA #*-*     Y REGISTER SAVE AREA
 2120  *--------------------------------

