Help in understanding this piece of code

This is the code from the header.S file in the kernel code. I could not understand what the instruction was doing lretw. I checked so many online sources for instructions.

# We will have entered with %cs = %ds+0x20, normalize %cs so
# it is on par with the other segments.
        pushw   %ds 
        pushw   $6f 
        lretw

Can someone help me in understanding this instruction?

+5
source share
1 answer

ret- This is an instruction to return from the procedure. Thus, it basically issues the return address from the stack to the EIP register.

the prefix is lhere to say that he is far from the procedure. In this case, the command first issues the value from the stack to the EIP register, and then issues the second value to the CS register.

w , , 16 .

:

    pushw   %ds
    pushw   $6f
    lretw
6:

6:. , : ds , 6 lretw. , , 6 cs ds. 6 cs.

http://www.intel.com/design/intarch/manuals/243191.htm, , , , .

+5
source

All Articles