Ruben J=F6nsson wrote: >>>> MOVF PORTB,W >>>> MOVWF SHADOWB >>>> MOVLW B'100' >>>> IORWF SHADOWB,W >>>> MOVWF PORTB > = > Yes, there still could be problems if the interrupt is just after IORWF = > SHADOWB,W. Then changes done in the interrupt routine will be undone when= the = > non interrupt code does MOVWF PORTB. The key is, appart from using a shad= ow = > register, is to never read back from the port to the shadow register. Hmmm you are right. But I don't understand your solution? BSF shadow, 0 MOVFW shadow =3D=3D=3D> interrupt here MOWF port This sequence does not read the port, but changes made by the interrupt = would still be lost. -- = Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist