XOR(r1,r2) :- Microporcessor perform exclusive xor operation between r1 and r2 and store the result in r1.
Lets take an example, suppose r1 contains 1010 ( i.e 10 in decimal) and r2 contains 0110 ( i.e 6 in decimal )
Instructions are
XOR( r2, r1 ) :- XOR will happen between r2 and r1 and result will store in r2, 0110 XOR 1010 = 1100, so after this operation r1 contain 1010 and r2 contain 1100.
XOR (r1, r2 ) :- Similarly after this operation r1 contain 0110 and r2 contain 1100
XOR (r2, r1 ) :- Similarly after this operation r2 contains 1010 ( i.e 10 in decimal ) and r1 contains 0110 ( i.e 6 in decimal)
We can observe that, values of r1 and r2 get swapped after execution of these 3 instruction. Infact, its one of the way we swap two value using XOR operation.
None of the options are matching.