Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

A PROJECT REPORT ON

“Addressing Modes”
Submitted in partial fulfilment of the requirements of the award of degree
Of
DIPLOMA ENGINEERING
In

Computer Engineering

BY:-

1. Mrunali Nagesh Kulkarni


2. Sakshi Rameshwar Dukare
3. Suhani Satish Mundhe
4. Sanchita Hari Kulkarni

UNDER THE GUIDANCE:

Mr. A. B. Rupnar

SVERI’S
COLLEGE OF ENGINEERING (POLY).
PANDHARPUR 2023-24

1
CERTIFICATE

The project report entitled “Addressing Modes”

Submitted by:

1. Mrunali Nagesh Kulkarni


2. Sakshi Rameshwar Dukare
3. Suhani Satish Mundhe
4. Sanchita Hari Kulkarni

Is approved for the Diploma of Engineering in Computer from SVERI’S College of


Engineering (Polytechnic), Pandharpur.

Name of Guide Name of H.O.D


(Mr. A. B. Rupnar) (Mr.P.S.Bhandare)
Department of Computer Engineering Department of Computer Engineering
SVERI’S COE (Poly), Pandharpur. SVERI’S COE (Poly), Pandharpur.

Examiner Principal
(Prof. ) (Prof. Dr.N.D. Misal)
Place: Pandharpur
Date:

2
Annexure II
Evolution sheet for Micro Project
Academic Year: - 2023-24 Name of Faculty: -Mr.A.B.Rupnar
Course: - Computer Engineering Course code: - CO4I
Subject: -Microprocessor Subject Code: -22415
th
Semester:- 4 Scheme: - I
Title of
Addressing Modes
Project: -
COs addressed by the Micro Project:
CO3 c. Use instructions for different addressing modes.
Major Learning Outcomes achieved by students by doing the Project:

(a)Practical Outcomes: 2. Use Assembly Language Programming Tools and functions

(b) Unit Outcomes in 3b. Describe the given addressing modes with examples.
Cognitive domain:

(c) Outcomes in c. Demonstrate working as a leader/a team member.


Affective Domain: d. Follow ethical practices.

Comments/Suggestions about teamwork/leadership/inter-personal communication (if any)

Marks out Marks out


of 6 for of 4 for Total marks
Roll No Name of student performan performance in out of 10
ce in group oral/Presentatio
activity n
01 Mrunali Nagesh Kulkarni
02 Sakshi Rameshwar Dukare
21 Suhani Satish Mundhe
37 Sanchita Hari Kulkarni
Name &
Signature of Name: Mr. A. B. Rupnar Signture:
faculty

3
ACKNOWLEDGEMENT

I take this opportunity to express my sincere thanks and deep sense of gratitude to my
guide, Mr. A. B. Rupnar Sir for his constant support, motivation, valuable guidance and
immense help during the entire course of this work. Without his constant encouragement,
timely advice and valuable discussion, it would have been difficult in completing this work. I
would also like to acknowledge Computer Engineering department who provided me the
facilities for completion of the project. We are thankful to his for sharing his experienced in
research field with me and providing constant motivation during entire project work.

Name of Student:-

1. Mrunali Nagesh Kulkarni


2. Sakshi Rameshwar Dukare
3. Suhani Satish Mundhe
4. Sanchita Hari Kulkarni

4
Addressing Modes

1 Rationale:
Microprocessor is the main component of computer where 8086 is the base of all upward developed
processors till current processors. This course will cover the basics of 8086 and its architecture along with
instruction set, assembly language programming with effective use of procedure and macros. This course
also covers the architectural issues such as instruction set program and data types. On top that, the students
are also introduced to the increasingly important area of parallel organization. This subject serves as a basic
to develop hardware related projects. This course will enable the students to inculcate assembly language
programming concepts and methodology to solve problems.

2 Aim/Benefits of the Micro-project:


The aim of this course is to help the student to attain the following industry
identified competency through various teaching learning experiences:
 Build digital systems including microprocessor based systems.

3 Course Outcomes Achieved:


c. Use instructions for different addressing modes.

