Hardware Reference
In-Depth Information
mnemonics are accepted for compatibility with the MC68HC11. The TAB and TBA instruc-
tions affect the N, Z, and V condition code bits. The TFR instruction does not affect the
condition code bits.
It is possible to transfer from a smaller register to a larger one or vice versa. When transfer-
ring from a smaller register to a larger one, the smaller register is signed-extended to 16-bit and
then assigned to the larger register. When transferring from a larger register to a smaller one, the
smaller register receives the value of the lower half of the larger register. For example,
tfr A,X ; A is signed-extended to 16 bits and then assigned to X
tfr X,B ; B X[7:0], B receives bits 7 to 0 of X
Exchange instructions (exg r1, r2) exchange the contents of pairs of registers or accumulators.
For example,
exg A, B
exchanges the contents of accumulator A and B.
exg D,X
exchanges the contents of double accumulator D and index register X.
The r1 register does not need to have the same size as r2. If r1 has a larger size than r2 does,
then r2 will be 0-extended to 16 bits and loaded into r1 whereas r2 will receive the lower half of r1.
For example,
exg
X,A
; X $00:[A], A X[7:0]
Transfer Instructions
Mnemonic
Function
Operation
TA B
Transfer A to B
B
[A]
TA P
Transfer A to CCR
CCR
[A]
TBA
Transfer B to A
A
[B]
TFR
Transfer register to register
A, B, CCR, D, X, Y, or SP
[A, B, CCR, D, X, Y, or SP]
TPA
Transfer CCR to A
A
[CCR]
TSX
Transfer SP to X
X
[SP]
TSY
Transfer SP to Y
Y [SP]
TXS
Transfer X to SP
SP [X]
TYS
Transfer Y to SP
SP [Y]
Exchange Instructions
Mnemonic
Function
Operation
EXG
Exchange register to register
[A, B, CCR, D, X, Y, or SP] [A, B, CCR, D, X, Y, or SP]
XGDX
Exchange D with X
[D] [X]
XGDY
Exchange D with Y
[D] [Y]
Sign Extension Instructions
Operation
Mnemonic
Function
SEX
Sign extend 8-bit operand
X, Y, or SP
[A, B, CCR]
Table 1.6 Transfer and exchange instructions
Search WWH ::




Custom Search