作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在海湾合作委员会 cdecl
调用约定,在调用返回后,我是否可以依赖我压入堆栈的参数相同?即使混合 ASM 和 C 并启用优化( -O2
)?
最佳答案
一句话:没有。
考虑这个代码:
__cdecl int foo(int a, int b)
{
a = 5;
b = 6;
return a + b;
}
int main()
{
return foo(1, 2);
}
movl $5, 8(%ebp)
movl $6, 12(%ebp)
movl 8(%ebp), %edx
movl 12(%ebp), %eax
addl %edx, %eax
popl %ebp
ret
关于gcc - 在 CDECL 调用约定中,我可以重用我压入堆栈的参数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38844016/
我是一名优秀的程序员,十分优秀!