On Thu, Mar 10, 2011 at 11:04 AM, Olin Lathrop wrote: > Josh Koffman wrote: >> For WREG, on entry I execute a >> "MOVWF =A0 =A0 W_Temp", and on exit "MOVF =A0 =A0 W_Temp, W". > > That will trash some status bits. > > I don't get it. =A0Interrupt save/restore is a well-invented wheel.= =A0Why > do people keep trying to create their own code, especially when they don'= t > know what they're doing enough to get it right!? Actually, I didn't invent it. It's come from numerous examples online and in the datasheets. In this case, it's datasheet 39689f.pdf, page 109, example 10-1. I didn't copy and paste the entire routing the first time because I didn't think it was relevant. Evidently I was incorrect. Here it is: Interrupt movwf W_Temp ; Save context during low interrup= t movff STATUS, STATUS_Temp =09 movff BSR, BSR_Temp =09 movff BSR_Temp, BSR ; Restore context saved above movf W_Temp, W movff STATUS_Temp, STATUS RETFIE Josh --=20 A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. =A0 =A0 =A0 =A0 -Douglas Adams --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .