您的位置:首页 > 其它

How to use the function of assembly.

2016-10-14 21:23 991 查看
Here are some simple conceptions that I summarized:

              1, %rsp    -----  top of the stack

    2, %rbp    -----  base address

              3, The stack of function is upside down

                   So when we push a value, %rsp sub

      4, We push parameters before we call a function. So the values of parameters are above the %rbp(base address).

                                                                And the values of local variables are under the %rbp.

              5, We must save the former base address before calling a new function.Because maybe we are calling a function from another function. the Nested Functions.

         6, after saving the value of former base address, the new base address should be pointed to the %rsp(top of the stack).

 






 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  assembly 底层内功