answersLogoWhite

0


Best Answer

Each instruction of a computer specifies an operation on certain data. The are various ways of specifying address of the data to be operated on. These different ways of specifying data are called the addressing modes. The most common addressing modes are: * Immediate addressing mode * Direct addressing mode * Indirect addressing mode * Register addressing mode * Register indirect addressing mode * Displacement addressing mode * Stack addressing mode To specify the addressing mode of an instruction several methods are used. Most often used are : a) Different operands will use different addressing modes.

b) One or more bits in the instruction format can be used as mode field. The value of the mode field determines which addressing mode is to be used. The effective address will be either main memory address of a register. Immediate Addressing: This is the simplest form of addressing. Here, the operand is given in the instruction itself. This mode is used to define a constant or set initial values of variables. The advantage of this mode is that no memory reference other than instruction fetch is required to obtain operand. The disadvantage is that the size of the number is limited to the size of the address field, which most instruction sets is small compared to word length. INSTRUCTION

OPERAND Direct Addressing: In direct addressing mode, effective address of the operand is given in the address field of the instruction. It requires one memory reference to read the operand from the given location and provides only a limited address space. Length of the address field is usually less than the word length. Ex : Move P, Ro, Add Q, Ro P and Q are the address of operand. Indirect Addressing: Indirect addressing mode, the address field of the instruction refers to the address of a word in memory, which in turn contains the full length address of the operand. The advantage of this mode is that for the word length of N, an address space of 2N can be addressed. He disadvantage is that instruction execution requires two memory reference to fetch the operand Multilevel or cascaded indirect addressing can also be used. Register Addressing: Register addressing mode is similar to direct addressing. The only difference is that the address field of the instruction refers to a register rather than a memory location 3 or 4 bits are used as address field to reference 8 to 16 generate purpose registers. The advantages of register addressing are Small address field is needed in the instruction. Register Indirect Addressing: This mode is similar to indirect addressing. The address field of the instruction refers to a register. The register contains the effective address of the operand. This mode uses one memory reference to obtain the operand. The address space is limited to the width of the registers available to store the effective address. Displacement Addressing: In displacement addressing mode there are 3 types of addressing mode. They are : 1) Relative addressing

2) Base register addressing

3) Indexing addressing. This is a combination of direct addressing and register indirect addressing. The value contained in one address field. A is used directly and the other address refers to a register whose contents are added to A to produce the effective address. Stack Addressing: Stack is a linear array of locations referred to as last-in first out queue. The stack is a reserved block of location, appended or deleted only at the top of the stack. Stack pointer is a register which stores the address of top of stack location. This mode of addressing is also known as implicit addressing.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

8085 provides four types of addressing modes.

they are-

1. Direct MODE- It creates instruction 3bytes long. First byte contains the operation to be performed. The second and third bytes contain the addressi in memory where the data byte may be found.

2. Register MODE- It results in 8bit(single byte) instructions.The byte contains bits which specify a register or register pair in which the data is located.

3. Register Indirect MODE- It results in single byte instruction,contains bit which specify a register pair,which in turn contains the address of the data in memory. High order byte is stored in leftmost register of the pair and loworder byte is stored in the rightmost register of the pair.

4. Immediate MODE- It results in a wo or three byte instruction. The first byte contains the instruction itself and the second and third bytes contain the immediate data as a single/16 bit value. If 16 bit value is used the bytes are reversed.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

ADDRESSING MODES for 8085

1. Immediate addressing.

2. Register addressing.

3. Direct addressing.

4. Indirect addressing.

Immediate addressing

Load the immediate data into the register, R.

Example: MVI R,data

Register addressing

Data from source register is moved into destination register.

Example: MOV Rd, Rs

Direct addressing

Accepts data from external devices to be stored in the accumulator or sends the data from the accumulator to the external device.

Example: IN 00H or OUT 01H

Indirect Addressing

Here the Effective Address is calculated by the processor. And the contents of the address is used as a second address. At the second address the data is stored.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

1 The 80x86 Addressing Modes

The 80x86 processors let you access memory in many different ways. The 80x86 memory addressing modes provide flexible access to memory, allowing you to easily access variables, arrays, records, pointers, and other complex data types. Mastery of the 80x86 addressing modes is the first step towards mastering 80x86 assembly language.

