且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Printf 更改寄存器中的值,ARM 汇编

更新时间:2022-05-11 02:49:05

ARM ABI 指定寄存器 r0-r3 和 r12 在函数调用中被视为 volatile.这意味着被调用者不必恢复它们的值.如果使用 bl,LR 也会发生变化,因为 LR 将包含被调用函数的返回地址.

The ARM ABI specifies that registers r0-r3 and r12 are to be considered volatile on function calls. Meaning that the callee does not have to restore their value. LR also changes if you use bl, because LR will then contain the return address for the called function.

更多信息可以在 ABI 或在 APCS(ARM 过程调用标准)文档.

More information can be found on ARMs Information Center entry for the ABI or in the APCS (ARM Procedure Call Standard) document.