gpt4 book ai didi

arm - ARM 中临时寄存器的用例是什么?

转载 作者:行者123 更新时间:2023-12-05 08:38:24 28 4
gpt4 key购买 nike

为什么我们在 ARM 架构中有暂存寄存器?处理器如何使用它,我的意思是这个寄存器的用途是什么?

最佳答案

来自 Procedure Call Standard for the Arm Architecture :

Scratch register / temporary register A register used to hold an intermediate value during a calculation (usually, such values are not named in the program source and have a limited lifetime).

如果您调用函数,临时寄存器中的值可能在函数调用后已更改。因此,函数的调用者必须确保保存这些值(如果仍然需要)。与被调用者安全寄存器相反,它们也称为调用者安全寄存器。这些由调用的函数保存。因此,如果必须临时存储值,则首先使用临时寄存器,因为它们不必事先保存。

关于arm - ARM 中临时寄存器的用例是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62840714/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com