When Intel designed the original 8086 processor, they provided it with a flexible, though limited, set of memory addressing modes. Intel added several new addressing modes when it introduced the 80386 microprocessor. Note that the 80386 retained all the modes of the previous processors; the new modes are just an added bonus. If you need to write code that works on 80286 and earlier processors, you will not be able to take advantage of these new modes. However, if you intend to run your code on 80386sx or higher processors, you can use these new modes. Since many programmers still need to write programs that run on 80286 and earlier machines, it's important to separate the discussion of these two sets of addressing modes to avoid confusing them.

1.1 8086 Register Addressing Modes

Most 8086 instructions can operate on the 8086's general purpose register set. By specifying the name of the register as an operand to the instruction, you may access the contents of that register. Consider the 8086 mov (move) instruction:

mov destination, source

This instruction copies the data from the source operand to the destination operand. The eight and 16 bit registers are certainly valid operands for this instruction. The only restriction is that both operands must be the same size. Now let's look at some actual 8086 movinstructions:

mov ax, bx ;Copies the value from BX into AX

mov dl, al ;Copies the value from AL into DL

mov si, dx ;Copies the value from DX into SI

mov sp, bp ;Copies the value from BP into SP

mov dh, cl ;Copies the value from CL into DH

mov ax, ax ;Yes, this is legal!

Remember, the registers are the best place to keep often used variables. As you'll see a little later, instructions using the registers are shorter and faster than those that access memory. Throughout this chapter you'll see the abbreviated operands reg and r/m (register/memory) used wherever you may use one of the 8086's general purpose registers.

In addition to the general purpose registers, many 8086 instructions (including the mov instruction) allow you to specify one of the segment registers as an operand. There are two restrictions on the use of the segment registers with the mov instruction. First of all, you may not specify csas the destination operand, second, only one of the operands can be a segment register. You cannot move data from one segment register to another with a single mov instruction. To copy the value of csto ds, you'd have to use some sequence like:

mov ax, cs

mov ds, ax

You should never use the segment registers as data registers to hold arbitrary values. They should only contain segment addresses. But more on that, later. Throughout this text you'll see the abbreviated operand sreg used wherever segment register operands are allowed (or required).

1.2 8086 Memory Addressing Modes

The 8086 provides 17 different ways to access memory. This may seem like quite a bit at first, but fortunately most of the address modes are simple variants of one another so they're very easy to learn. And learn them you should! The key to good assembly language programming is the proper use of memory addressing modes.

The addressing modes provided by the 8086 family include displacement-only, base, displacement plus base, base plus indexed, and displacement plus base plus indexed. Variations on these five forms provide the 17 different addressing modes on the 8086. See, from 17 down to five. It's not so bad after all!

1.2.1 The Displacement Only Addressing Mode

The most common addressing mode, and the one that's easiest to understand, is the displacement-only (or direct) addressing mode. The displacement-only addressing mode consists of a 16 bit constant that specifies the address of the target location. The instruction mov al,ds:[8088h] loads the al register with a copy of the byte at memory location 8088h. Likewise, the instruction mov ds:[1234h],dl stores the value in the dl register to memory location 1234h:

The displacement-only addressing mode is perfect for accessing simple variables. Of course, you'd probably prefer using names like "I" or "J" rather than "DS:[1234h]" or "DS:[8088h]". Well, fear not, you'll soon see it's possible to do just that.

Intel named this the displacement-only addressing mode because a 16 bit constant (displacement) follows the mov opcode in memory. In that respect it is quite similar to the direct addressing mode on the x86 processors (see the previous chapter). There are some minor differences, however. First of all, a displacement is exactly that- some distance from some other point. On the x86, a direct address can be thought of as a displacement from address zero. On the 80x86 processors, this displacement is an offset from the beginning of a segment (the data segment in this example). Don't worry if this doesn't make a lot of sense right now. You'll get an opportunity to study segments to your heart's content a little later in this chapter. For now, you can think of the displacement-only addressing mode as a direct addressing mode. The examples in this chapter will typically access bytes in memory. Don't forget, however, that you can also access words on the 8086 processors :

By default, all displacement-only values provide offsets into the data segment. If you want to provide an offset into a different segment, you must use a segment override prefix before your address. For example, to access location 1234h in the extra segment (es) you would use an instruction of the form mov ax,es:[1234h]. Likewise, to access this location in the code segment you would use the instruction mov ax, cs:[1234h]. The ds: prefix in the previous examples is not a segment override. The CPU uses the data segment register by default. These specific examples require ds: because of MASM's syntactical limitations.

1.2.2 The Register Indirect Addressing Modes

The 80x86 CPUs let you access memory indirectly through a register using the register indirect addressing modes. There are four forms of this addressing mode on the 8086, best demonstrated by the following instructions:

mov al, [bx]

mov al, [bp]

