R14 is also known as the subroutine Connection register (subroutine link register) or the connection register LR. When executing the BL subroutine call instruction, a backup of R15 (program counter PC) is obtained in R14.
In other cases, the R14 is used as the general register. Similarly, when an interrupt or an exception occurs, the corresponding packet registers r14_svc, R14_IRQ, R14_fiq, R14_abt, and R14_und are used to hold the return value of the R15.
Register R14 are commonly used in the following situations:
In each mode of operation, R14 can be used to save the return address of the subroutine (that is, R15 pc), when using the BL or BLX instructions to call the subroutine, the current value of the PC copy to R14, after executing the subroutine, and then copy the value of the R14 back to the PC, you can complete the subroutine call back. The above description can be completed with the instructions:
1. Execute any one of the following instructions:
MOV PC,LR
BX LR
2, at the entrance of the subroutine, use the following instruction to deposit R14 to the stack:
STMFD sp! , {<REGS>,LR}
Corresponding, use the following command to complete the subroutine return:
LDMFD sp! , {<regs>,pc}
R14 can also be used as a general-purpose register.
As the ARM architecture uses a multistage pipelining technology, for ARM instruction sets, the PC always points to the address of the next two instructions of the current instruction, that is, the value of the PC is the address value of the current instruction plus 8 bytes.
(reproduced) R14 also known as subroutine Connection register