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

Advantages to companies adopting call centres, Advantages to companies adop...

Advantages to companies adopting call centres Computer systems have allowed companies to set up call centres in other nations where potential cost savings can be made. This, of

What is a linker program, What is a linker program? Ans. links the prog...

What is a linker program? Ans. links the program with other programs required for its execution is called a linker program.

Xor gate, The XOR gate. The exclusive OR or XOR gate is similar to a tw...

The XOR gate. The exclusive OR or XOR gate is similar to a two input OR gate. The output of an XOR gate is logic 1 only when one input or the other input is high and is 0 when

Conclusion - artificial intelligence , Conclusion - artificial intelligence...

Conclusion - artificial intelligence : If we can determine what the exactly state of the world will be after an agent's action, so we can say the environment is deterministic.

Reduce minimum literals and derive their complements, Q. Reduce following t...

Q. Reduce following to minimum literals and derive their complements. 1. [(AB)'A][(AB)'B] 2. ABC(ABC' + AB'C + A'BC) 3. (A+C+D) (A+C+D') (A+C'+D)(A+D')

How can we decrement and increment operations, How can we decrement and in...

How can we decrement and increment  operations We  can  implement decrement  and increment  operations  by  using  a  combinational circuit  or  binary  down/up counters.  In

Explain that datagram cannot be larger than mtu of a network, "A datagram c...

"A datagram cannot be larger than the MTU of a network over which it is sent." Is the statement true or false? Explain with the help of a suitable example. All hardware technol

Data structure, what are the fundamental data structures

what are the fundamental data structures

What will be its digital output of an 8-bit ADC, An 8-bit successive approx...

An 8-bit successive approximation ADC has a resolution of 20mV.  What will be its digital output for an analog input of 2.17V? Ans: Given data Resolution =20mv Analog input =2.

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