正在加载图片...
Problem 4.5(P270) int poptesto int rval / Insert the following assembly code pushl tval #t save tval on stack movl %esp, %edx #f save stack pointer popl %esp t pop to stack pointer movl %oesp, rval setI movl %edx, %esp( It implies that popl %esp set the stack pointer to the value read from memory return rval mrmovl o(%esp). loess We find this function always returns tval the value passed to it as its argument. What does this imply about the behavior of pop es other y86 ins c tion would have th behavior 2021/10/29Problem 4.5 (P270) int poptest() { int rval; /* Insert the following assembly code: pushl tval # save tval on stack movl %esp, %edx # save stack pointer popl %esp # pop to stack pointer movl %esp, rval # set popped value as return value movl %edx, %esp # restore original stack pointer */ … return rval; } We find this function always returns tval, the value passed to it as its argument. What does this imply about the behavior of popl %esp ? What other Y86 instruction would have the exact same behavior? 2021/10/29 10 It implies that popl %esp set the stack pointer to the value read from memory. mrmovl 0(%esp), %esp
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有