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

two arguments are passed, The velocity of sound in air is 49.02 feet p...

The velocity of sound in air is 49.02 feet per second where is the air temperature in degrees Rankine.  Write a function to execute this.  If just 1 argument is passed to the f

Explain about working of multiplexer, Q. Explain about working of Multiplex...

Q. Explain about working of Multiplexer? Multiplexer is one of the fundamental building units of a computer system that in principle permits sharing of a common line by more th

Name the 7400 series TTL chip, Name the 7400 series TTL chip which is a pri...

Name the 7400 series TTL chip which is a priority encoder. Write its truth table.  Ans. Available IC in 74 series is 74147 that is a priority encoder. Such I

Demultiplexers, Explain briefly about demultiplexers?

Explain briefly about demultiplexers?

Simplify the boolean expression, Simplify the Boolean expression F = C(B + ...

Simplify the Boolean expression F = C(B + C)(A + B + C). Ans. Simplification of the given Boolean Expression F = C (B +C) (A+B+C) given as F = C (B+C) (A+B+C) = CB + CC [(A+B+C

What is hybrid olap, When a database developer uses Hybrid OLAP it seperate...

When a database developer uses Hybrid OLAP it seperates the data among relational and specialized storage. In some certain modifications a HOLAP database may store vast amounts of

Advantages on electronic payment system, Advantages on electronic payment s...

Advantages on electronic payment system It gives good security schemes.  Four necessary security requirements for safe e-payments are Authentication, Encryption, Integrity,

What is branch folding, What is branch folding? The instruction fetch u...

What is branch folding? The instruction fetch unit has implemented the branch instruction concurrently with the implementation of other instructions. This technique is referred

Gustafsons law, Amdahl's law is suitable for applications where response ti...

Amdahl's law is suitable for applications where response time is critical. On the other hand, there are a lot of applications which need that accuracy of the resultant output shoul

Explain the significance ipv6 over ipv4, Explain the significance IPV6 over...

Explain the significance IPV6 over IPV4. The maximum size of an Ipv6 datagram is 65575 bytes, with the 0 bytes Ipv6 header. Ipv6 also describe a minimum reassembly buffer size:

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