iret指令

IRET(interrupt return)中断返回,中断服务程序的最后一条指令。
汇编指令IRET
【指令格式】IRET
【指令功能】IRET(interrupt return)中断返回,中断服务程序的最后一条指令。IRET指令将推入堆栈的段地址和偏移地址弹出,使程序返回到原来发生中断的地方。其作用是从中断中恢复中断前的状态,具体作用有如下三点:
1.恢复IP(instruction pointer):IP←((SP)+1:(SP)),SP←SP+2
2.恢复CS(code segment):CS←((SP)+1:(SP)), SP←SP+2
3.恢复中断前的PSW(program status word),即恢复中断前的标志寄存器的状态。
FR←((SP)+1:(SP)),SP←SP+2
4.恢复ESP(返回权限发生变化)
5.恢复SS(返回权限发生变化)
以上操作按顺序进行。
【指令手册原文】
the IRET instruction pops the return instruction pointer, return code segment selector, and EFLAGS image from the stack to the EIP, CS, and EFLAGS registers, respectively, and then resumes execution of the interrupted program or procedure. If the return is to another privilege level, the IRET instruction also pops the stack pointer and SS from the stack, before resuming program execution.
IRET指令影响所有标志位。 [1]

  • 7
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值