ARM Technical Support Knowledge Articles

MULTIPLE VECTORS FOR A SINGLE INTERRUPT FUNCTION

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2004-06-16 15:39:30

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential