I agree. I have assembly routines that are much less also but it seems the compiler is saving a slew of variables automatically. The programs structure is very complex and includes a real time operating system designed for this product. The interrupt structure is also very complex but strings everything together. The code bloat is not as large as expected but the context save is a lot bigger than I thought. I am wondering if it is related to the compilers internal library usage (math functions etc). Larry At 01:25 PM 4/2/02 -0500, you wrote: > > One of my clients has a problem with the context saves taking too long in > > his interrupt routine. He has moved the ISR to the end of the file and > > wants advice on how to pare it down further. He has a very complex system > > that is doing real time control but the 80 cycles to get into his >interrupt > > is very problematic. When we decided on C instead of ASSY we did not > > consider this and I need to know if we are working into a situation >without > > a solution. > >80 cycles is rediculous! I just looked at my standard interrupt template >and it will take 22 cycles to get into and out of a full featured interrupt >(FSR and PCLATH saved/restored). That doesn't include doing any real >interrupt work but does take into account that STATUS is unknown when >jumping to the interrupt exit code. > >80 cycles is just waaaaay out of line. It shows once again that on small >resource limited systems compilers are for high level tasks or low level >programmers. The obvious answer is to write the interrupt routine in >assembler, duh! Anyone writing code for tiny systems like PICs should know >the instruction set and be able to write assembler, even if using a compiler >for the majority of the project. If you're scared of assembler go write GUI >apps in visual basic and forget you ever heard about PICs, or practice >saying "Do you want fries with that?". If you want to see how it's done in >assembler, check out my template interrupt module at >http://www.embedinc.com/pic. > > >***************************************************************** >Embed Inc, embedded system specialists in Littleton Massachusetts >(978) 742-9014, http://www.embedinc.com > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads Larry G. Nelson Sr. mailto:L.Nelson@ieee.org http://www.ultranet.com/~nr -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads