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

📅  最后修改于: 2021-09-28 11:00:39             🧑  作者: 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.