XCHG
EXCHANGE
XCHG
Encoding:
Memory or Register
Operand
with
Register Operand:
11000011
w 1 mod reg rIm 1
SRC = EA, DEST = REG
Register Operand with Accumulator:
1 1
001
0 reg 1
SRC = REG, DEST = AX
XCHG
Operands
Clocks*
Transfers
Bytes
accumulator, reg16
3
-
1
memory,
register
17(25)
+
EA
2
2-4
register,
register
4
-
2
XCHG Coding
Example
XCHG AX,
BX
XCHG SEMAPHORE, AX
XCHG AL, BL
*b(w):
where
b
denotes
the
number
of
clock
cycles
for
byte
operands
and
w
denotes
the
number
of
clock
cycles for word operands.
2-162