mflr
Move From Link Register
mflr RT
Moves LR to GPR. (Alias for 'mfspr RT, 8').
Encoding
Binary Layout
31
0:5
RT
6:10
8
11:20
339
21:30
/
31
Operands
-
RT
Target
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Moves the Link Register (LR) to a general-purpose register. This is an alias for mfspr RT, 8 and is commonly used to save the return address before modifying LR. No status registers are affected.
Operation
RT ← LR
Programming Note
Use mflr to save the return address before making a function call, ensuring you can return correctly afterward. Ensure the target register (RT) is not reserved and is properly aligned for your architecture.