Besides the successive R-M-W problem highlighted by Mike Rigby-Jones, there is also the problem of bidirectional I/Os. This happens when an internal peripherla takes over the pin, or you TRIS it. Now the latch is ignored, and the pin is driven by the peripheral or the outside world. In this mode, a read-modify-write to the port will read the pin and write the latch to match the pin state. This occurs even with BCF, or BSFs to OTHER PINS in the same port becuase BCF and BSF are really byte-wide R-M-W operations. This is still not a problem, until you later set TRIS back to 0. Now, you do not know what the latch state is. In some applications, it may wish that the latch was preserved during the time that the pin was TRIS'ed. but IT ISN'T. Hence the need for the "shadow register" trick which uses a file register to save the "supposed to be" state of the latch for later use when this is a problem. Whenever you change the latch, you modify the shadow register in RAM, then copy the modified shadow register to the Port as a byte wide MOV. ------------ Barry King Engineering Manager NRG Systems "Measuring the Wind's Energy" barry@nrgsystems.com Phone: 802-482-2255 FAX: 802-482-2272