Understanding XOR: it's just a diff
biesnecker.com
biesnecker.com
Also note that XOR is associative -- that's the key to prove the XOR swapping...
For those who are interested in binary tricks, there are several good resources:
* HAKMEM, http://goo.gl/F6sBjt
* Hacker's Delight, http://goo.gl/llQumw
The book itself is very thin; but the content is incredibly rich...