我们是否也将寄存器RAX,RBX等称为R1,R2等?

问题描述:

我正在研究8086/8080微处理器。它们中使用的寄存器具有名称,

I am studying 8086/8080 microprocessors. The registers used in them have names,


  1. RAX

  2. RBX

  3. RCX

  4. RDX

  1. RAX
  2. RBX
  3. RCX
  4. RDX

继续直到R8寄存器被命名如R8,R9 ...至R15。我想知道

and go on until R8 when the registers are named as R8, R9... to R15. I wanted to know

我们也将寄存器RAX,RBX等称为R1,R2等吗?

Do we also refer to the registers RAX, RBX etc as R1, R2 and so on?

前8个寄存器的标准做法是保留其历史名称。

Standard practice is for the first 8 registers to keep their historical name. This convention is used in the documentation from Intel and AMD and in most assemblers.

这样做的原因是这些名称是寄存器功能的助记符。例如, rsp 突出显示为堆栈指针; r4 不是很多。相比之下,新的寄存器没有任何特定功能。

The reason for this is that these names are mnemonic for the function of the register. For example rsp sticks out as the stack pointer; r4 not so much. The new registers, by contrast, don't have any particular function.

也就是说,您始终可以使用宏将 r0-r7 定义为 rax, rcx,rdx,rbx,rsp,rbp,rsi,rdi 。例如,您可以使用nasm来获取这些定义,

That being said you can always use macros to define r0-r7 as rax,rcx,rdx,rbx,rsp,rbp,rsi,rdi. For example you can get these definitions in nasm with


%use altreg

%use altreg

同样,这是非标准的,这会使您和其他人都难以阅读代码。

Again, this is non-standard and will make the code hard to read, both for you and others.