Go to My Blog
Go to Lin's Blog

x86/x64的stack*****************************TBD

1.push parameter, 

  • %rdi,%rsi,%rdx,%rcx,%r8,%r9 用作函数参数,依次对应第1参数,第2参数。。。

2. push return address

3. push ebp,(current stack frame's base pointer)

jump to the caller.

4. push local variable.

5. sub esp to pre-allocate stack resource instead of push later.

其实stack frame上不止存放parameter->return address->ebp->local variable, compile还会根据便利挪作他用。

To be explain:他用。 

http://www.searchtb.com/2013/03/x86-64_register_and_function_frame.html

posted @ 2013-10-12 13:50  一ke小小草  阅读(237)  评论(0编辑  收藏  举报