Link register

From SEGGER Knowledge Base
Jump to navigation Jump to search

The Link register is a register which can hold the return address when calling a subroutine. The term link register is mostly used in the ARM world, in other architectures it is called RA (return address).

Basically a call instruction:

   BL  Sub      // LR = PC, PC = &Sub

and a return instruction

   BX LR        // PC = LR

work together as a team.