The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+3 votes
263 views
What is the difference between Base addressing and Index addressing?

And finally how does based indexed addressing works?
asked in CO and Architecture by Active (3.2k points)
retagged by | 263 views

1 Answer

+4 votes
Best answer

IMPORTANT TERMS

  • Starting address of memory segment.
  • Effective address or Offset: An offset is determined by adding any combination of three address elements: displacement, base and index.
    • Displacement: It is an 8 bit or 16 bit immediate value given in the instruction.
    • Base: Contents of base register, BX or BP.
    • Index: Content of index register SI or DI

Base addressing: The operand’s offset is sum of an 8 bit or 16 bit displacement and the contents of the base register BX or BP.BX is used as a base register for data segment ,and BP is used as a base register for stack segment.

Example:MOV AL,[BX+05]

suppose the register BX contain 0301.The offset will be 0301+05=0306.Content of the memory location 0306 will move to AL.

Indexed addressing means that the final address for the data is determined by adding an offset to a base address.

Very often, a chunk of data is stored as a complete block in memory.

For example, it makes sense to store arrays as contiguous blocks in memory (contiguous means being next to something without a gap). The array has a 'base address' which is the location of the first element, then an 'index' is used that adds an offset to the base address in order to fetch any other element within the array.

The operand’s offset is the sum of the content of an index register SI or DI and an 8 bit or 16 bit displacement.

Example:MOV AX, [SI +05]

Based Indexed Addressing: The operand’s offset is sum of the content of a base register BX or BP and an index register SI or DI.

Example: ADD AX, [BX+SI]
answered by Active (3.4k points)
selected 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
49,811 questions
54,540 answers
188,429 comments
75,596 users