4 Literature Review:
Addressing modes in the Intel 8086 microprocessor have been extensively studied for reflecting their
fundamental role in assembly language programming and system- level optimization. Researchers have
investigated various aspects of addressing modes, ranging from their syntax and semantics to their impact
on code efficiency and performance. Studies often delve into the different addressing modes supported by
the 8086, including direct, indirect, register, and memory-based modes, analyzing their strengths,
weaknesses, and practical applications. Furthermore, research has examined the implications of addressing
modes on compiler design and optimization strategies, highlighting the importance of efficient code
generation and memory management techniques for maximizing system performance on the 8086 platform.

5
Introduction:

Addressing modes stand as the bedrock of computer architecture, serving as the bridgebetween
instructions and data within a computing system. In the landscape of digital computing, addressing
modes dictate how processors access operands in memory or registers, laying the groundwork for
efficient and effective program execution. This foundational concept forms the cornerstone of
computer science and engineering, influencing the design, performance, and versatility of computing
systems across diverse applications and platforms.

This exploration delves into the intricate realm of addressing modes, aiming to unravel their
significance and impact within computer architecture. From immediate and direct to indirect and
indexed addressing, each mode brings its unique approach to operand retrieval, shaping the landscape
of instruction set architecture (ISA) and programming paradigms. Through this comprehensive
examination, we seek to elucidate the inner workings of addressing modes, unraveling their roles in
enhancing computational efficiency, reducing memory overhead, and enabling the seamless execution
of complex tasks.

This study embarks on a journey to dissect the nuances of addressing modes, traversing through their
theoretical underpinnings, practical implications, and real-world applications. By dissecting case
studies, analyzing performance metrics, and exploring optimization strategies, we aspire to unlock the
potential of addressing modes in driving innovation and advancement within computer architecture. As
we navigate this terrain, we anticipate uncovering insights that will not only enrich our understanding
of addressing modes but also inspire new avenues for optimizing and revolutionizing computing
systems in the digital age.

6
 Addressing Modes in 8086 Microprocessor
Addressing modes are a crucial aspect of computer architecture and assembly languageprogramming.
They define how the CPU accesses operands, which are typically data values or addresses, during
instruction execution. Different addressing modes offer flexibility and efficiency in accessing data and
instructions, allowing programmers to write concise and efficient code.

Here are some common addressing modes:

1. Immediate Addressing Mode

2. Direct Addressing Mode

3. Register Indirect Addressing Mode

4. Register Addressing Mode

5. Indexed Addressing Mode

6. Register Relative Addressing Mode

7. Based Indexed Addressing Mode

8. Relative Based Indexed Addressing Mode

7
1. Immediate Addressing Mode :

Immediate addressing mode is a fundamental technique utilized in computer programming


and microprocessor architecture. In this mode, the operand is directly specified within the instruction
itself, rather than being stored in memory or registers. This means that the value to be operated on is
embedded directly into the instruction, allowing for quick access and manipulation without the need
for additional memory accesses. Immediate addressing is particularly useful for operations involving
constantsor literals, as it eliminates the need to load values from memory into registers before
performing the desired operation.

One key advantage of immediate addressing mode is its efficiency in executinginstructions.


Since the operand is included directly within the instruction, there is no overhead associated with
accessing memory or registers to retrieve the operand. This can result in faster execution times,
especially for simple arithmetic or logical operations that involve constants. Additionally, immediate
addressing mode allows for more compact code, as there is no need to reserve extra memory or
registers to store operands. However, one limitation of immediate addressing is that it may not be
suitable for operations involving large data sets, as the size of the instruction may become
prohibitively large. Nonetheless, immediate addressing remains a crucial component of instruction
sets in various microprocessors and programming languages.

Ex. MOV DX, 0525H

8
2. Direct Addressing Mode :

Direct addressing mode is one of the fundamental addressing modes utilizedin computer
architecture and assembly language programming. In this mode, the operand or the data to be
manipulated is directly specified in the instruction itself. The address of the operand is explicitly
provided within the instruction, allowing the processor to access the data directly from memory. This
mode is simple and straightforward, making it easy to implement and understand. However, it also
has limitations, such as the inability to accommodate variables or dynamically changing data locations
without modifying the instruction set. Despite its limitations, direct addressing mode is commonly
used in many basic computing tasks and is essential for foundational understanding of computer
architecture.

In assembly language programming, direct addressing mode is denoted byspecifying the


