gcc - IA-32 x86 Assembly function definition convention? -
this question has answer here:
why
 pushl  %ebp          # save old base pointer  movl   %esp, %ebp    # set ebp current esp  movl %ebp, %esp  popl %ebp ^this, when defining functions in assembly?
below translation of code without pushes , pops , esp register used access variables.
asm(     "_calculatea:;"     "   movl 8(%esp), %eax;"     "   andl 4(%esp), %eax;"     "   ret;"     ); it shorter , works fine, what's deal?
 
 
  
Comments
Post a Comment