Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Steve M. Taylor
12/29/05 04:33
Read: 551 times
State College

#106145 - Does it help ?
Responding to: Marshall Brown's previous message
Marshall Brown said:
Found this on the web and thought it might be good for the For the "wow that's a cool idea file"

For swapping 2 variables with no temporary variable, no doubt just as easy to implement in asm once you have thought of the idea.

one ^= two;
two ^= one;
one ^= two;

Come off it ! How do you implement pointer code in less space than using an intermediate variable, or the stack ?


List of 8 messages in thread
Swapping 2 variables without a temp.      Marshall Brown      12/29/05 01:14      
   Does it help ?      Steve M. Taylor      12/29/05 04:33      
   what aboyt SWAP, it is ONE instruction      Erik Malund      12/29/05 06:48      
      I think you meant XCH      Hal Albach      12/29/05 07:50      
         I did, stupid me      Erik Malund      12/29/05 08:35      
            Sorry      Marshall Brown      12/29/05 13:02      
               Pointers      Andy Neil      12/29/05 13:22      
                  Call me      Steve M. Taylor      12/29/05 14:02      

Back to Subject List