Keil™, An ARM® Company

Technical Support

A166: DETECTING UNUSED INTERRUPTS


Information in this article applies to:

  • C166 Version 3.12
  • C166 Version 4.00

QUESTION

How can I detect unused interrupts in my assembly programs?

ANSWER

There are a number of ways to do detect unused interrupts.

One method involves creating an UnusedInterrupt function and placing a call to that function in each unused interrupt vector. The following code illustrates this idea. Note that you must create the UnusedInterrupt function to use this example.

%*DEFINE   (VECTORX  (intfunction)) (
            EXTERN %intfunction:NEAR
            JMP    %intfunction
)

INTERRUPT_VECTORS SECTION       CODE PUBLIC 'VECTORS'
TABLE                           PROC NEAR
; Trap
        ORG              0h             ;
        %VECTORX (?C_STARTUP)           ; 0x00 RESET (4 bytes)
        ORG              8h             ;
        %VECTORX (UnusedInterrupt)      ; 0x02 NMITRAP Non-maskable int (4 bytes)
        ORG              10h            ;
        %VECTORX (UnusedInterrupt)      ; 0x04 STOTRAP Stack overflow
        ORG              18h            ;
        %VECTORX (UnusedInterrupt)      ; 0x06 STUTRAP Stack underflow
        ORG              20h            ;
        %VECTORX (UnusedInterrupt)      ; 0x08 V_INT_UNKNOWN Not supported (a gap)
        ORG              28h            ;
        %VECTORX (UnusedInterrupt)      ; 0x0A BTRAP HW Traps Flags
        ORG              2Ch            ;
        %VECTORX (UnusedInterrupt)      ; 0x0B RESERVED_0 Do not use
        ORG              30h
;
TABLE                           ENDP
INTERRUPT_VECTORS               ENDS
END

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Thursday, June 10, 2004


Did this article provide the answer you needed?