该问题与Assembly x86-32 RET n指令有关 [英] The question is related to Assembly x86-32 RET n instruction

查看:15
本文介绍了该问题与Assembly x86-32 RET n指令有关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 Ret n 的含义,但我不知道它在维护程序的运行时堆栈中的作用?我有点困惑.ret 与堆栈有关吗?

I know the meaning of Ret n but I can't figure out its role to maintaining program's runtime stack? I'm kind of confuse there. Do ret have somethig to do with stack?

推荐答案

ret n 就像 ret + add esp, n.您可以将它用于 caller-pops 调用约定.

ret n is like ret + add esp, n. You use it for caller-pops calling conventions.

普通的 ret 类似于 pop eip.(pop eip 不是有效指令,但它很好地表达了 ret 的作用).是的,它使用堆栈;阅读文档.http://felixcloutier.com/x86/RET.html(特别是接近回报"部分.)

Plain ret is like pop eip. (pop eip isn't a valid instruction, but it nicely expresses what ret does). Yes it uses the stack; read the documentation. http://felixcloutier.com/x86/RET.html (specifically the "near return" part.)

far ret"更复杂,但不用于具有平面内存模型的 32 位或 64 位代码.即在普通代码中根本不使用.

"far ret" is more complicated, but not used in 32 or 64-bit code with a flat memory model. i.e. not used at all in normal code.

这篇关于该问题与Assembly x86-32 RET n指令有关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