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
 
Format XFX-form
Opcode 0x7C0802A6
Extension Base

Operands

  • RT
    Target

Example

mflr r3

Registers Altered

LR

Related

More in Base

Reference

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.