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]