You're right! I got rid of the C routines to call the interrupt code and just put a couple lines of ASM at the interrupt vectors that call my existing ASM routines. Variable smashing went away! By the way, this is on an 18F2610. THANKS! Harold > Harold Hallikainen wrote: >> I'm having some trouble that I THINK is due to interrupts smashing data >> in an MCC18 project with prioritized interrupts. The interrupt code is >> all written in assembly with the exception of the C code that calls it >> (below). > > That seems silly. If all the logic is in assembler, why do you need to > create a C stub to call it? Interrupt code generally needs to be > responsive, so you want to minimize cycles. At best the compiler won't > put > a lot of needless bloat in there. Interrupt entry and exit is well > understood, and the compiler isn't going to come up with some magic > optimization that the standard assembler entry/exit code doesn't already > do. > > For a ready PIC 18 interrupt template, see my QQQ_INTR18.ASPIC module at > http://www.embedinc.com/pic. You select a few things at the top with > EQUs, > and the appropriate template code gets selected. This includes a choice > of > single or high/low priority interrupts. All you have to do is insert the > actual interrupt handling code. I've used this a bunch of times. > > > ***************************************************************** > Embed Inc, embedded system specialists in Littleton Massachusetts > (978) 742-9014, http://www.embedinc.com > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- FCC Rules Updated Daily at http://www.hallikainen.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist