Motorola HC12 Refrence Manual page 150

Table of Contents

Advertisement

EXG
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:
Source Form
EXG abcdxys,abcdxys
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.
8
9
A ⇔ A
B ⇔ A
0
A ⇔ B
B ⇔ B
1
A ⇔ CCR
B ⇔ CCR
2
$00:A ⇒ TMP2
$00:B ⇒ TMP2
3
⇒ A
⇒ B
TMP2
TMP2
L
L
$00:A ⇒ D
$00:B ⇒ D
4
$00:A ⇒ X
$00:B ⇒ X
5
⇒ A
⇒ B
X
X
L
L
$00:A ⇒ Y
$00:B ⇒ Y
6
⇒ A
⇒ B
Y
Y
L
L
$00:A ⇒ SP
$00:B ⇒ SP
7
⇒ A
⇒ B
SP
SP
L
L
MOTOROLA
6-90
Exchange Register Contents
S
X
H
I
N
Address Mode
INH
A
TMP3
CCR ⇔ A
$00:A ⇒ TMP3
TMP3
CCR ⇔ B
$FF:B ⇒ TMP3
TMP3
CCR ⇔ CCR
$FF:CCR ⇒ TMP3
$00:CCR ⇒ TMP2
TMP3 ⇔ TMP2
⇒ CCR
TMP2
L
$00:CCR ⇒ D
TMP3 ⇔ D
B ⇒ CCR
$00:CCR ⇒ X
TMP3 ⇔ X
⇒ CCR
X
L
$00:CCR ⇒ Y
TMP3 ⇔ Y
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