gcc - IA-32 x86 Assembly function definition convention? -


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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -