Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- iAPx86 - <b>lds load pointer using ds flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LDS             Load Pointer Using DS                Flags: Not altered

LDS destination,source
LES destination,source
LFS destination,source  (CPU: 386+)
LGS destination,source  (CPU: 386+)
LSS destination,source  (CPU: 386+)

        Logic   destination    . offset part of source
                DS|ES|FS|GS|SS . segment part of source

    The data pointer instructions load a full pointer, consisting of a
    segment value (in protected mode: a segment selector) and an
    offset value, into a segment register and a general register.

    The source operand must be a memory operand. The destination
    operand must be a general register. The destination register loads
    16 bits if the operand-size attribute is 16, otherwise 32 bits.

        Example:
                dataseg
                scrPtr  dw 0,0b800h
                codeseg
                les     di,[dword ptr scrPtr]
                assume  es:nothing


    Protected mode
    A null selector (values 0000-0003) can be loaded into DS,ES,FS, or
    GS without causing a protection exception. (Any subsequent
    reference to a segment whose corresponding segment register is
    loaded with a null selector causes a #GP(0) exception. No memory
    reference to the segment occurs.)


    Opcode      Format
    C4 /r       LES  r16,m16:16
    C4 /r       LES  r32,m16:32
    C5 /r       LDS  r16,m16:16
    C5 /r       LDS  r32,m16:32
    0F B2 /r    LSS  r16,m16:16
    0F B2 /r    LSS  r32,m16:32
    0F B4 /r    LFS  r16,m16:16
    0F B4 /r    LFS  r32,m16:32
    0F B5 /r    LGS  r16,m16:16
    0F B5 /r    LGS  r32,m16:32


    Length and timing
    Operands    Bytes   8088    186     286     386     486     Pentium
LDS reg, mem   2+d(2)   24+EA   18       7       7       6       4   NP
LES reg, mem   2+d(2)   24+EA   18       7       7       6       4   NP
LFS reg, mem   3+d(2,4)                          7       6       4   NP
LGS reg, mem   3+d(2,4)                          7       6       4   NP
LSS reg, mem   3+d(2,4)                          7       6       4   NP

See Also: MOV Selectors Exceptions

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson