MOTOROLA
INSTRUCTION GLOSSARY
CPU12
6-90
REFERENCE MANUAL
Operation:
See table
Description:
Exchanges the contents of registers specified in the instruction as shown
below. Note that the order in which exchanges between 8-bit and 16-bit
registers are specified affects the high byte of the 16-bit registers differ-
ently. Exchanges of D with A or B are ambiguous. Cases involving TMP2
and TMP3 are reserved for Motorola use, so some assemblers may not
permit their use, but it is possible to generate these cases by using DC.B
or DC.W assembler directives.
Condition Codes and Boolean Formulas:
None affected, unless the CCR is the destination register. Condition codes
take on the value of the corresponding source bits, except that the X mask bit
cannot change from zero to one. Software can leave the X bit set, leave it
cleared, or change it from one to zero, but it can only be set by a reset or by
recognition of an XIRQ interrupt.
Addressing Modes, Machine Code, and Execution Times:
EXG
Exchange Register Contents
EXG
S
X
H
I
N
Z
V
C
–
–
–
–
–
–
–
–
Source Form
Address Mode
Object Code
1
Notes:
1. Legal coding for
eb
is summarized in the following table. Columns represent the high-order source digit. Rows
represent the low-order destination digit (bit 3 is a don’t-care). Values are in hexadecimal.
Cycles
Access Detail
EXG
abcdxys,abcdxys
INH
B7 eb
1
P
8
9
A
B
C
D
E
F
0
A
⇔
A
B
⇔
A
CCR
⇔
A
TMP3
L
⇒
A
$00:A
⇒
TMP3
B
⇒
A
A
⇒
B
X
L
⇒
A
$00:A
⇒
X
Y
L
⇒
A
$00:A
⇒
Y
SP
L
⇒
A
$00:A
⇒
SP
1
A
⇔
B
B
⇔
B
CCR
⇔
B
TMP3
L
⇒
B
$FF:B
⇒
TMP3
B
⇒
B
$FF
⇒
A
X
L
⇒
B
$FF:B
⇒
X
Y
L
⇒
B
$FF:B
⇒
Y
SP
L
⇒
B
$FF:B
⇒
SP
2
A
⇔
CCR
B
⇔
CCR
CCR
⇔
CCR
TMP3
L
⇒
CCR
$FF:CCR
⇒
TMP3
B
⇒
CCR
$FF:CCR
⇒
D
X
L
⇒
CCR
$FF:CCR
⇒
X
Y
L
⇒
CCR
$FF:CCR
⇒
Y
SP
L
⇒
CCR
$FF:CCR
⇒
SP
3
$00:A
⇒
TMP2
TMP2
L
⇒
A
$00:B
⇒
TMP2
TMP2
L
⇒
B
$00:CCR
⇒
TMP2
TMP2
L
⇒
CCR
TMP3
⇔
TMP2
D
⇔
TMP2
X
⇔
TMP2
Y
⇔
TMP2
SP
⇔
TMP2
4
$00:A
⇒
D
$00:B
⇒
D
$00:CCR
⇒
D
B
⇒
CCR
TMP3
⇔
D
D
⇔
D
X
⇔
D
Y
⇔
D
SP
⇔
D
5
$00:A
⇒
X
X
L
⇒
A
$00:B
⇒
X
X
L
⇒
B
$00:CCR
⇒
X
X
L
⇒
CCR
TMP3
⇔
X
D
⇔
X
X
⇔
X
Y
⇔
X
SP
⇔
X
6
$00:A
⇒
Y
Y
L
⇒
A
$00:B
⇒
Y
Y
L
⇒
B
$00:CCR
⇒
Y
Y
L
⇒
CCR
TMP3
⇔
Y
D
⇔
Y
X
⇔
Y
Y
⇔
Y
SP
⇔
Y
7
$00:A
⇒
SP
SP
L
⇒
A
$00:B
⇒
SP
SP
L
⇒
B
$00:CCR
⇒
SP
SP
L
⇒
CCR
TMP3
⇔
SP
D
⇔
SP
X
⇔
SP
Y
⇔
SP
SP
⇔
SP
Summary of Contents for CPU12
Page 8: ...MOTOROLA CPU12 viii REFERENCE MANUAL ...
Page 14: ...MOTOROLA INTRODUCTION CPU12 1 4 REFERENCE MANUAL ...
Page 20: ...MOTOROLA OVERVIEW CPU12 2 6 REFERENCE MANUAL ...
Page 38: ...MOTOROLA INSTRUCTION QUEUE CPU12 4 6 REFERENCE MANUAL ...
Page 300: ...MOTOROLA DEVELOPMENT AND DEBUG SUPPORT CPU12 8 16 REFERENCE MANUAL ...
Page 338: ...MOTOROLA MEMORY EXPANSION CPU12 10 8 REFERENCE MANUAL ...
Page 364: ...MOTOROLA INSTRUCTION REFERENCE CPU12 A 26 REFERENCE MANUAL ...
Page 386: ...MOTOROLA HIGH LEVEL LANGUAGE SUPPORT CPU12 C 6 REFERENCE MANUAL ...
Page 438: ...MOTOROLA SUMMARY OF CHANGES CPU12 S 2 REFERENCE MANUAL ...
Page 439: ......