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]
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