image/svg+xmlLGDT/LIDT—Load Global/Interrupt Descriptor Table RegisterInstruction Operand EncodingDescriptionLoads the values in the source operand into the global descriptor table register (GDTR) or the interrupt descriptor table register (IDTR). The source operand specifies a 6-byte memory location that contains the base address (a linear address) and the limit (size of table in bytes) of the global descriptor table (GDT) or the interrupt descriptor table (IDT). If operand-size attribute is 32 bits, a 16-bit limit (lower 2 bytes of the 6-byte data operand) and a 32-bit base address (upper 4 bytes of the data operand) are loaded into the register. If the operand-size attribute is 16bits, a 16-bit limit (lower 2 bytes) and a 24-bit base address (third, fourth, and fifth byte) are loaded. Here, the high-order byte of the operand is not used and the high-order byte of the base address in the GDTR or IDTR is filled with zeros.The LGDT and LIDT instructions are used only in operating-system software; they are not used in application programs. They are the only instructions that directly load a linear address (that is, not a segment-relative address) and a limit in protected mode. They are commonly executed in real-address mode to allow processor initialization prior to switching to protected mode.In 64-bit mode, the instruction’s operand size is fixed at 8+2 bytes (an 8-byte base and a 2-byte limit). See the summary chart at the beginning of this section for encoding data and limits.See “SGDT—Store Global Descriptor Table Register” in Chapter 4, Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 2B, for information on storing the contents of the GDTR and IDTR.OpcodeInstructionOp/ En64-Bit ModeCompat/Leg ModeDescription0F 01 /2LGDT m16&32MN.E.ValidLoad m into GDTR.0F 01 /3LIDT m16&32MN.E.ValidLoad m into IDTR.0F 01 /2LGDT m16&64MValidN.E.Load m into GDTR.0F 01 /3LIDT m16&64MValidN.E.Load m into IDTR.Op/EnOperand 1Operand 2Operand 3Operand 4MModRM:r/m (r)NANANA

image/svg+xmlOperationIF Instruction is LIDTTHENIF OperandSize = 16THEN IDTR(Limit) := SRC[0:15];IDTR(Base) := SRC[16:47] AND 00FFFFFFH; ELSE IF 32-bit Operand SizeTHENIDTR(Limit) := SRC[0:15];IDTR(Base) := SRC[16:47]; FI;ELSE IF 64-bit Operand Size (* In 64-Bit Mode *)THENIDTR(Limit) := SRC[0:15];IDTR(Base) := SRC[16:79]; FI;FI;ELSE (* Instruction is LGDT *)IF OperandSize = 16THEN GDTR(Limit) := SRC[0:15];GDTR(Base) := SRC[16:47] AND 00FFFFFFH; ELSE IF 32-bit Operand SizeTHENGDTR(Limit) := SRC[0:15];GDTR(Base) := SRC[16:47]; FI;ELSE IF 64-bit Operand Size (* In 64-Bit Mode *)THENGDTR(Limit) := SRC[0:15];GDTR(Base) := SRC[16:79]; FI;FI; FI;Flags AffectedNoneProtected Mode Exceptions#UDIf the LOCK prefix is used.#GP(0)If the current privilege level is not 0.If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.If the DS, ES, FS, or GS register is used to access memory and it contains a NULL segment selector.#SS(0)If a memory operand effective address is outside the SS segment limit.#PF(fault-code)If a page fault occurs.

image/svg+xmlReal-Address Mode Exceptions#UDIf the LOCK prefix is used.#GPIf a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.#SSIf a memory operand effective address is outside the SS segment limit.Virtual-8086 Mode Exceptions#UDIf the LOCK prefix is used.#GPIf the current privilege level is not 0.Compatibility Mode ExceptionsSame exceptions as in protected mode.64-Bit Mode Exceptions#SS(0)If a memory address referencing the SS segment is in a non-canonical form.#GP(0)If the current privilege level is not 0.If the memory address is in a non-canonical form.#UDIf the LOCK prefix is used.#PF(fault-code)If a page fault occurs.

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.