memory address of the operand directly in the instruction. For example,in the instruction "MOV AX,
[1234H]", the value stored at memory address 1234H ismoved into the AX register. This mode is
efficient for accessing fixed memory locations and is often used for accessing constants or predefined
data structures.
However, it lacks flexibility compared to other addressing modes like indirect or indexed addressing,
which can dynamically determine the memory address based on thecontent of registers or other
variables. Despite its limitations, direct addressing mode remains a crucial component of assembly
language programming and computer architecture due to its simplicity and efficiency for accessing
specific memory locations.

Ex. MOV AX, [1234H]

9
3. Register Indirect Addressing Mode :
Register Indirect addressing mode is a method used in computer architectureto access
memory locations indirectly through the contents of a register. Instead of specifying the memory
address directly in the instruction, the instruction contains the register number which holds the address
of the data to be accessed. This mode offers flexibility and efficiency in programming, as it allows for
dynamic memory access without the need to hardcode memory addresses into instructions. Moreover,
it enables the programmer to work with different memory locations without modifying the instruction
set, making the code more adaptable and reusable.

In Register Indirect addressing mode, the processor retrieves the memory address from
the specified register and then accesses the data at that address. This modeis commonly used in
situations where the memory location may change frequently during program execution or where the
programmer wants to perform operations on data stored in different memory locations without having
to modify the instruction itself. Register Indirect addressing mode is prevalent in many modern
computer architectures and is particularly useful in applications where efficient memory management
and dynamic data manipulation are essential, such as in operating systems,device drivers, and real-time
systems.

Ex. MOV AX,[BX]

10
4. Register Addressing Mode:
Register addressing mode is a fundamental concept in computer architecture and
assembly language programming. In this addressing mode, the operand of an instruction is held in
a CPU register rather than in memory. CPUs typically have a set of general-purpose registers that
can be directly accessed by instructions. When using the register addressing mode, the instruction
specifies the register containing the operand rather than providing a memory address. This mode
offers fast and efficient operation since accessing data from registers is much quickerthan accessing
data from memory. Additionally, it reduces memory traffic, which canimprove overall system
performance, especially in situations where data needs to be accessed frequently or manipulated
rapidly.
One of the key advantages of the register addressing mode is its speed and
efficiency. Since data is stored and manipulated directly within the CPU registers, there is no need
to access memory, which can introduce delays due to memory latency and bandwidth limitations.
This makes register addressing mode particularly useful in performance-critical applications such
as real-time systems, embedded systems, and high-performance computing. Furthermore, register
addressing mode allows for concise and optimized code, as it minimizes the need formemory
access instructions and associated address calculations. However, a limitation of this addressing
mode is the finite number of registers available in a CPUarchitecture, which can restrict the
complexity and size of programs that can be efficiently executed using register addressing mode
alone.

Ex. MOV CX, AX

11
5. Indexed Addressing Mode :
Indexed addressing mode is a memory addressing technique commonly used in
computer architectures. In this mode, the operand's address is determined by adding a constant
offset to the contents of a register, called the index register. The index register holds a value that is
added to the base address to calculate the effectiveaddress. This mode is particularly useful for
accessing elements in arrays or data structures stored in memory. By incrementing or decrementing
the index register appropriately, consecutive elements of an array can be accessed efficiently.
Indexed addressing mode is often seen in processor architectures like x86 and ARM, where it
provides flexibility and efficiency in accessing memory locations.

One advantage of indexed addressing mode is its ability to support data structures with
dynamic or variable sizes. Since the offset added to the index register can be modified during
program execution, the effective address can change dynamically based on the requirements of the
program. This flexibility makes indexedaddressing mode suitable for tasks such as iterating through
arrays of unknown lengthor accessing elements of data structures whose sizes are determined at
runtime.
Additionally, indexed addressing mode can enhance program efficiency by reducingthe number of
memory access instructions required to access consecutive elements inmemory, thereby improving
overall performance. Overall, indexed addressing modeis a versatile and efficient memory
addressing technique widely used in modern computer architectures.

Ex. MOV BL,[SI]

12
6. Register Relative Addressing Mode :
Register relative addressing mode is a type of addressing mode commonly used in
computer architectures where the effective address of an operand iscalculated by adding an offset
value to the contents of a register. In this mode, the offset value serves as a displacement from the
base address stored in the register. The advantage of register relative addressing mode lies in its
efficiency and flexibility.
Since the base address is stored in a register, it eliminates the need to access memory for the base
address, which can significantly reduce the number of memory accesses required for address
calculation. This can lead to improved performance, especially insituations where frequent memory
accesses are needed, such as in loops or subroutinecalls.

