mflr

Move From Link Register

mflr RT

Moves LR to GPR. (Alias for 'mfspr RT, 8').

Details

The mflr instruction moves the value from the Link Register (LR) into a general-purpose register specified by the RT field. The Link Register is used to store the address of the instruction following the branch or call.

Pseudocode 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.

Example

mflr r3

Encoding

Binary Layout
31
0
RT
6
8
11
339
21
/
31
 
Format XFX-form
Opcode 0x7C0802A6
Extension Base
Registers Altered LR

Operands

  • RT
    Target