What is indirect addressing mode explain, Computer Engineering

Assignment Help:

Q. What is Indirect Addressing Mode explain?

Indirect Addressing Mode

In the indirect addressing modes operands employ registers to point to locations in memory. So it is essentially a register indirect addressing mode. This is a convenient mode for handling arrays / strings etc. For this mode two kinds of registers are used. These are:

  • Base register BX, BP
  • Index register SI, DI

BX comprises offset/ pointer in Data Segment

BP comprises offset/ pointer in Stack segment.

SI comprises offset/pointer in Data segment.

DI comprises offset /pointer in extra data segment.

There are 5 different kinds of indirect addressing modes:

1.  Register indirect

2.  Based indirect

3.  Indexed indirect

4.  Based indexed

5.  Based indexed with displacement.

Mode

Description

Example

Register Indirect

Indirect operands are particularly powerful when processing list of arrays, since a base or an indexregister can be modified at runtime.

MOV BX, OFFSET ARRAY 

; point to start of array

MOV AL,[BX] 

; get first element

INC BX 

; point to next

MOV DL,[BX] 

; get second element

The brackets around BX signify

That we are referring to the contents of memory location, using the address stored in BX.

In the subsequent illustration, three bytes in an array are added together:

MOV SI,OFFSET ARRAY 

; address of first byte

MOV AL,[SI] 

; move the first byte to AL

INC SI 

; point to next byte

ADD AL,[SI] 

; add second byte

INC SI 

; point to the third byte

ADD AL,[SI] 

; add the third byte

Based Indirectand Indexed

Indirect

Based and indirect addressing modes are employed in the same way. The contents of a register are added to a displacement to produce an effective address. The register should be one of the following: SI, DI, BX or BP. If the registers used for displacement are base registers, BX or BP, it is said to be base addressing or else it is termed as indexed addressing. A displacement is either a number or a label whose offset is known at assembly time. The notation can take various equivalent forms. If BX, SI or DI is used, the effective address is generally an offset from the DS register; BP on the other hand generally comprises an offset from SS register.

; Register added to an offset

MOV DX, ARRAY[BX]

MOV DX,[DI + ARRAY]

MOV DX,[ARRAY + SI]

; Register added to a constant

MOV AX,[BP + 2]

MOV DL,[DI - 2] ; DI + (-2)

MOV DX,2[SI]

Based Indexed

In this kind of addressing the operand's effective address is formed by combining a base register with an index register.

MOV AL,[BP] [SI]

MOV DX,[BX + SI]

ADD CX,[DI] [BX]

; Two base registers or two

; index registers cannot be

; combined, so the 

; following would be 

; incorrect:

MOV DL,[BP + BX] 

; error : two base registers

MOV AX,[SI + DI] 

; error : two index registers

Based Indexed with Displacement

The operand's effective address is formed by combining a base register, an

Index register, and a displacement. 

MOV DX,ARRAY[BX][SI]

MOV AX, [BX + SI +

ARRAY]

ADD DL,[BX + SI + 3] 

SUB CX, ARRAY[BP +

SI]

Two base registers or two

index registers can't be

combined so the

following will be

incorrect:

MOV AX,[BP + BX + 2]

MOV DX,ARRAY[SI +

DI]


Related Discussions:- What is indirect addressing mode explain

Which method is used for resolving data dependency, Which method is used fo...

Which method is used for resolving data dependency conflict by the compiler itself?  (A) Delayed load.   (B) operand forwarding.   (C) Pre fetch target instruction.  (D) loo

Why we need to construct state transition diagram, Why we need to construct...

Why we need to construct state transition diagram Basically you need to construct a state transition diagram for each object with important behaviour. You need not construct on

Minimize the logic function using NAND gate, Minimize the logic function F(...

Minimize the logic function F(A, B, C, D) = ∑ m(1,3,5,8,9,11,15) + d(2,13) using NAND gate with help of K-map. Ans. Realization of given expression by using NAND gates:  In

What is a decoder, What is a Decoder ? Ans. Decoder: - This dec...

What is a Decoder ? Ans. Decoder: - This decodes the information. The decoders contain n inputs 7 at the end maximum 2 n outputs since n bit no can decode max 2n infor

Explain the meaning of listen socket primitive, Explain the meaning of L...

Explain the meaning of LISTEN socket primitive The listen Primitive: After identifying a protocol port a server should instruct the operating system to place a socket

What is dynamic random access memory, Q. What is Dynamic Random Access Memo...

Q. What is Dynamic Random Access Memory? RAM technology is divided into 2 technologies: Static and dynamic. A dynamic RAM (DRAM) is made with cells which store data as charge o

Define memory read and write operation, Define Memory read and write operat...

Define Memory read and write operation The transfer of information from a memory word to outside environment is known as read operation. The transfer of new information to be k

What is an assembler, An assembler is? Ans. An assembler is Machine dep...

An assembler is? Ans. An assembler is Machine dependant.

Write a program that will solve a puzzle, You will write a program that wil...

You will write a program that will solve a version of the common newspaper puzzle \word search." In the puzzle you are given a grid lled with characters and a list of words to nd

State in brief about polymorphism, State in brief about Polymorphism C...

State in brief about Polymorphism Class hierarchy is the deciding feature in the case of more than one implementation of properties. An object oriented program to compute the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd