Chapter 9 XGATE (S12XGATEV2)
MC9S12XDP512 Data Sheet, Rev. 2.11
474 Freescale Semiconductor
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 R7,PC ;Return address (RETADDR) is stored in R7
BRA SUBR ;Relative branch to subroutine (SUBR)
RETADDR ...
SUBR ...
JAL R7 ;Jump to return address (RETADDR)
CCR Effects
Code and CPU Cycles
TFR
Transfer from and to Special Registers
TFR
Source Form
Address
Mode
Machine Code Cycles
TFR RD,CCR CCR ⇒ RD MON 00000 RD 11111000 P
TFR CCR,RS RS ⇒ CCR MON 00000 RS 11111001 P
TFR RD,PC PC+4 ⇒ RD MON 00000 RD 11111010 P
TFR RD,CCR, TFR RD,PC: TFR CCR,RS:
NZVC
————
N: Not affected.
Z: Not affected.
V: Not affected.
C: Not affected.
NZVC
∆∆∆∆
N: RS[3].
Z: RS[2].
V: RS[1].
C: RS[0].