mtctr
Move To Count Register
Moves GPR to CTR. (Alias for 'mtspr 9, RS').
Details
The Move To Condition Register Fields instruction moves specified fields from a general-purpose register to the condition register. The preferred form of this instruction sets exactly one bit in the FXM field.
Pseudocode Operation
CTR ← RS
Programming Note
The mtctr instruction is commonly used to set up loop counters by moving values from a general-purpose register into the Count Register (CTR). Ensure that the source register contains the correct value for the desired loop iterations. This instruction operates at user privilege level and does not generate exceptions under normal conditions, but incorrect usage can lead to infinite loops if not managed properly.
Example
Encoding
Operands
-
RS
Source