I don’t know who originated this trick.  I first read about in in P.J. Plauger’s “Programming on Purpose”.  It was probably first used by assembly language programmer’s when 4-bit systems were common and memory was paltry.  Still, it can be handy in a tight loop even on a relative fast processor.

Continue reading “Fast Exchange” »