码迷,mamicode.com
首页 > 其他好文 > 详细

How to use the function of assembly.

时间:2016-10-07 13:29:02      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

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).

 技术分享

技术分享

技术分享

 

How to use the function of assembly.

标签:

原文地址:http://www.cnblogs.com/rixiang/p/5935701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!