为什么没有包含 EAX 高字节的寄存器? [英] Why is there not a register that contains the higher bytes of EAX?

查看:25
本文介绍了为什么没有包含 EAX 高字节的寄存器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

%AX = (%AH + %AL)

那么为什么不 %EAX = (%SOME_REGISTER + %AX) 用于某些寄存器 %SOME_REGISTER?

So why not %EAX = (%SOME_REGISTER + %AX) for some register %SOME_REGISTER?

推荐答案

只是为了澄清一下.在 1970 年代早期的微处理器时代,CPU 只有少量寄存器和非常有限的指令集.通常,算术单元只能在单个 CPU 寄存器上运行,通常称为累加器".8 位 8080 & 上的累加器Z80 处理器被称为A".还有 6 个其他通用 8 位寄存器:B、C、D、E、H &L. 这六个寄存器可以配对形成 3 个 16 位寄存器:BC、DE &HL.在内部,累加器与Flags寄存器结合形成AF 16位寄存器.

Just for some clarification. In the early microprocessor days of the 1970's, CPUs had only a small number of registers and a very limited instruction set. Typically, the arithmetic unit could only operate on a single CPU register, often referred to as the "accumulator". The accumulator on the 8 bit 8080 & Z80 processors was called "A". There were 6 other general purpose 8 bit registers: B, C, D, E, H & L. These six registers could be paired up to form 3 16 bit registers: BC, DE & HL. Internally, the accumulator was combined with the Flags register to form the AF 16 bit register.

当英特尔开发 16 位 8086 系列时,他们希望能够移植 8080 代码,因此他们保持相同的基本寄存器结构:

When Intel developed the 16 bit 8086 family they wanted to be able to port 8080 code, so they kept the same basic register structure:

8080/Z80  8086
A         AX
BC        BX
DE        CX
HL        DX
IX        SI    
IY        DI

由于需要移植 8 位代码,他们需要能够引用 AX、BX、CX 和 CX 的各个 8 位部分.DX.这些被称为 AL、AH 代表低AX 的高字节等用于 BL/BH、CL/CH &DL/DH.九&Z80 上的 IY 仅用作 16 位指针寄存器,因此无需访问 SI & 的两半.DI.

Because of the need to port 8 bit code they needed to be able to refer to the individual 8 bit parts of AX, BX, CX & DX. These are called AL, AH for the low & high bytes of AX and so on for BL/BH, CL/CH & DL/DH. IX & IY on the Z80 were only ever used as 16 bit pointer registers so there was no need to access the two halves of SI & DI.

当 80386 在 1980 年代中期发布时,他们创建了所有寄存器的扩展"版本.所以,AX 变成了 EAX,BX 变成了 EBX 等等.没有必要访问这些新扩展寄存器的前 16 位,所以他们没有创建 EAXH 伪寄存器.

When the 80386 was released in the mid 1980s they created "extended" versions of all the registers. So, AX became EAX, BX became EBX etc. There was no need to access to top 16 bits of these new extended registers, so they didn't create an EAXH pseudo register.

AMD 在生产第一个 64 位处理器时应用了相同的技巧.AX 寄存器的 64 位版本称为 RAX.所以,现在你有这样的东西:

AMD applied the same trick when they produced the first 64 bit processors. The 64 bit version of the AX register is called RAX. So, now you have something that looks like this:

|63..32|31..16|15-8|7-0|
               |AH.|AL.|
               |AX.....|
       |EAX............|
|RAX...................|

这篇关于为什么没有包含 EAX 高字节的寄存器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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