Home » Embedded Systems

Program Memory Addressing Mode of 8086 Microprocessor

In the previous article Categories of Addressing Modes of 8086 microprocessors, we learned about a category- Program memory addressing mode. It was mentioned there that this category of addressing modes is further classified. In this article, we are going to study about the different addressing modes which lie within this Addressing Mode.
Submitted by Monika Sharma, on July 19, 2019

The Program Memory Addressing mode is used in branch instructions. These branch instructions are instructions which are responsible for changing the regular flow of the instruction execution and shifting the control to some other location. In 8086 microprocessor, these instructions are usually JMP and CALL instructions.

The Program memory Addressing Mode contains further three addressing modes within it. They are:

  1. Direct Program memory Addressing
  2. Indirect Program memory Addressing
  3. Relative Program memory Addressing

Let us study each of them in detail about their instructions and the way of processing by the microprocessor while executing them.

1) Direct Program Memory Addressing

In this addressing mode, the offset address where the control is to be shifted is defined within the instruction. This mode is called direct addressing mode because the required address is directly present in the instruction rather than being stored in some register.

Example:

    JMP 4032H

Here, the working of the above instruction will be as follows:

The current value of IP which holds the address of next instruction to be executed will be stored in the TOP OF THE STACK. Now, the IP will be replaced by the mentioned value, i.e. IP <- 4032H

Now, the Memory address is calculated as: (Contents of CS) X 10H + (contents of IP)

2) Indirect Program Addressing mode

As the name suggests, in this addressing mode, the offset address is not present directly in the instruction. It is rather stored in any of the CPU registers (Internal Register). So, the contents of the Instruction Pointer (IP) will be replaced by the contents of that register.

Example:

    JMP BX

Working:

Suppose that the content of the BX register is 0003H. So, the working of the microprocessor for executing the above instruction will be as follows:

            IP <- contents of BX
    i.e. 	IP <- 0003H

And the required memory address is calculated in a similar way as in Direct Addressing mode: (Contents of CS) X 10H + (contents of IP)

3) Relative Program Memory Addressing

In this Addressing mode, the offset address is equal to the content of the Instruction Pointer (IP) plus the 8 or 16-bit displacement. For the 8 bit displacement, SHORT is used and for 16-bit displacement, LONG is used. This type of displacement will only be intra-segment, i.e. within the segment.

Example:

    JMP SHORT OVER

Here, SHORT is used to represent the 8-bit displacement and OVER is the Label defined for any particular memory location.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.