6

I've seen an annotation for pushing/popping multiple registers in the same line, e.g:

push    {fp, lr}

I couldn't find out who is pushed first - fp or lr?

An additional question - does SP point to the last occupied address in the stack or the first free one?

4

1 回答 1

3

从 ARM ARM:

寄存器按顺序存储,编号最小的寄存器到最低的内存地址(start_address),一直到编号最高的寄存器到最高的内存地址(end_address)

在 ARM 上,堆栈指针通常指向堆栈上最后占用的地址。例如,在设置初始堆栈指针时,通常使用堆栈末尾之后的地址进行初始化。

PUSH只是用作基址寄存器STMDB的同义词。sp表示“DB递减前”寻址模式。

于 2013-07-20T16:57:00.110 回答