quote:Original post by Anonymous Poster
USING A TEMP VARIABLE IS SLOWER THAN THE XOR THING...the xor intruction is only one cycle when done with the registers...the temp variable thing causes at least three instruction performed in memory which is avtually about 3cycles
If you''re doing it with registers why wouldn''t you use xchg? The XOR trick was because some older CPU''s didn''t have xchg, and they needed a quick way to swap registers. How can you be sure you''re data is always in registers anyway? Your compiler will figure it out and implement the swap in the quickest way possible according to the situation, so you just use the temporary variable.
[Resist Windows XP''s Invasive Production Activation Technology!]