jit1
asked on
with using temp
give two functions to swap variables without using temp variables
Look like a homework. But in Assembler: load 2-nd to registre,
move 1-st to 2-nd, save from registe to 1-st.
In C: save 2-nd to disk, move 1-st to 2-nd, read from disk to 1-st.
move 1-st to 2-nd, save from registe to 1-st.
In C: save 2-nd to disk, move 1-st to 2-nd, read from disk to 1-st.
XOR algorithm, a sequence of XORs let's you swap variables with a temp in disk or memory
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use inline assembly
asm {
push Variable_A
push Variable_B
pop Variable_A
pop Variable_B
}
asm {
push Variable_A
push Variable_B
pop Variable_A
pop Variable_B
}
ASKER