Home

sgdt

SGDT stands for Store Global Descriptor Table Register. It is an x86 assembly instruction that copies the current contents of the Global Descriptor Table Register (GDTR) into a memory location specified by a memory operand. The GDTR holds the base address and limit of the Global Descriptor Table (GDT), which defines the memory segmentation used by protected mode and some compatibility modes.

The memory operand receives the GDTR data. In 32-bit operation, SGDT writes 6 bytes: a 16-bit limit

SGDT is used mainly in low-level system software such as operating systems, hypervisors, and boot code, where

See also SGDT’s siblings: LGDT and SIDT, and related concepts like the Global Descriptor Table (GDT) and

followed
by
a
32-bit
base
address.
In
64-bit
operation,
the
base
becomes
64
bits,
and
the
total
size
written
is
10
bytes
(2
bytes
for
the
limit
plus
8
bytes
for
the
base).
The
exact
layout
is
a
compact
representation
of
the
GDT
descriptor:
limit
first,
then
base.
saving
or
inspecting
the
descriptor
table
state
is
necessary
for
initialization,
debugging,
or
context
switching.
It
is
the
counterpart
to
LGDT,
which
loads
the
GDTR
from
memory,
and
to
SIDT,
which
stores
the
Interrupt
Descriptor
Table
Register
(IDTR).
Together,
these
instructions
allow
software
to
read
and
manipulate
the
processor’s
descriptor
tables
and
related
structural
data.
Interrupt
Descriptor
Table
(IDT).