0% found this document useful (0 votes)
103 views13 pages

Addressing Modes - GeeksforGeeks

The document discusses addressing modes in the 8086 microprocessor, which define how operands are specified in instructions. It categorizes addressing modes into data and branch modes, detailing various types such as implied, immediate, register, and indirect addressing modes, along with their uses and examples. Additionally, it highlights the advantages of addressing modes for programming flexibility and efficiency.

Uploaded by

anneanitap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views13 pages

Addressing Modes - GeeksforGeeks

The document discusses addressing modes in the 8086 microprocessor, which define how operands are specified in instructions. It categorizes addressing modes into data and branch modes, detailing various types such as implied, immediate, register, and indirect addressing modes, along with their uses and examples. Additionally, it highlights the advantages of addressing modes for programming flexibility and efficiency.

Uploaded by

anneanitap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Addressing Modes

Last Updated : 14 Feb, 2023

Addressing Modes– The term addressing modes refers to the way in


which the operand of an instruction is specified. The addressing mode
specifies a rule for interpreting or modifying the address field of the
instruction before the operand is actually executed.

Addressing modes for 8086 instructions are divided into two categories:

1) Addressing modes for data

2) Addressing modes for branch

The 8086 memory addressing modes provide flexible access to memory,


allowing you to easily access variables, arrays, records, pointers, and
other complex data types. The key to good assembly language
programming is the proper use of memory addressing modes.

An assembly language program instruction consists of two parts

The memory address of an operand consists of two components:

IMPORTANT TERMS

Starting address of memory segment.


Effective address or Offset: An offset is determined by adding any
combination of three address elements: displacement, base and index.

Displacement: It is an 8 bit or 16 bit immediate value given in


We use cookies to ensure
the you have the best browsing experience on our website.
instruction.
By using our site, you acknowledge that you have read and understood our
Base: Contents of base register, BX or BP. Got It !
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
Index: mobile
Content of index register SI or DI.
applications.

According to different ways of specifying an operand by 8086
microprocessor, different addressing modes are used by 8086.

Addressing modes used by 8086 microprocessor are discussed below:

Implied mode:: In implied addressing the operand is specified in the


instruction itself. In this mode the data is 8 bits or 16 bits long and data
is the part of instruction.Zero address instruction are designed with
implied addressing mode.

Example: CLC (used to reset Carry flag to 0)

Immediate addressing mode (symbol #):In this mode data is present in


address field of instruction .Designed like one address instruction
format.
Note:Limitation in the immediate mode is that the range of constants
are restricted by size of address field.

Example: MOV AL, 35H (move the data 35H into AL register)

Register mode: In register addressing the operand is placed in one of 8


bit or 16 bit general purpose registers. The data is in the register that is
specified by the instruction.
Here one register reference is required to access the data.
We use cookies to ensure you have the best browsing experience on our website.
By using our site, you acknowledge that you have read and understood our
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.
Example: MOV AX,CX (move the contents of CX register to AX
register)

Register Indirect mode: In this addressing the operand’s offset is


placed in any one of the registers BX,BP,SI,DI as specified in the
instruction. The effective address of the data is in the base register or
an index register that is specified by the instruction.
Here two register reference is required to access the data.

The 8086 CPUs let you access memory indirectly through a register
using the register indirect addressing modes.

MOV AX, [BX](move the contents of memory location s


addressed by the register BX to the register AX)

Auto Indexed (increment mode): Effective address of the operand is the


contents of a register specified in the instruction. After accessing the
operand, the contents of this register are automatically incremented to
point to the next consecutive memory location.(R1)+.
Here one register reference,one memory reference and one ALU
operation is required to access the data.
Example:

Add R1, (R2)+ // OR


R1 = R1 +M[R2]
R2 = R2 + d

Useful for stepping through arrays in a loop. R2 – start of array d – size


of an element

Auto indexed ( decrement mode): Effective address of the operand is


the contents
We use cookies of have
to ensure you a register specified
the best browsing in the on
experience instruction.
our website. Before accessing
By using our site, you acknowledge that you have read and understood our
the operand, the contents of this register are automatically
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
decremented tomobile to the previous consecutive memory location. –
pointapplications.
(R1)
Here one register reference,one memory reference and one ALU
operation is required to access the data.
Example:

Add R1,-(R2) //OR


R2 = R2-d
R1 = R1 + M[R2]

Auto decrement mode is same as auto increment mode. Both can also be
used to implement a stack as push and pop . Auto increment and Auto
decrement modes are useful for implementing “Last-In-First-Out” data
structures.

Direct addressing/ Absolute addressing Mode (symbol [ ]): The


operand’s offset is given in the instruction as an 8 bit or 16 bit
displacement element. In this addressing mode the 16 bit effective
address of the data is the part of the instruction.
Here only one memory reference operation is required to access the
data.

Example:ADD AL,[0301] //add the contents of offset


address 0301 to AL

Indirect addressing Mode (symbol @ or () ):In this mode address field


of instruction contains the address of effective address.Here two
references are required.
1st reference to get effective address.
2nd reference to access the data.
Based on the availability of Effective address, Indirect mode is of two
We use cookies to ensure you have the best browsing experience on our website.
kind:
By using our site, you acknowledge that you have read and understood our
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.
1. Register Indirect:In this mode effective address is in the register, and
corresponding register name will be maintained in the address field
of an instruction.
Here one register reference,one memory reference is required to
access the data.
2. Memory Indirect:In this mode effective address is in the memory,
and corresponding memory address will be maintained in the
address field of an instruction.
Here two memory reference is required to access the data.

Indexed addressing mode: The operand’s offset is the sum of the


content of an index register SI or DI and an 8 bit or 16 bit displacement.

Example:MOV AX, [SI +05]

Based Indexed Addressing: The operand’s offset is sum of the content


of a base register BX or BP and an index register SI or DI.

Example: ADD AX, [BX+SI]

Based on Transfer of control, addressing modes are:

PC relative addressing mode: PC relative addressing mode is


used to implement intra segment transfer of control, In this mode
effective address is obtained by adding displacement to PC.

EA= PC + Address field value


PC= PC + Relative value.

Base register addressing mode:Base register addressing mode is


used to implement inter segment transfer of control.In this mode
effective address is obtained by adding base register value to
address field value.

EA= Base
We use cookies to ensure register
you have + Address
the best browsing field
experience value.
on our website.
By using our site,PC= Base register
you acknowledge + Relative
that you have value.our
read and understood
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.
Note:
1. PC relative and based register both addressing modes are
suitable for program relocation at runtime.
2. Based register addressing mode is best suitable to write
position independent codes.

Advantages of Addressing Modes

1. To give programmers to facilities such as Pointers, counters for loop


controls, indexing of data and program relocation.
2. To reduce the number bits in the addressing field of the Instruction.

Sample GATE Question

Match each of the high level language statements given on the left hand
side with the most natural addressing mode from those listed on the right
hand side.

1. A[1] = B[J]; a. Indirect addressing


2. while [*A++]; b. Indexed addressing
3. int temp = *x; c. Autoincrement

(A) (1, c), (2, b), (3, a)


(B) (1, a), (2, c), (3, b)
(C) (1, b), (2, c), (3, a)
(D) (1, a), (2, b), (3, c)

Answer: (C)

Explanation:

List 1 List 2
1) A[1] = B[J]; b) Index addressing
Here indexing is used

