Details about the eflags register

Source: Internet
Author: User

This section describes the eflags register. It is an Intel instruction set reference for quick reference.

 

The 32-bit eflags register contains a group of Status flags, a control flag, and a group of system flags. figure 3-8 defines the flags within this register. following initialization of the processor (either by asserting the reset pin or the init pin), the state of the eflags register is 00000002 H. bits 1, 3, 5, 15, and 22 through 31 of this register are reserved. software shocould not use or depend on the states of any of these bits.

Some of the flags in the eflags register can be modified directly, using specialpurpose instructions (described in the following sections). There are no instructions that allow the whole register to be examined or modifily.

The following instructions can be used to move groups of flags to and from the procedure stack or the eax register: lahf, sahf, pushf, pushfd, popf, and popfd. after the contents of the eflags Register have been transferred to the procedure stack or eax register, the flags can be examined and modified using the processor's bit manipulation instructions (BT, BTS, BTR, and BTC ).

When suspending a task (using the processor's multitasking facilities), the processor automatically saves the state of the eflags register in the task state segment (TSS) for the task being suincluded. when binding itself to a new task, the processor loads the eflags register with data from the new task's TSS.

When a call is made to an interrupt or exception handler procedure, the processor automatically saves the state of the eflags registers on the procedure stack. when an interrupt or exception is handled with a task switch, the state of the eflags register is saved in the TSS for the task being suspended.

 

 

As the IA-32 architecture has evolved, flags have been added to the eflags register, but the function and placement of existing flags have remained the same from one family of the IA-32 processors to the next. as a result, code that accesses or modifies these flags for a family of IA-32 processors works as expected when run on later families of processors.

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.