正在加载图片...
Here is what typically happens when we call a function Before a function call,the calling routine: 1)saves any necessary registers During a function call,the target 2)pushes the arguments onto the routine: stack for the target call 1)saves any necessary registers 3)set up the static link (if 2)sets up the new frame pointer appropriate) 3)makes space for any local 4)pushes the return address onto variables the stack 4)does its work 5)jumps to the target After a function call,the calling 5)tears down frame pointer and routine: static link 1)removes return address and 7)restores any saved registers parameters from the stack 8)jumps to saved return address 2)restores any saved registers 3)continues executingHere is what typically happens when we call a function Before a function call, the calling routine: 1) saves any necessary registers 2) pushes the arguments onto the stack for the target call 3) set up the static link (if appropriate) 4) pushes the return address onto the stack 5) jumps to the target After a function call, the calling routine: 1) removes return address and parameters from the stack 2) restores any saved registers 3) continues executing During a function call, the target routine: 1) saves any necessary registers 2) sets up the new frame pointer 3) makes space for any local variables 4) does its work 5) tears down frame pointer and static link 7) restores any saved registers 8) jumps to saved return address
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有