We use 2) while
cookies [*A++];
to ensure c) browsing
you have the best auto increment
experience on our website.
By using
Theour site, you locations
memory acknowledge that
areyouautomatically
have read and understood our
incremented
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.
3) int temp = *x; a) Indirect addressing
Here temp is assigned the value of int type stored
at the address contained in X

Hence (C) is correct solution.

lease write comments if you find anything incorrect, or you want to share
more information about the topic discussed above.

Are you a student in Computer Science or an employed professional


looking to take up the GATE 2025 Exam? Of course, you can get a good
score in it but to get the best score our GATE CS/IT 2025 - Self-Paced
Course is available on GeeksforGeeks to help you with its preparation. Get
comprehensive coverage of all topics of GATE, detailed explanations, and
practice questions for study. Study at your pace. Flexible and easy-to-
follow modules. Do well in GATE to enhance the prospects of your career.
Enroll now and let your journey to success begin!

P Pooja Taneja 210


We use cookies to ensure you have the best browsing experience on our website.
By using our site, you acknowledge that you have read and understood our
Previous
Cookie Policy & PrivacyArticle
Policy Cookies are not collected in the GeeksforGeeks Next Article
mobile applications.
Difference between assembly language Difference between Memory based and
and high level language Register based Addressing Modes

Similar Reads

Difference between Implied addressing mode and Immediate…


In computer architecture the addressing modes play a vital role in defining
how the operands of the instructions are to be retrieved. The two are…
5 min read

Difference between Relative Addressing Mode and Direct…


Addressing modes are methods utilise by a CPU in computer architecture to
access data stored in memory. It is in this respect that different addressing…
5 min read

Addressing modes in 8085 microprocessor


Prerequisite - Addressing modes The 8085 microprocessor has several
addressing modes that are used to access memory locations. Some of the…
9 min read

Addressing modes in 8086 microprocessor


Prerequisite - Addressing modes, Addressing modes in 8085
microprocessor The way of specifying data to be operated by an instructio…
2 min read

Difference between Memory based and Register based Addressing…


Prerequisite - Addressing Modes Addressing modes are the operations field
specifies the operations which need to be performed. The operation must …
4 min read

We use cookies to ensure you have the best browsing experience on our website.
By using our site, you acknowledge that you have read and understood our
Difference between Indirect and Immediate Addressing Modes
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.
Prerequisite - Addressing Modes 1. Indirect Addressing Mode: In indirect
addressing mode, the address field in the instruction points to the memory…
2 min read

Difference between Direct and Implied Addressing Modes


Prerequisite - Addressing Modes 1. Direct Addressing Mode : In direct
addressing mode, the address field contains the address of the operand.…
2 min read

Data Types and Addressing Modes of 80386/80386DX…


Data types are an important part of microprocessor programming. They
specify the types of data that can be stored in variables and the operations…
5 min read

