Friday, June 15, 2007

ARM: Core : Registers



Registers are R0 to R15
Each is 32 bits wide

R0 to R12 are user registers

R13 to R15 are special
R13: stack pointer register(SP)
R14:Link register(LR)
R15:Program Counter(PC)

When a call is made to a function the return address is automatically stored in the link register and is immediately available on return from the function. This allows quick entry and return into a 'leaf’ function (a function that is not going to call further functions). If the function is part of a branch (i.e. it is going to call other functions) then the link register must be preserved on the stack (R13).

No comments: