* better
[mascara-docs.git] / hw / i386.reference / SGDT.htm
blob9b3db7cfee81e3ba6442d1abaf9998658c776c49
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>80386 Programmer's Reference Manual -- Opcode SGDT</TITLE>
5 </HEAD>
6 <BODY>
7 <B>up:</B> <A HREF="c17.htm">
8 Chapter 17 -- 80386 Instruction Set</A><BR>
9 <B>prev:</B><A HREF="SETcc.htm"> SETcc Byte Set on Condition</A><BR>
10 <B>next:</B><A HREF="SHLD.htm"> SHLD Double Precision Shift Left</A>
11 <P>
12 <HR>
13 <P>
14 <H1>SGDT/SIDT -- Store Global/Interrupt Descriptor Table Register</H1>
16 <PRE>
17 Opcode Instruction Clocks Description
19 0F 01 /0 SGDT m 9 Store GDTR to m
20 0F 01 /1 SIDT m 9 Store IDTR to m
21 </PRE>
23 <H2>Operation</H2>
25 <PRE>
26 DEST := 48-bit BASE/LIMIT register contents;
27 </PRE>
29 <H2>Description</H2>
31 SGDT/SIDT copies the contents of the descriptor table register the six
32 bytes of memory indicated by the operand. The LIMIT field of the
33 register is assigned to the first word at the effective address. If the
34 operand-size attribute is 32 bits, the next three bytes are assigned the
35 BASE field of the register, and the fourth byte is written with zero. The
36 last byte is undefined. Otherwise, if the operand-size attribute is 16
37 bits, the next four bytes are assigned the 32-bit BASE field of the
38 register.
39 <P>
40 SGDT and SIDT are used only in operating system software; they are
41 not used in application programs.
43 <H2>Flags Affected</H2>
45 None
47 <H2>Protected Mode Exceptions</H2>
49 Interrupt 6 if the destination operand is a register; #GP(0) if the
50 destination is in a nonwritable segment; #GP(0) for an illegal memory
51 operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for
52 an illegal address in the SS segment; #PF(fault-code) for a page fault
54 <H2>Real Address Mode Exceptions</H2>
56 Interrupt 6 if the destination operand is a register; Interrupt 13 if any
57 part of the operand would lie outside of the effective address space from
58 0 to 0FFFFH
60 <H2>Virtual 8086 Mode Exceptions</H2>
62 Same exceptions as in Real Address Mode; #PF(fault-code) for a page
63 fault
65 <H2>Compatability Note</H2>
67 The 16-bit forms of the SGDT/SIDT instructions are compatible with
68 the 80286, if the value in the upper eight bits is not referenced. The
69 80286 stores 1's in these upper bits, whereas the 80386 stores 0's if the
70 operand-size attribute is 16 bits. These bits were specified as undefined
71 by the SGDT/SIDT instructions in the iAPX 286 Programmer's
72 Reference Manual.
75 <P>
76 <HR>
77 <P>
78 <B>up:</B> <A HREF="c17.htm">
79 Chapter 17 -- 80386 Instruction Set</A><BR>
80 <B>prev:</B><A HREF="SETcc.htm"> SETcc Byte Set on Condition</A><BR>
81 <B>next:</B><A HREF="SHLD.htm"> SHLD Double Precision Shift Left</A>
82 </BODY>