mov al, [si]

mov al, [di]

As with the x86 [bx]addressing mode, these four addressing modes reference the byte at the offset found in the bx, bp, si, or di register, respectively. The[bx], [si], and [di] modes use the dssegment by default. The[bp] addressing mode uses the stack segment (ss) by default.

You can use the segment override prefix symbols if you wish to access data in different segments. The following instructions demonstrate the use of these overrides:

mov al, cs:[bx]

mov al, ds:[bp]

mov al, ss:[si]

mov al, es:[di]

Intel refers to [bx] and [bp]as base addressing modes and bx and bp as base registers (in fact, bpstands for base pointer). Intel refers to the [si] and [di]addressing modes as indexed addressing modes (sistands for source index, di stands for destination index). However, these addressing modes are functionally equivalent. This text will call these forms register indirect modes to be consistent.

Note: the[si] and [di] addressing modes work exactly the same way, just substitute si and difor bx above.

1.2.3 Indexed Addressing Modes

The indexed addressing modes use the following syntax:

mov al, disp[bx]

mov al, disp[bp]

mov al, disp[si]

mov al, disp[di]

If bx contains 1000h, then the instructionmov cl,20h[bx] will load clfrom memory location ds:1020h. Likewise, if bp contains 2020h, mov dh,1000h[bp] will load dh from location ss:3020.

The offsets generated by these addressing modes are the sum of the constant and the specified register. The addressing modes involving bx, si,and di all use the data segment, the disp[bp]addressing mode uses the stack segment by default. As with the register indirect addressing modes, you can use the segment override prefixes to specify a different segment:

mov al, ss:disp[bx]

mov al, es:disp[bp]

mov al, cs:disp[si]

mov al, ss:disp[di]

You may substitute si or diin the figure above to obtain the [si+disp] and [di+disp]addressing modes.

Note that Intel still refers to these addressing modes as based addressing and indexed addressing. Intel's literature does not differentiate between these modes with or without the constant. If you look at how the hardware works, this is a reasonable definition. From the programmer's point of view, however, these addressing modes are useful for entirely different things. Which is why this text uses different terms to describe them. Unfortunately, there is very little consensus on the use of these terms in the 80x86 world.

1.2.4 Based Indexed Addressing Modes

The based indexed addressing modes are simply combinations of the register indirect addressing modes. These addressing modes form the offset by adding together a base register (bxor bp) and an index register (si or di). The allowable forms for these addressing modes are

mov al, [bx][si]

mov al, [bx][di]

mov al, [bp][si]

mov al, [bp][di]

Suppose that bxcontains 1000h and si contains 880h. Then the instruction

mov al,[bx][si]

would load alfrom location DS:1880h. Likewise, if bp contains 1598h and dicontains 1004,mov ax,[bp+di] will load the 16 bits in ax from locations SS:259C and SS:259D.

The addressing modes that do not involve bp use the data segment by default. Those that have bp as an operand use the stack segment by default.

You substitute diin the figure above to obtain the [bx+di] addressing mode.

You substitute diin the figure above for the[bp+di] addressing mode.

1.2.5 Based Indexed Plus Displacement Addressing Mode

These addressing modes are a slight modification of the base/indexed addressing modes with the addition of an eight bit or sixteen bit constant. The following are some examples of these addressing modes:

mov al, disp[bx][si]

mov al, disp[bx+di]

mov al, [bp+si+disp]

mov al, [bp][di][disp]

You may substitute diin the figure above to produce the [bx+di+disp] addressing mode.

You may substitute diin the figure above to produce the [bp+di+disp] addressing mode.

Suppose bp contains 1000h, bx contains 2000h, sicontains 120h, and di contains 5. Then mov al,10h[bx+si] loads al from address DS:2130; mov ch,125h[bp+di]loads ch from location SS:112A; and mov bx,cs:2[bx][di] loads bx from location CS:2007.

1.2.6 MASM Syntax for 8086 Memory Addressing Modes

Microsoft's assembler uses several different variations to denote indexed, based/indexed, and displacement plus based/indexed addressing modes. You will see all of these forms used interchangeably throughout this text. The following list some of the possible combinations that are legal for the various 80x86 addressing modes:

disp[bx], [bx][disp], [bx+disp], [disp][bx], and [disp+bx]

[bx][si], [bx+si], [si][bx], and [si+bx]

disp[bx][si], disp[bx+si], [disp+bx+si], [disp+bx][si], disp[si][bx], [disp+si][bx], [disp+si+bx], [si+disp+bx], [bx+disp+si], etc.

