English
Language : 

MC9S12XD256MAL Datasheet, PDF (283/1348 Pages) Freescale Semiconductor, Inc – Freescale’s Scalable Controller Area Network
TFR
Chapter 6 XGATE (S12XGATEV2)
Transfer from and to Special Registers
TFR
Operation
TFR RD,CCR: CCR ⇒ RD[3:0]; 0 ⇒ RD[15:4]
TFR CCR,RD: RD[3:0] ⇒ CCR
TFR RD,PC: PC+4 ⇒ RD
Transfers the content of one RISC core register to another.
The TFR RD,PC instruction can be used to implement relative subroutine calls.
Example:
TFR
BRA
RETADDR ...
R7,PC
SUBR
;Return address (RETADDR) is stored in R7
;Relative branch to subroutine (SUBR)
SUBR
...
JAL
R7
;Jump to return address (RETADDR)
CCR Effects
TFR RD,CCR, TFR RD,PC:
NZVC
————
N: Not affected.
Z: Not affected.
V: Not affected.
C: Not affected.
TFR CCR,RS:
NZVC
∆∆∆∆
N: RS[3].
Z: RS[2].
V: RS[1].
C: RS[0].
Code and CPU Cycles
Source Form
TFR RD,CCR CCR ⇒ RD
TFR CCR,RS RS ⇒ CCR
TFR RD,PCPC+4 ⇒ RD
Address
Mode
MON
MON
MON
00000
00000
00000
Machine Code
Cycles
RD 1 1 1 1 1 0 0 0 P
RS 1 1 1 1 1 0 0 1 P
RD 1 1 1 1 1 0 1 0 P
MC9S12XDP512 Data Sheet, Rev. 2.21
Freescale Semiconductor
283