XOR is (or was) a fast way to zero a register in assembly. For example, XOR AX,AX fills AX with 0's, because both sources are identical. This speeded the function by 1 clock or so in ancient x86 computers. Nowadays MOV AX,0x00 is as fast.