> Been there Learned to use sockets Was cheaper > I'm curious as to your reasoning, If you read the port as a whole would > you not still need to determine the state of the individual bit in > question.And since the port register can be manipulated like the other > registers where is the benefit in moving the values elsewhere?I mean in > this particular application of course. Tony M. > Well, if I understand the application correctly, the intent was to read the state of some switches on one port, and write that state to the other. Ie, if switches are "on", turn on the LED attached to the other port. So, if you 'match' pins (say switch one is on porta pin 1, led 1 is on portb pin 1) you can do the whole operation in only a couple of instructions. It doesn't matter what the states of the individual bits are, 'cause they are all 'tested' at the same time. If you try to set a bit that is already set (or cleared), it'll just stay in it's original state. No need to check each one, just treat them as a lump. The whole point of moving them, though, is that you have to tell the other port which pins to set or clear (to turn on or off the LED's), so you just copy one register (input port) to another register (output port) and you are done. Of course, if you want to know (have the controller know, I mean) which individual pins are on, then you'd have to do the bit test scheme presented originally. And, if you don't want to use the whole of both ports for this exercise, you can use a mask to get just the bits you want, but you still save lots of work (and program space). (not trying to tread on any toes, just throwin' in my 14 bits worth...) ;) Paul Bennett pbennett@kilby.elee.calpoly.edu