gpt4 book ai didi

MIPS $gp 寄存器

转载 作者:行者123 更新时间:2023-12-04 12:25:24 35 4
gpt4 key购买 nike

使用 $gp 是否存在危险?注册以存储值?我想我的问题是 $gp 的真正功能是什么?它是否以某种方式在幕后调用,以便如果我使用它,事情可能会变得非常非常错误?

最佳答案

那么,$gp register 指向全局区域。 Convention表示您应该在编写函数时存储它(请参阅 .cprestore)。

如果您需要使用它(老实说,不明白为什么),请记住以下几点:

1)Always store it in the Saved Register Area of your stack.

2)Always load that value into the $gp when destroying the stack.

3) Dont use it. (i.e dont access global scope)



另外,我不确定,但您可以忘记 PIC 代码。

关于MIPS $gp 寄存器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2618790/

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