
Instruction Set
4-251
XOR
Logical Exclusive OR
XOR
What It Does
XOR complements particular bits of a component according to a mask.
Syntax
Description
XOR computes the exclusive OR of the two operands. If corresponding bits of the operands
are different, the resulting bit is 1. If the bits are the same, the result is 0. The answer
replaces the first operand.
Operation It Performs
Flag Settings After Instruction
Form
Opcode
Description
Clocks
Am186 Am188
XOR AL,
imm8
34
ib
XOR immediate byte with AL
3
3
XOR AX,
imm16
35
iw
XOR immediate word with AX
4
4
XOR
r/m8,imm8
80
/6 ib
XOR immediate byte with r/m byte
4/16
4/16
XOR
r/m16,imm16
81
/6 iw
XOR immediate word with r/m word
4/16
4/20
XOR
r/m16,imm8
83
/6 ib
XOR sign-extended immediate byte with r/m word
4/16
4/20
XOR
r/m8,r8
30
/r
XOR byte register with r/m byte
3/10
3/10
XOR
r/m16,r16
31
/r
XOR word register with r/m word
3/10
3/14
XOR
r8,r/m8
32
/r
XOR r/m byte with byte register
3/10
3/10
XOR
r16,r/m16
33
/r
XOR r/m word with word register
3/10
3/14
XOR
component,mask
/* XOR component with mask */
component = component ^ mask;
/* clear overflow and carry flags */
OF = CF = 0;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
SF=1 if result is 0 or positive
SF=0 if result is negative
ZF=1 if result equal to 0
ZF=0 if result not equal to 0
PF=1 if low byte of result has even number of set bits
PF=0 otherwise
0
–
–
–
res ? res
res 0
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...