The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+15 votes
1.2k views

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.5k points)
edited by | 1.2k views
+4

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

+29 votes
Best answer

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 (353k points)
edited by
+2


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

37,111 questions
44,694 answers
127,237 comments
43,753 users