Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z

Vol. 2B 4-411
INSTRUCTION SET REFERENCE, N-Z
XOR—Logical Exclusive OR
Description
Performs a bitwise exclusive OR (XOR) operation on the destination (first) and source
(second) operands and stores the result in the destination operand location. The
source operand can be an immediate, a register, or a memory location; the destina-
tion operand can be a register or a memory location. (However, two memory oper-
ands cannot be used in one instruction.) Each bit of the result is 1 if the
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
34 ib XOR AL, imm8 Valid Valid AL XOR imm8.
35 iw XOR AX, imm16 Valid Valid AX XOR imm16.
35 id XOR EAX, imm32 Valid Valid EAX XOR imm32.
REX.W + 35 id XOR RAX, imm32 Valid N.E. RAX XOR imm32 (sign-
extended).
80 /6 ib XOR r/m8, imm8 Valid Valid r/m8 XOR imm8.
REX + 80 /6 ib XOR r/m8*, imm8 Valid N.E. r/m8 XOR imm8.
81 /6 iw XOR r/m16, imm16 Valid Valid r/m16 XOR imm16.
81 /6 id XOR r/m32, imm32 Valid Valid r/m32 XOR imm32.
REX.W + 81 /6 id XOR r/m64, imm32 Valid N.E. r/m64 XOR imm32 (sign-
extended).
83 /6 ib XOR r/m16, imm8 Valid Valid r/m16 XOR imm8 (sign-
extended).
83 /6 ib XOR r/m32, imm8 Valid Valid r/m32 XOR imm8 (sign-
extended).
REX.W + 83 /6 ib XOR r/m64, imm8
Valid N.E. r/m64 XOR imm8 (sign-
extended).
30 /r XOR r/m8, r8 Valid Valid r/m8 XOR r8.
REX + 30 /r XOR r/m8*, r8* Valid N.E. r/m8 XOR r8.
31 /r XOR r/m16, r16 Valid Valid r/m16 XOR r16.
31 /r XOR r/m32, r32 Valid Valid r/m32 XOR r32.
REX.W + 31 /r XOR r/m64, r64 Valid N.E. r/m64 XOR r64.
32 /r XOR r8, r/m8 Valid Valid r8 XOR r/m8.
REX + 32 /r XOR r8*, r/m8* Valid N.E. r8 XOR r/m8.
33 /r XOR r16, r/m16 Valid Valid r16 XOR r/m16.
33 /r XOR r32, r/m32 Valid Valid r32 XOR r/m32.
REX.W + 33 /r XOR r64, r/m64 Valid N.E. r64 XOR r/m64.
NOTES:
* In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix
is used: AH, BH, CH, DH.