in CO and Architecture edited by
6,106 views
7 votes
7 votes

In which addressing mode, the effectives address of the operand is generated by adding a constant value to the content of a register?

  1. Absolute mode
  2. Indirect mode
  3. Immediate mode
  4. Index mode
in CO and Architecture edited by
6.1k views

4 Answers

4 votes
4 votes
Best answer

ans index addressing mode

The address could be the start of an array or vector, and the index could select the particular array element required. The processor may scale the index register to allow for the size of each array element.

Note that this is more or less the same as base-plus-offset addressing mode, except that the offset in this case is large enough to address any memory location.

Example 1: Within a subroutine, a programmer may define a string as a local constant or a static variable. The address of the string is stored in the literal address in the instruction. The offset—which character of the string to use on this iteration of a loop—is stored in the index register.

Example 2: A programmer may define several large arrays as globals or as class variables. The start of the array is stored in the literal address (perhaps modified at program-load time by a relocating loader) of the instruction that references it. The offset—which item from the array to use on this iteration of a loop—is stored in the index register. Often the instructions in a loop re-use the same register for the loop counter and the offsets of several arrays.

selected by

1 comment

why it is not immediate mode ?? in which constant value is added to register.
0
0
1 vote
1 vote
1. An absolute address is represented by the contents of a register. This addressing mode is absolute in the sense that it is not specified relative to the current instruction address.

2. Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.

Immediate Operand:

The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.

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
0 votes
0 votes
d) index mode
0 votes
0 votes

Option D is right option for it.

Index mode::

Explanation

Base add=200 Address=201  ........... Address=2050 Address=300

Index register will contain an index like below::

50

 

Suppose u want to go at 2050 then by using index register u can access it like below way

Effective address=Index registre content + base Address=50 + 200 = 250 

Answer:

Related questions