Using In-place Value Permutation in Assembly
Can be used in assembly programming to exchange the
value of two registers in place:
The In-place Value Permutation Property of the exclusive-OR:
If we do back substitution in the second and third operations,
we will find out that (assuming R1=A and R2=B initially):
Thus, if initially R1 = A and R2 = B, then after this sequence
of operations, R1 = B and R2 = A.