LDS/LES/LFS/LGS/LSS—Load Far PointerInstruction Operand EncodingDescriptionLoads a far pointer (segment selector and offset) from the second operand (source operand) into a segment register and the first operand (destination operand). The source operand specifies a 48-bit or a 32-bit pointer in memory depending on the current setting of the operand-size attribute (32 bits or 16 bits, respectively). The instruction opcode and the destination operand specify a segment register/general-purpose register pair. The 16-bit segment selector from the source operand is loaded into the segment register specified with the opcode (DS, SS, ES, FS, or GS). The 32-bit or 16-bit offset is loaded into the register specified with the destination operand.If one of these instructions is executed in protected mode, additional information from the segment descriptor pointed to by the segment selector in the source operand is loaded in the hidden part of the selected segment register.Also in protected mode, a NULL selector (values 0000 through 0003) can be loaded into DS, ES, FS, or GS registers without causing a protection exception. (Any subsequent reference to a segment whose corresponding segment register is loaded with a NULL selector, causes a general-protection exception (#GP) and no memory reference to the segment occurs.)In 64-bit mode, the instruction’s default operation size is 32 bits. Using a REX prefix in the form of REX.W promotes operation to specify a source operand referencing an 80-bit pointer (16-bit selector, 64-bit offset) in memory. Using a REX prefix in the form of REX.R permits access to additional registers (R8-R15). See the summary chart at the beginning of this section for encoding data and limits.Operation64-BIT_MODEIF SS is loaded THEN IF SegmentSelector= NULL and ( (RPL = 3) or (RPL ≠ 3 and RPL ≠CPL) )THEN #GP(0);ELSE IF descriptor is in non-canonical spaceOpcodeInstructionOp/ En64-Bit ModeCompat/Leg ModeDescriptionC5 /rLDS r16,m16:16RMInvalidValidLoad DS:r16 with far pointer from memory.C5 /rLDS r32,m16:32RMInvalidValidLoad DS:r32 with far pointer from memory.0F B2 /rLSS r16,m16:16RMValidValidLoad SS:r16 with far pointer from memory.0F B2 /rLSS r32,m16:32RMValidValidLoad SS:r32 with far pointer from memory.REX + 0F B2 /rLSS r64,m16:64RMValidN.E.Load SS:r64 with far pointer from memory.C4 /rLES r16,m16:16RMInvalidValidLoad ES:r16 with far pointer from memory.C4 /rLES r32,m16:32RMInvalidValidLoad ES:r32 with far pointer from memory.0F B4 /rLFS r16,m16:16RMValidValidLoad FS:r16 with far pointer from memory.0F B4 /rLFS r32,m16:32RMValidValidLoad FS:r32 with far pointer from memory.REX + 0F B4 /rLFS r64,m16:64RMValidN.E.Load FS:r64 with far pointer from memory.0F B5 /rLGS r16,m16:16RMValidValidLoad GS:r16 with far pointer from memory.0F B5 /rLGS r32,m16:32RMValidValidLoad GS:r32 with far pointer from memory.REX + 0F B5 /rLGS r64,m16:64RMValidN.E.Load GS:r64 with far pointer from memory.Op/EnOperand 1Operand 2Operand 3Operand 4RMModRM:reg (w)ModRM:r/m (r)NANA
This UNOFFICIAL reference was generated from the official Intel® 64 and IA-32 Architectures Software Developer’s Manual by a dumb script. There is no guarantee that some parts aren't mangled or broken and is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.