Detailed description of the iret command

Source: Internet
Author: User

Copy From http://lion3875.blog.51cto.com/2911026/532347

When the iret command is used to return tasks at the same protection level, the iret will pop up from the stackCodeSegment Selection Sub-and command pointer respectively to CS and IP register, and pop up the mark register content to the eflags register.

When the iret command is used to return a different protection level, the iret will not only pop up the above content from the stack, but also pop up the stack segment Selection Sub-and stack pointer to the SS and SP registers respectively.

The IA-32 instruction manual describes this very clearly, as in the original article:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.