XOR Instruction
| The instruction performs a boolean (bitwise) exclusive-OR operation between each pair of matching bits in two operands and places the result in the destination operand. The operands can be 8, 16, or 32 bits, and they must be the same size. |
|
XOR — Exclusive OR |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XORed with 0 | XORed with 1 | XORed Twice |
INCLUDE Irvine32.inc .data dummy WORD ? .code main PROC mov eax, 12345678h xor eax, 00000000h call WriteHex exit main ENDP END main |
INCLUDE Irvine32.inc .data dummy WORD ? .code main PROC mov eax, 12345678h xor eax, 0FFFFFFFFh call WriteHex exit main ENDP END main |
INCLUDE Irvine32.inc .data dummy WORD ? .code main PROC mov eax, 0 mov al, 00111010b mov ch, 10100011b xor al, ch xor al, ch call WriteHex exit main ENDP END main |
| Output | Output | Output |
|
“I was in my car driving back from work. A police officer pulled me over and knocked on my window. I said, ‘One minute I’m on the phone.’” ― Alan Carr |