"D"代表什么?代表386的"D位"? [英] What does the "D" stand for in 386's "D bit"?

查看:268
本文介绍了"D"代表什么?代表386的"D位"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GDT上的文章中,OSDev Wiki描述了用作D位的标志. CS描述符如下:

In the article on the GDT the OSDev wiki describes the flag that is used as D bit for CS descriptors as follows:

Sz :大小位.如果 0 ,则选择器定义16位保护模式.如果 1 ,则定义32位保护模式.您可以同时拥有16位和32位选择器.

Sz: Size bit. If 0 the selector defines 16 bit protected mode. If 1 it defines 32 bit protected mode. You can have both 16 bit and 32 bit selectors at once.

另一个问题引用了英特尔手册:

Another question quotes the Intel manuals: What does the D flag in the code segment descriptor do for x86-64 instructions? which links to the part "3.4.5 Segment Descriptors" from Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 3 [...]: System Programming Guide, reading:

D/B(默认操作大小/默认堆栈指针大小和/或上限)标志

D/B (default operation size/default stack pointer size and/or upper bound) flag

根据段描述符是可执行代码段,扩展数据段还是堆栈段执行不同的功能. (对于32位代码和数据段,此标志应始终设置为1;对于16位代码和数据段,应始终将其设置为0.)

Performs different functions depending on whether the segment descriptor is an executable code segment, an expand-down data segment, or a stack segment. (This flag should always be set to 1 for 32-bit code and data segments and to 0 for 16-bit code and data segments.)

•可执行代码段.该标志称为D标志,它指示段中指令引用的有效地址和操作数的默认长度.如果设置了该标志,则假定使用32位地址和32位或8位操作数;否则,将使用0.如果清楚,则假定使用16位地址和16位或8位操作数.指令前缀66H可以用来选择默认值以外的操作数大小,而前缀67H可以用来选择默认值以外的地址大小.

• Executable code segment. The flag is called the D flag and it indicates the default length for effective addresses and operands referenced by instructions in the segment. If the flag is set, 32-bit addresses and 32-bit or 8-bit operands are assumed; if it is clear, 16-bit addresses and 16-bit or 8-bit operands are assumed. The instruction prefix 66H can be used to select an operand size other than the default, and the prefix 67H can be used select an address size other than the default.

问题是,"D"代表什么?代表?

The question is, what does "D" stand for?

推荐答案

我找到了 16.1 80386如何实现16位和32位功能:

允许80386在32位和16位地址以及操作数大小上同样出色地工作的体系结构的功能包括:

The features of the architecture that permit the 80386 to work equally well with 32-bit and 16-bit address and operand sizes include:

  • 代码段描述符的D位(默认位),它确定代码段指令的操作数大小和地址大小的默认选择. (在不使用描述符的实地址模式和V86模式下,默认值为16位.)将其D位设置为1的代码段称为USE32段. D位为零的代码段是USE16段.当所有指令都使用相同大小的操作数和有效地址时,D位消除了对指令中的操作数大小和地址大小进行编码的需要.

  • The D-bit (default bit) of code-segment descriptors, which determines the default choice of operand-size and address-size for the instructions of a code segment. (In real-address mode and V86 mode, which do not use descriptors, the default is 16 bits.) A code segment whose D-bit is set is known as a USE32 segment; a code segment whose D-bit is zero is a USE16 segment. The D-bit eliminates the need to encode the operand size and address size in instructions when all instructions use operands and effective addresses of the same size.

显式覆盖操作数大小和地址大小(在保护模式以及实地址模式和V86模式下可用)的默认选择的指令前缀.

Instruction prefixes that explicitly override the default choice of operand size and address size (available in protected mode as well as in real-address mode and V86 mode).

用于段间控制传输的单独的32位和16位门(包括调用门,中断门和陷阱门).控制传输的操作数大小取决于门的类型,而不取决于传输指令的D位或前缀.

Separate 32-bit and 16-bit gates for intersegment control transfers (including call gates, interrupt gates, and trap gates). The operand size for the control transfer is determined by the type of gate, not by the D-bit or prefix of the transfer instruction.

可用于32位和16位操作数以及有效地址计算的寄存器.

Registers that can be used both for 32-bit and 16-bit operands and effective-address calculations.

数据段描述符的B位(大位),用于确定CPU用于隐式堆栈引用的堆栈指针(32位ESP或16位SP)的大小.

The B-bit (big bit) of data-segment descriptors, which determines the size of stack pointer (32-bit ESP or 16-bit SP) used by the CPU for implicit stack references.

因此,"D位"代表"默认操作数和地址大小"; (对于代码段)和"B比特".表示"" (用于堆栈段).

So "D bit" stands for "Default operand and address size" (for code segments) and "B bit" for "Big" (for stack segments).

这篇关于"D"代表什么?代表386的"D位"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