Keil™, An ARM® Company

Technical Support

C166: COPYING C INTERRUPT ROUTINES TO IDATA IN V3.X


Information in this article applies to:

  • C166 Version 3.12

QUESTION

I need a solution where I can copy a C interrupt routine into IDATA. The code to do this must support future editing of the interrupt routine so that as the interrupt routine grows or shrinks, the entire interrupt code gets copied. Is there an easy way to do this?

ANSWER

Unfortunately, there is not a simple way to do this in C166 Version 3. However, there is in Version 4. See below for more information.

In Version 3, the most difficult problem is that C166 does not have an option generate relocatable code. The compiler may generate absolute jumps in the code generated for a function (even interrupt functions). When you copy the function to a different address, this will cause problems.

The length of the function is not a big problem. You just have to know which function follows the interrupt function in the source code. The difference between the following function and the interrupt function is the length of the interrupt function.

If the interrupt function is not complex and is not big, there is a good chance that it does not contain absolute jumps, but you can never guarantee it.

MORE INFORMATION

Last Reviewed: Thursday, May 20, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure