- #1
s3a
- 818
- 8
Question about the "register plus immediate" addressing mode
The question:
"Why does adding addressing modes like register plus immediate to an instruction set architecture tend to improve performance?"
The answer:
"Adding additional addressing modes to an instruction set architecture tends to improve performance by reducing the number of instructions required to compute addresses. For example, if a data structure contains four data words, register plus immediate addressing can be used to access all of them with only one address computation required to change the pointer to point to the next data structure. If an architecture only provided the register addressing mode, an ADD instruction would be required to calculate the address of each element in the data structure."
N/A
I checked Wikipedia and found that:
1) Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs.
2) The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand(or operands) of each instruction.
3) An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere.
Furthermore, I think I understand that having additional addressing modes just means that the processor can locate a memory address more efficiently and that, in this problem, the “register plus immediate” addressing mode allows the processor to locate memory addresses using fewer instructions.
What I'd like to know is:
1) Is an addressing mode nothing more than an additional functionality that the processor has in order to locate memory addresses? (If this sounds too similar compared to what I said above to be clear, I think I get that adding addressing modes allows the processor to locate memory addresses more efficiently but, I'm not too sure what an addressing mode actually is.)
2) Most importantly, could someone please briefly explain and then probably elaborate on how exactly the “register plus immediate” addressing mode functions?
If anything is unclear, tell me and, I will attempt to clarify the situation.
Any help in fully grasping this problem and its provided solution would be greatly appreciated!
Homework Statement
The question:
"Why does adding addressing modes like register plus immediate to an instruction set architecture tend to improve performance?"
The answer:
"Adding additional addressing modes to an instruction set architecture tends to improve performance by reducing the number of instructions required to compute addresses. For example, if a data structure contains four data words, register plus immediate addressing can be used to access all of them with only one address computation required to change the pointer to point to the next data structure. If an architecture only provided the register addressing mode, an ADD instruction would be required to calculate the address of each element in the data structure."
Homework Equations
N/A
The Attempt at a Solution
I checked Wikipedia and found that:
1) Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs.
2) The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand(or operands) of each instruction.
3) An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere.
Furthermore, I think I understand that having additional addressing modes just means that the processor can locate a memory address more efficiently and that, in this problem, the “register plus immediate” addressing mode allows the processor to locate memory addresses using fewer instructions.
What I'd like to know is:
1) Is an addressing mode nothing more than an additional functionality that the processor has in order to locate memory addresses? (If this sounds too similar compared to what I said above to be clear, I think I get that adding addressing modes allows the processor to locate memory addresses more efficiently but, I'm not too sure what an addressing mode actually is.)
2) Most importantly, could someone please briefly explain and then probably elaborate on how exactly the “register plus immediate” addressing mode functions?
If anything is unclear, tell me and, I will attempt to clarify the situation.
Any help in fully grasping this problem and its provided solution would be greatly appreciated!