06-22-2003, 02:20 PM
Quote:Excellent. Your example is a classic. You must be an assembly language programmer. In assembler you find your self doing this method to swap the contents of two registers without having to use another intermediate register or time-consuming stores to memory.
In a sample assembly language, to swap registers a and b, it would look like this:
Basically the same thing.Code:a xor b
b xor a
a xor b
*****
I usually use XCHG. ;*)