intel指令的变化(SGDT / SIDT)

386手册:

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.

奔腾手册:

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.

最新的手册:
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.

 

286手册上说明SGDT/SIDT指令只存储5个字节,最后一个字节是未定义,PCEM里最后一个字节是写入的0xFF。而386+CPU在16位模式最后一个字节是要写入值的,他是按照286手册中说明的那样:GDTR/IDTR描述符最后一个字节是保留位必须是0这样操作的,也就是说386+以后的CPU SGDT/SIDT根本就是忽略了16位的前缀,存储的是6个字节只不过最后一个字节写0。

转载于:https://my.oschina.net/u/2601353/blog/1524218

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值