IA-32 x86汇编函数定义约定?

时间:2017-04-14 14:26:54

标签: gcc assembly x86

为什么我们总是这样做

 pushl  %ebp          # save the old base pointer
 movl   %esp, %ebp    # set ebp to the current esp
 movl %ebp, %esp
 popl %ebp

^这个,在汇编中定义函数时?

下面是我的一些代码的翻译,没有用于访问变量的推送和弹出以及esp寄存器。

asm(
    "_calculateA:;"
    "   movl 8(%esp), %eax;"
    "   andl 4(%esp), %eax;"
    "   ret;"
    );

它更短,工作正常,那么这笔交易是什么?

0 个答案:

没有答案