mfctr
Move From Count Register
Moves CTR to GPR. (Alias for 'mfspr RT, 9').
Details
Moves the Count Register (CTR) to a general-purpose register. This is an alias for mfspr RT, 9 and is commonly used to save the loop counter or retrieve branching information. No status registers are affected.
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
Encoding
Operands
-
RT
Target