If on different port, then you will spend time on transferring the data to a temp variable and do the XOR/AND on that temp byte.

Ioannis