MASM treats the "[ ]" symbols just like the "+" operator. This operator is commutative, just like the "+" operator. Of course, this discussion applies to all the 8086 addressing modes, not just those involving BX and SI. You may substitute any legal registers in the addressing modes above.

1.2.7 An Easy Way to Remember the 8086 Memory Addressing Modes

There are a total of 17 different legal memory addressing modes on the 8086: disp, [bx], [bp], [si], [di], disp[bx], disp[bp], disp[si], disp[di], [bx][si], [bx][di], [bp][si], [bp][di], disp[bx][si], disp [bx][di], disp[bp][si], and disp[bp][di]. You could memorize all these forms so that you know which are valid (and, by omission, which forms are invalid). However, there is an easier way besides memorizing these 17 forms. Consider the chart:

If you choose zero or one items from each of the columns and wind up with at least one item, you've got a valid 8086 memory addressing mode. Some examples:

  • Choose disp from column one, nothing from column two, [di] from column 3, you get disp[di].
  • Choose disp, [bx], and [di]. You get disp[bx][di].
  • Skip column one & two, choose [si]. You get [si]
  • Skip column one, choose [bx], then choose [di]. You get [bx][di]

Likewise, if you have an addressing mode that you cannot construct from this table, then it is not legal. For example, disp[dx][si] is illegal because you cannot obtain [dx] from any of the columns above.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

The DAA instruction in the 8085 only accesses internal registers, so it has no addressing mode. At best, it can be considered an implicit mode instruction.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

The MVI instruction is Move Immediate. It uses immediate mode addressing, meaning that the operand is contained within the instruction, i.e. immediately following it.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

The address is contained in the instruction. For instance, in LDA 1234H, the address is 1234H.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

What microprocessor? It matters.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

addersing modes of 8086 microprocessor

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Explain the different types of addressing modes in 8086 microprocessor?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are addressing mode in microprocessor?

Addressing modes of 8051 are 1.Immediate Addressing Mode 2.Register Addressing Mode 3.Register Indirect Addressing Mode 4.Direct Addressing Mode 5.Implied Addressing Mode and 6.Relative Addressing Mode


Why does 8086 have more registers and addressing modes than 8085?

different architecture.


What is the purpose of addressing modes?

addressing modes helps the programmer to store or retrieve the data which is stored in any part of the data memory by addressing mode specified in the program.


What is a addressing modes?

addressing mode is used to form an instruction format.


What are the different types of addressing modes?

literal and absolute direct are the registers


What are advantages and disadvantages of addressing modes?

nvbn


How does 8085 access data from memory location?

Data can be accessed from memory by using the addressing modes, 8085 has 5 addressing modes namely,1. Immediate addressing mode 2. register addressing mode 3. direct addressing mode 4. indirect addressing mode 5. implied addressing mode


How many addressing mode of 8086 assembly language program?

there are five addressing modes in 8086 they are : 1->direct addressing 2->Indirect addressing 3->index addressing 4->immediate addressing 5->register addressing


Difference between types of displacement addressing modes?

wewe


What are the addressing modes of an Intel core I3 support?

ds


What are two adressing modes used in formulae?

absolute and relative cell addressing


Explain different types of addressing mode?

Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand (or operands) of each instruction. An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere.Number of addressing modesDifferent computer architectures vary greatly as to the number of addressing modes they provide in hardware. There are some benefits to eliminating complex addressing modes and using only one or a few simpler addressing modes, even though it requires a few extra instructions, and perhaps an extra register.[1] It has proven[citation needed] much easier to design pipelined CPUs if the only addressing modes available are simple ones. Most RISC machines have only about five simple addressing modes, while CISC machines such as the DEC VAX supermini have over a dozen addressing modes, some of which are quite complicated. The IBMSystem/360 mainframe had only three addressing modes; a few more have been added for the System/390.When there are only a few addressing modes, the particular addressing mode required is usually encoded within the instruction code (e.g. IBM System/390, most RISC). But when there are lots of addressing modes, a specific field is often set aside in the instruction to specify the addressing mode. The DEC VAX allowed multiple memory operands for almost all instructions, and so reserved the first few bits of each operand specifier to indicate the addressing mode for that particular operand. Keeping the addressing mode specifier bits separate from the opcode operation bits produces an orthogonal instruction set.Even on a computer with many addressing modes, measurements of actual programs[citation needed] indicate that the simple addressing modes listed below account for some 90% or more of all addressing modes used. Since most such measurements are based on code generated from high-level languages by compilers, this reflects to some extent the limitations of the compilers being used