Thread: Perl & such..
View Single Post
  #14  
Old 07-26-01, 02:21 PM
Cutriss's Avatar
Cutriss Cutriss is offline
Dancing Hero
 
Join Date: Feb 2001
Location: Over there
Posts: 1,163
Cutriss is off the scale
Default

Quote:
Originally posted by Tom
btw, i got a little assembly question for ya... how do you swap 2 memory spaces without using any extra storage?
Umm...you mean without writing to any extra memory, or without using any registers to do it? And I'm sure whatever method of doing it probably just involves using the registers to move the data anyway. You could just move it a word at a time, holding the swap value in AX, the current position/offset of each location in BX and DX, and then use CX as a counter to go as long as you need it.
__________________
"And knowing is half the battle!"
Reply With Quote