本文介绍了他们为什么在x86-64中使用数字作为寄存器名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AFAIK x86-64在从Intel x86派生的寄存器中添加了许多通用寄存器(raxrcx等),称为r8-r15.

AFAIK x86-64 adds a number of general purpose registers to those derived from Intel x86 (rax, rcx, etc), called r8-r15.

他们为什么要这样命名新的寄存器?为什么不只是遵循现有的命名约定并像rfxrgx ...这样命名它们呢?

Why did they name the new registers like this?Why not just follow existing naming convention and call them like rfx, rgx ... ?

推荐答案

对CPU寄存器编号是一种规范,几乎所有处理器都可以做到这一点.但是8086处理器是古老的,早在1976年,它们的晶体管预算就非常有限.采用只有20,000个有源晶体管的16位处理器实在是不容小tour.他们削减的一种方法是赋予寄存器专用功能.到那时,给他们起名字而不是数字是有意义的,暗示他们的用法.另一个影响是它被设计为与8080处理器具有一定程度的兼容性,并且还命名了具有专用功能的寄存器.

Numbering CPU registers is the norm, almost any processor does that. The 8086 processor however is ancient, they had an extremely limited transistor budget back in 1976. Implementing a 16-bit processor with only 20,000 active transistors was quite a tour-de-force. One way they cut down was by giving registers dedicated functions. At that point it made sense to give them names rather than numbers, hinting at their usage. Another influence was that it was designed to provide a level of compatibility with the 8080 processor, it also had named registers with dedicated functions.

与之完全相反的设计是Motorola 68000,三年后采用了更先进的工艺技术进行了设计,从而使晶体管预算增加了一倍.一个非常正交的设计,(几乎)每个寄存器都可以在任何指令中自由使用.并且与早期设计不兼容.它有编号的寄存器(D0-D7和A0-A7).

The exact opposite design was the Motorola 68000, designed three years later with a more advanced process technology that permitted double the transistor budget. A very orthogonal design with (almost) every register freely usable in any instruction. And no compatibility with earlier designs. It had numbered registers (D0-D7 and A0-A7).

x86体系结构的扩展再次使用了编号寄存器,例如R8至R15,MM0至MM7,XMM0-15,YMM0-15等.

Extensions to the x86 architecture uses numbered registers again, like R8 through R15, MM0 to MM7, XMM0-15, YMM0-15, etc.

这篇关于他们为什么在x86-64中使用数字作为寄存器名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 08:13