In the following addressing mode, which of them performs better for accessing array?
In the following addressing mode, which of them performs better for accessing array? Correct Answer Index addressing mode
Concept
Index addressing mode
Addresses have two parts: the number of an index register and a constant. The address of the operand is the sum of the constant and the contents of the index register. It contains indexed (direct) addressing, indexed immediate addressing, and indexed indirect addressing. Indexed addressing mode is best suited for accessing an array in a contiguous memory location. So, option 4 is correct
Register addressing mode:
In register addressing mode, the data to be operated is available inside the register(s) and register(s) is(are) operands. Therefore, the operation is performed within various registers of the microprocessor.
Direct addressing mode:
Indirect addressing mode, the data to be operated is available inside a memory location and that memory location is directly specified as an operand. The operand is directly available in the instruction itself.
Displacement addressing modeAn integer (constant) is also referred to as a displacement. The address of the operand is obtained by adding the contents of the base register plus the constant. The difference between index mode and displacement mode is in the number of bits used to represent the constants.