Keil Logo

C166: MULTIPLE VECTORS FOR A SINGLE INTERRUPT FUNCTION


Information in this article applies to:

  • C166 All Versions

QUESTION

How can I service several different interrupts with a single interrupt service routine?

ANSWER

To do this, you may write your interrupt service routine in C. For example:

void ISR11 (void)  interrupt 0x11  {
  ;  // your interrupt service code
}

The compiler automatically creates an interrupt vector for interrupt 11h.

To create vectors for other interrupts (to point to this ISR) create an assembly file similar to the following:

$CASE SEGMENTED

EXTERN    ISR11:FAR  ; for MEDIUM, LARGE & HLARGE
; EXTERN  ISR11:NEAR ; for SMALL, COMPACT & HCOMPACT

INTR_VEC10H  SECTION CODE AT 40H
INTR_SEC10H  PROC NEAR
             JMP    FAR  IntrRoutine
INTR_SEC10H  ENDP
INTR_VEC10H  ENDS

                        END

This creates an interrupt vector for interrupt 10h which jumps to ISR11. You may create additional interrupt vectors using this method.

SEE ALSO

Last Reviewed: Tuesday, April 29, 2014


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.