> One way to solve this is to never read the the value from the port to > the shadow register but keep the shadow register as a global variable That would be impractical if you have to monitor inputs. I'm sure that eg btfss pin / btfsc pin reads the port -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist