加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

汇编 – iret和iretd之间的区别是什么?

发布时间:2020-12-14 01:18:09 所属栏目:Linux 来源:网络整理
导读:我想模拟 Linux x86_64服务器上的iret条件. 我发现有三条指令 iret:操作数大小16 iretd:操作数大小32 iretq:操作数大小为64 我无法区分它们,以及使用哪一个. 谢谢任何人的帮助!! 我有另外一个关于模拟iret的问题,你能看看吗?http://stackoverflow.com/q
我想模拟 Linux x86_64服务器上的iret条件.
我发现有三条指令

> iret:操作数大小16
> iretd:操作数大小32
> iretq:操作数大小为64

我无法区分它们,以及使用哪一个.
谢谢任何人的帮助!!

我有另外一个关于模拟iret的问题,你能看看吗?http://stackoverflow.com/questions/11756274/how-to-simulate-a-iret-on-linux-x86-64

解决方法

从这 link:

IRET returns from an interrupt (hardware or software) by means of
popping IP (or EIP),CS,and the flags off the stack and then
continuing execution from the new CS:IP.

IRETW pops IP,CS and the flags as 2 bytes each,taking 6 bytes off
the stack in total. IRETD pops EIP as 4 bytes,pops a further 4 bytes
of which the top two are discarded and the bottom two go into CS,and
pops the flags as 4 bytes as well,taking 12 bytes off the stack.

IRET is a shorthand for either IRETW or IRETD,depending on the
default BITS setting at the time.

与IRETQ非常相似

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读