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

Which is the most appropriate match for the items in the first column with the items in the second column:

X. Indirect Addressing  I. Array implementation
Y. Indexed addressing II. Writing relocatable code
Z. Base Register Addressing  III. Passing array as parameter
  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 & Architecture by Veteran (59.6k points)
edited by | 1.4k 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.

1 Answer

+31 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 (363k points)
edited by

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

42,599 questions
48,600 answers
63,739 users