The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+19 votes

Which is the most appropriate match for the items in the first column with the items in the second column:$$\begin{array}{|cl|cl|} \hline \text{X.} &\text{Indirect Addressing} &  \text{I.} &\text{Array implementation} \\\hline
\text{Y.} &\text{Indexed Addressing} & \text{II.} &\text{Writing relocatable code}  \\\hline 
\text {Z.} &\text{Base Register Addressing}  & \text{III.} &\text{Passing array as parameter}\\\hline  \end{array}$$

  1. (X, III), (Y, I), (Z, II)
  2. (X, II), (Y, III), (Z, I)
  3. (X, III), (Y, II), (Z, I)
  4. (X, I), (Y, III), (Z, II)
asked in CO and Architecture by Veteran (52.1k points)
edited by | 1.7k views

Index Mode

The address of the operand is obtained by adding to the contents of the general register (called index register) a constant value. The number of the index register and the constant value are included in the instruction code. Index Mode is used to access an array whose elements are in successive memory locations. The content of the instruction code, represents the starting address of the array and the value of the index register, and the index value of the current element. By incrementing or decrementing index register different element of the array can be accessed.

 Displacement Mode

Similar to index mode, except instead of a index register a base register will be used. Base register contains a pointer to a memory location. An 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 constant. When the constant is represented a number of bits to access the memory, then we have index mode. Index mode is more appropriate for array accessing; displacement mode is more appropriate for structure (records) accessing.

2 Answers

+34 votes
Best answer

(A) is the answer.

Array implementation can use Indexed addressing.

While passing array as parameter we can make use of a pointer (as in (C)) and hence can use Indirect addressing.

Base Register addressing can be used to write relocatable code by changing the content of Base Register.

answered by Veteran (414k points)
edited by
+1 vote

In Indirect Addressing mode, Instruction contain address of Effective Address(M-->EA-->operand), So it is used for pointer implementation.

In Index Addressing mode used for array implementation because we can access array by changing the index value in instruction.

For program relocation best addressing mode is relative addressing mode, but we can implement relocation using Base Addressing mode by changing value in Base

answered by Junior (867 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,811 questions
54,533 answers
75,578 users