intel指令的變化(SGDT / SIDT)

386手冊:app

SGDT/SIDT copies the contents of the descriptor table register to the six bytes of memory indicated by the operand. The LIMIT field of the register is assigned to the first word at the effective address. If the operand-size attribute is 32 bits, the next three bytes are assigned the BASE field of the register, and the fourth byte is written with zero. The last byte is undefined. Otherwise, if the operand-size attribute is 16 bits, the next four bytes are assigned the 32-bit BASE field of the register.spa

奔騰手冊:orm

Stores the contents of the global descriptor table register (GDTR) or the interrupt descriptor
table register (IDTR) in the destination operand. The destination operand specifies a 6-byte
memory location. If the operand-size attribute is 32 bits, the 16-bit limit field of the register is
stored in the lower 2 bytes of the memory location and the 32-bit base address is stored in the
upper 4 bytes. If the operand-size attribute is 16 bits, the limit is stored in the lower 2 bytes and
the 24-bit base address is stored in the third, fourth, and fifth byte, with the sixth byte filled with
0s.three

最新的手冊:
Stores the content of the global descriptor table register (GDTR) in the destination operand. The destination operand specifies a memory location.
In legacy or compatibility mode, the destination operand is a 6-byte memory location. If the operand-size attribute is 16 or 32 bits, the 16-bit limit field of the register is stored in the low 2 bytes of the memory location and the 32-bit base address is stored in the high 4 bytes.
In 64-bit mode, the operand size is fixed at 8+2 bytes. The instruction stores an 8-byte base and a 2-byte limit.
SGDT is useful only by operating-system software. However, it can be used in application programs without causing an exception to be generated if CR4.UMIP = 0. See 「LGDT/LIDT—Load Global/Interrupt Descriptor Table Register」 in Chapter 3, Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 2A, for information on loading the GDTR and IDTR.ip

 

286手冊上說明SGDT/SIDT指令只存儲5個字節,最後一個字節是未定義,PCEM裏最後一個字節是寫入的0xFF。而386+CPU在16位模式最後一個字節是要寫入值的,他是按照286手冊中說明的那樣:GDTR/IDTR描述符最後一個字節是保留位必須是0這樣操做的,也就是說386+之後的CPU SGDT/SIDT根本就是忽略了16位的前綴,存儲的是6個字節只不過最後一個字節寫0。ci

相關文章
相關標籤/搜索