无用的存储和加载

时间:2013-11-25 16:23:37

标签: assembly arm

在编译程序中,我遇到了以下说明:

890c:       e50b0008        str     r0, [fp, #-8]
8910:       e50b100c        str     r1, [fp, #-12]
8914:       e51b0008        ldr     r0, [fp, #-8]
8918:       e51b100c        ldr     r1, [fp, #-12]

最后2 ldr有什么意义?

2 个答案:

答案 0 :(得分:4)

编译器在未完全优化时会发出这些内容。像

这样的行
a = 0;
return a;

编译进行调试时,看起来有点像。

Re:评论:在这种情况下,它很可能是一个呼叫序列

a = something; //compiler: calculate in register, write out to memory
b = something_else; //compiler: calculate in register, write out to memory
Func(a, b); //compiler: pick up from memory, branch and link to the function

答案 1 :(得分:0)

另一种可能性是程序正在修改存储器映射的I / O寄存器。

相关问题