Keil Logo

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 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: Tuesday, May 5, 2015


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.