> >I won't actually need > >to save/restore PCLATH in the ISR. > > Not a good idea, as you will surely alter the ISR at some stage and break > your whole project, not just the ISR :) > > For the four instructions and one data ram location it takes, it is not > worth the trouble of dealing with later problems that seem unrelated to a > code change you make. I agree with both statements. Pic Dude is right in that if you're running on a 2K machine, you do not need to save/restore PCLATH. On the other hand, Allan also has a valid point. But there is an ever better way. See my QQQ_INTR.ASPIC template interrupt module at http://www.embedinc.com/pic/. The STD_DEF.INS.ASPIC include file checks which processor the code will run on, and sets the NCODEPAGES assembler constant. The interrupt routine code checks the NCODEPAGES assembler value and creates the code to save/restore PCLATH only if the machine has more than one code page. Pretty cool, eh? ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics