mfctr
Move From Count Register
mfctr RT
Moves CTR to GPR. (Alias for 'mfspr RT, 9').
Details
The mfctr instruction moves the value from the Count Register (CTR) to a general-purpose register specified by RT.
Pseudocode Operation
RT ← CTR
Programming Note
The mfctr instruction is commonly used to retrieve the current count value from the Count Register, which is often utilized in loop control. Ensure that the destination register (RT) is properly aligned and accessible at the privilege level where this instruction is executed. This instruction does not raise exceptions under normal circumstances but should be used with caution in critical loops to avoid unintended behavior.
Example
mfctr r3
Encoding
Binary Layout
31
0
RT
6
9
11
339
21
/
31
Operands
-
RT
Target