为什么 x86 寄存器如此命名?
例如,累加器被命名为EAX
,而指令指针被命名为IP
。 我还知道有一些字节称为 CL
和 DH
。 我知道所有的名字一定有一个约定,但是它是什么呢?
For example, the accumulator is named EAX
and, while the instruction pointer is called IP
. I also know that there are bytes called CL
and DH
. I know there must be a convention to all of the names, but what is it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
以下是每个 x86 通用寄存器代表含义的简要说明:
The following is a brief explanation of what each of the x86 general-purpose registers stands for:
较旧的处理器具有名为 A、B 等(按字母顺序排列)的累加器。 当 16 位和后来的 32 位累加器开发出来时,工程师分别添加了 X (extending) 和 E (extished)。
所以这都是关于历史的,就像 C 语言的名字一样,因为它是从 B 语言(贝尔实验室)发展而来的。
该约定只是内部的,以跟上他们已经熟悉的名称。
Older processors have accumulators named A, B, etc (alphabetically ordered). When 16-bit and later 32-bit accumulators got developed, engineers added an X (extended) and an E (extended) respectively.
So it's all about history, just like the language C is called the way it is, because it was developed from the B language (Bell labs).
The convention is only internal, to keep up with the names they were already familiar with.
它的历史。 x86 来自 8086,8086 来自 8080,8080 来自 8008,8008 来自 4004。有 16 位寄存器 AX、BX 等,对于 80386,它们被“扩展”为 32 位。
补充:顺便说一句,摩托罗拉 68K 从一开始就有 32 位寄存器,因此在最初的几十年里编程要容易得多。 我参与的项目中选择英特尔是出于商业原因,而不是技术原因。
It's history. The x86 came from the 8086, which came from the 8080, which came from the 8008, which came from the 4004. There were 16-bit registers AX, BX, etc. and for the 80386 they got "extended" to 32 bits.
Added: BTW the Motorola 68K had 32-bit registers from the start, so it was much easier to program for the first couple decades. I worked on projects where Intel was chosen for business reasons, not technical.
我发现的东西:
Something I found:
C 和 D 是数字/类型,H 代表高位寄存器的高位部分,L 代表高位寄存器的低位部分。
http://en.wikipedia.org/wiki/X86
维基百科解释得很好。
更多来自维基百科:
数据/一般
The C and the D are numbers/types and H for high and L for low parts of the higher register.
http://en.wikipedia.org/wiki/X86
Wikipedia explains it very well.
More from the Wikipedia:
data/general