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

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -