Here are a couple knowledge base articles on the subject. I will have about 100 unused interrupt vectors.
The first article creates a different ISR for each unused interrupt and calls a common fault handling function. This generates way too much code for me.
The second article seems like what I want but I'm not sure because I cannot get it to assemble. I get a syntax error when it sees the macro definition. I did try something very similar. I have an assembly file that ORGs a JMPS instruction to the location of each unused vector, skipping the ones I use. This reserves a contiguous block of memory from my first JMPS to the last one including the ones I skip, so I get a memory overlap error for each vector I am using.
Does anyone have a neat way you have figured out to do this that you can share with me.
Any help would be appreciated,
Just an idea: drop the automatically generated interrupt vector table and build your own one. Use the macro processor to generate the necessary assembly code using a list of ISRs kept in an include file.
I never had to use the macro processor, but having seen some Keil's assembly code I got the impression that it's much more powerful than the C preprocessor. For example, this is how the interrupt vector table is generated in Monitor166 source code:
%SET(COUNT,4) ; SET UP INTERRUPT TABLE
%WHILE(%COUNT LE 01FCH)
(%IF (%COUNT EQ (%BRK_T_ADR*4)) THEN (JMP FAR BRKP
) ELSE (%IF (%COUNT EQ (2BH*4)) THEN (JMP FAR SER_ISR
) ELSE (JMPS INT_ADR_SEG,INT_ADR_OFF + %COUNT ) FI ) FI
%SET(COUNT,%COUNT + 4)
Make sure that you use MACRO(MPL) to assemble this file.
Since C166 Version 4.10 the Linker supports the fill option in the INTNO directive.
Take a look to the Release Notes (http://www.keil.com/update/_c166/c166v422.htm).
The syntax for the L166 directive is:
INTNO (interrupt_name (FILL))
Thanks for all the replies guys. Looking at the release notes, it appears that INTNO (interrupt_name (FILL)) will do the trick.
Jon: Is it possible for someone to put a reference to this command in the knowledge base articles I sited in the original post.
Yep, works great!!! Hopefully Keil will update the links I referenced so the next guy does not spend a day and a half on this as I have done.
View all questions in Keil forum