Difference between Indirect and Implied Addressing Modes


Indirect and implied addressing modes are two common techniques used to
specify the memory address of an operand for an instruction in computer…
5 min read

Difference between PC relative and Base register Addressing Modes


In computer architecture addressing modes are very important since they
show how the processor accesses data in memory. The two are the…
5 min read

Difference between Direct and Immediate Addressing Modes


Whenever an instruction is execute it require the operands to be operated
own. The operand means the data. There are different ways of getting…
4 min read

Difference between Direct and Indirect Addressing Modes


We use cookies to ensure you have the best browsing experience on our website.
Prerequisite: Addressing Modes1. Direct Addressing Mode: In direct
By using our site, you
addressing acknowledge
mode, that youfield
the address have in
read and
the understood our
instruction contains
the effective…
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
3 min read
mobile applications.
8085 program to swap two 16 bit numbers using Direct addressing…
Problem - Write a program to swap two 16-bit numbers using direct
addressing mode where starting address is 2000 and the first 16-bit numb…
2 min read

8085 program to swap two 8 bit numbers using Direct addressing…


Problem - Write a program to swap two 8-bit numbers using direct
addressing mode where starting address is 2000 and the first 8-bit number…
2 min read

68000 Family Registers and Addressing In Computer Architecture


The 68000 processor is characterized by a 16-bit external word length as the
processor chip has 16 data pins for connection to the memory. However,…
5 min read

8255 microprocessor operating modes


Introduction: The 8255 microprocessor is an input/output (I/O) device that
can be used to interface with various peripheral devices. It has three…
6 min read

Operating modes of 8259 PIC


Prerequisites: 8259 PIC8259 PIC is designed for the 8085 and 8086
microprocessor's series. Need For PIC in 8085 and 8086 : In 8086 we have…
5 min read

Operating Modes of 80386 Microprocessors


The Intel 80386 microprocessor, often known as the i386, was a popular
x86-based microprocessor. Its capacity to run in numerous modes, which…
3 min read

We use cookies to ensure you have the best browsing experience on our website.
By using our site, you acknowledge that you have read and understood our
Modes of DMA Transfer
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.
In this article we will try to understand the details associated with the DMA
(Direct Memory Access) like what exactly DMA is or how it works and also…
5 min read

Architecture of 8085 microprocessor


Introduction : The 8085 microprocessor is an 8-bit microprocessor that was
developed by Intel in the mid-1970s. It was widely used in the early days of…
13 min read

Article Tags : Computer Organization & Architecture

Corporate & Communications


Address:- A-143, 9th Floor, Sovereign
Corporate Tower, Sector- 136, Noida,
Uttar Pradesh (201305) | Registered
Address:- K 061, Tower K, Gulshan
Vivante Apartment, Sector 137,
Noida, Gautam Buddh Nagar, Uttar
Pradesh, 201305

Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
We use cookies to ensure you have the best browsing experience on our website.
Advertise with us Master System Design
By using our site, you acknowledge that you have read and understood our
GFG Corporate Solution
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks Master CP
Placement Training Program
mobile applications. GeeksforGeeks Videos
Geeks Community

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial

Data Science & ML Web Technologies


Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning JavaScript
ML Maths TypeScript
Data Visualisation ReactJS
Pandas NextJS
NumPy NodeJs
NLP Bootstrap
Deep Learning Tailwind CSS

Python Tutorial Computer Science


Python Programming Examples GATE CS Notes
Django Tutorial Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Tutorial Digital Logic Design
Python Interview Question Engineering Maths

DevOps System Design


Git High Level Design
AWS Low Level Design
Docker UML Diagrams
Kubernetes Interview Guide
Azure Design Patterns
GCP OOAD
DevOps Roadmap System Design Bootcamp
Interview Questions

We use cookies to ensure you have the best browsing experience on our website.
School Subjects Commerce
By using our site, you acknowledge that you have read and understood our
Mathematics Accountancy
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
Physics Business Studies
mobile applications.
Chemistry Economics
Biology Management
Social Science HR Management
English Grammar Finance
Income Tax

Databases Preparation Corner


SQL Company-Wise Recruitment Process
MYSQL Resume Templates
PostgreSQL Aptitude Preparation
PL/SQL Puzzles
MongoDB Company-Wise Preparation
Companies
Colleges

Competitive Exams More Tutorials


JEE Advanced Software Development
UGC NET Software Testing
UPSC Product Management
SSC CGL Project Management
SBI PO Linux
SBI Clerk Excel
IBPS PO All Cheat Sheets
IBPS Clerk Recent Articles

Free Online Tools Write & Earn


Typing Test Write an Article
Image Editor Improve an Article
Code Formatters Pick Topics to Write
Code Converters Share your Experiences
Currency Converter Internships
Random Number Generator
Trending Now DSA Web Tech Foundational Courses Data Science Practice Problem Python
Random Password Generator

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

We use cookies to ensure you have the best browsing experience on our website.
By using our site, you acknowledge that you have read and understood our
Cookie Policy & Privacy Policy Cookies are not collected in the GeeksforGeeks
mobile applications.

You might also like