>> MOVF PORTB,W >> MOVWF SHADOWB >> MOVLW B'100' >> IORWF SHADOWB,W >> MOVWF PORTB >> > > One thing to watch out for here is interrupts. If you write to another pin in > port B in the interrupt routine, a bit banged serial output for example, you > have to make sure that the interrupt routine isn't executed between when you > read the content of the port to the shadow register until you write it back. > Otherwise the change made by the interrupt routine will be undone when you > write back the shadow register. Good programming practice would dictate that the interrupt routine also uses the shadow, so there would be no problem. -- 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