XOR is an instruction and is useful even in today's 32-bit Intel Assembly Language.
In general v = x XOR x will always result in x = 0.
Therefore in Intel land, doing the following:
MOV AX, 7 ; assign 7 to the AX register
XOR AX, AX ; will clear the AX register (assign 0 to it)
MOV AX, 0 ; does the same as above, but is less efficient in clock cycles
And, although it is less efficient to do this than to use a temp register to do a swap.
Consider the following:
MOV AX, 5 ; assign 5 (101) to the AX register
MOV BX, 3 ; assign 3 (011) to the BX register
XOR AX, BX ; assign 6 (110) to the AX register, BX is still set to 3 (011)
XOR BX, AX ; assign 5 (101) to the BX register, AX is still set to 6 (110)
XOR AX, BX ; assign 3 (011) to the AX register, BX is still set to 5 (101)
So you started by setting AX = 5 and BX = 3 and after executing the XOR instructions you have essentially swapped AX and BX register values so that AX = 3 and BX = 5 and you didn't use any memory more than the two registers to do so. This is not efficient in clock cycles, but extremely useful when space is severely limited.
Bill T.