One common application of register relative addressing mode is in accessing elements of


arrays or data structures. By storing the base address of the array or structure in a register, the offset
values can be added to this base address to access individual elements efficiently. Additionally,
register relative addressing modeallows for more flexible and dynamic memory management as the
contents of the register can be easily modified during program execution to point to different
memory locations. This flexibility makes it particularly useful in systems with limited memory
resources or where memory allocation needs to be dynamic and adaptive. Overall, register relative
addressing mode offers a balance between efficiency and flexibility, making it a valuable feature in
computer architectures.

Ex. MOV CX ,43H[SI]

13
7. Based Indexed Addressing Mode :
Based indexed addressing mode is a memory addressing scheme commonly used in
computer architecture. In this mode, the address of the operand is determined by adding a base
address to an index or offset value. The base address typically pointsto the beginning of a data
structure or an array, while the index or offset specifies the position of the desired element within
that structure. This mode is particularly useful for accessing elements of arrays or structures in
memory efficiently.

One advantage of based indexed addressing mode is its flexibility and versatility. Itallows
programs to access memory locations dynamically without needing to hardcode specific addresses,
making code more adaptable and easier to maintain.
Additionally, by using relative offsets rather than absolute addresses, based indexed addressing
mode facilitates the relocation of programs in memory, which can be essential for multitasking
operating systems and virtual memory systems. This addressing mode is commonly found in
modern computer architectures and is widelyused in high-level programming languages to
implement data structures such as arrays, lists, and trees.

Ex. MOV AX, [BX][SI]

14
8. Relative Based Indexed Addressing Mode :
Relative-based indexed addressing mode is a addressing mode commonly utilized in
computer architectures, particularly in microprocessors. In this mode, the effective address of an
operand is calculated by adding a displacement value to the contents of a base register. The
displacement value represents a signed integer that specifies the offset or displacement from the
base address stored in the base register. Additionally, an index register may be used to further
modify the effective address byadding or subtracting another value. This mode is particularly useful
in situations where data or instructions are located at variable distances from a known point in
memory. For example, in some assembly language programming, relative-based indexed
addressing mode can be employed to access elements of arrays or to performoperations on data
structures where the exact memory location is not known in advance but can be calculated relative
to a base address.

One notable advantage of relative-based indexed addressing mode is its flexibility and
efficiency in accessing memory locations, especially in situations where data structures are
dynamically allocated or when dealing with arrays of varying sizes. By utilizing displacement
values and index registers, programmers canaccess memory locations relative to a base address
without needing to hardcode absolute memory addresses, which enhances the portability and
maintainability of code. However, it's crucial to handle sign extension properly when dealing with
signed displacements to ensure correct memory access. Overall, relative-based indexed addressing
mode offers a versatile approach to memory addressing in computer architectures, allowing for
efficient manipulation of data structures and facilitating the development of more flexible and
modular code.

Ex. MOV CL,1234H [BX] [SI]

15
 CONCLUSION :

In conclusion, the comprehensive exploration of addressing modes within microprocessorsrepresents


a pivotal aspect of assembly language programming and system-level optimization. Through the
detailed examination of various addressing modes, including direct, indirect, register, and memory-
based modes, this project has elucidated their uniquecharacteristics, advantages, and limitations.
Moreover, by delving into optimization strategies tailored to specific addressing modes such as code
reordering and memory access alignment, this study has underscored their significance in enhancing
program execution efficiency and overall system performance. Furthermore, the critical analysis of
the implications of addressing modes on compiler design and optimization strategies has highlighted
the imperative nature of efficient code generation and adept memory management techniques.
Consequently, this project not only enriches our understanding ofmicroprocessor architecture and
software development but also underscores the essential role that addressing modes play in shaping
the efficacy and performance of computing systems. Moving forward, the insights gleaned from this
research can serve as a foundation for future endeavors, potentially paving the way for advancements
in microprocessor design, software optimization, and computer architecture.

16
 REFERANCES:-

 Google

 ChatGPT

 Textbook

17

You might also like