وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

SYSENTER

SYSENTER 

Usage: SYSENTER                                      Modifies flags: None

Fast call to privilege level 0 system procedures. 

Fast System Call


SYSENTER                      ; 0F 34                [P6]


SYSENTER executes a fast call to a level 0 system procedure or routine. Prior to executing the SYSENTER instruction, software must specify the privilege level 0 code. This instruction is a companion instruction to the SYSEXIT instruction. 


Before using this instruction, various MSRs need to be set up:


SYSENTER_CS_MSR contains the 32-bit segment selector for the privilege level 0 code segment. (This value is also used to compute the segment selector of the privilege level 0 stack segment.)


SYSENTER_EIP_MSR contains the 32-bit offset into the privilege level 0 code segment to the first instruction of the selected operating procedure or routine.


SYSENTER_ESP_MSR contains the 32-bit stack pointer for the privilege level 0 stack.


SYSENTER performs the following sequence of operations:


Loads the segment selector from the SYSENTER_CS_MSR into the CS register.


Loads the instruction pointer from the SYSENTER_EIP_MSR into the EIP register.


Adds 8 to the value in SYSENTER_CS_MSR and loads it into the SS register.


Loads the stack pointer from the SYSENTER_ESP_MSR into the ESP register.


      MSR                         Address

SYSENTER_CS_MSR      174H

SYSENTER_ESP_MSR    175H

SYSENTER_EIP_MSR     176H


Switches to privilege level 0.


Clears the VM flag in the EFLAGS register, if the flag is set.


Begins executing the selected system procedure.


In particular, note that this instruction des not save the values of CS or (E)IP. If you need to return to the calling code, you need to write your code to cater for this.


For more information, see the Intel Architecture Software Developer's Manual, Volume 2.


EXAMPLE:

sysenter