Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the equivalent of BP register ( Frame Pointer ) on ARM processors?

On intel platforms, BP is used to point to the beginning of the stack frame and to access the arguments [bp+0x??] and local variables [bp-0x??].

Which register is used in ARM? Or, is the addressing based on SP only?

[I don't have infrastructure to compile and disassemble to see it by myself. Referring to AAPCS did not help me either]

like image 818
Chethan Avatar asked Jun 07 '12 08:06

Chethan


People also ask

What is frame pointer register in ARM?

the fp stands for the frame pointer which is used as a base pointer to local variables on the stack. Although sp (stack pointer) varies according to function calls from a function, fp holds a fixed value. The relationship between the sp and the fp is a just difference of offsets for the stack.

Which register is used as stack pointer in ARM?

The processor uses full descending stacks, which means that register R13, the Stack Pointer, holds the address of the last stacked item in memory.

What is SP register in ARM?

SP is the stack register a shortcut for typing r13. LR is the link register a shortcut for r14. And PC is the program counter a shortcut for typing r15. When you perform a call, called a branch link instruction, bl, the return address is placed in r14, the link register.


1 Answers

What you are looking for is the Frame Pointer. Generally, R7 acts as the frame pointer in THUMB mode and R11 acts as the frame pointer in ARM mode. But it is under the discretion of the OS to change this convention if it wishes to.

Read here

like image 106
Pavan Manjunath Avatar answered Nov 15 '22 07:11

Pavan Manjunath