Why does first parameter in x86 assembly starts from offset 8?

不想你离开。 提交于 2019-12-01 18:45:14

The "missing" DWORD is the return address. The call stack looks like:

ebp     : saved ebp
ebp + 4 : return address
ebp + 8 : pushed parameter

And then if the function uses local variables, since stack space is (typically) reserved for those after the stack frame, they are referenced as ebp - xx:

ebp - 8 : second local
ebp - 4 : first local
ebp     : saved ebp
ebp + 4 : return address
ebp + 8 : pushed parameter
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!