📜  寄存器模式和寄存器间接模式之间的区别

📅  最后修改于: 2021-06-28 15:37:28             🧑  作者: Mango

先决条件–寻址模式

1.注册模式:
在寄存器寻址模式下,操作数放置在8位或16位通用寄存器之一中。数据位于指令指定的寄存器中。

例子:

MOV R1, R2 

指令具有寄存器R2,而R2具有操作数。

2.注册间接模式:
在寄存器间接寻址模式下,操作数的地址位于任何一个寄存器中。该指令指定一个包含操作数地址的寄存器。

例子:

ADD R1, (R2) 

指令具有寄存器R2,R2具有操作数的存储地址。

寄存器模式和寄存器间接模式之间的区别:

REGISTER MODE REGISTER INDIRECT MODE
Operand is placed in general purpose register. Operand’s offset is placed in one of the resgiters.
In register mode, address field contains the effective address of operand. In register indirect mode, address field contains reference of effective address.
It requires only one register reference to access data. It requires two register references to access data.
No further calculation is required to perform the operation. Require further calculation to find the effective address.
Register addressing mode is fast. register indirect addressing mode is slow.
It is easier to access the data in register mode. It is a bit complex to access the data in register indirect mode.
It uses temporary variables. It uses pointers.