Lecture 10:
Addressing Modes
Lecture by Engr.Javeria Barkat
Iqra University.
Prerequisite - Intro to parts of CPU
• Arithmetic and Logic Unit (ALU)
It performs all the arithmetic and
logical micro operations.
• Floating Point Unit (FPU)
It performs operations on floating
point numbers.
• Memory Unit (MU)
It stores the set of instructions.
• Control Unit (CU)
It supervises the sequence of
micro operations.
• Registers
Temporary storage area, which holds the
data during the execution of an
instruction.
CU
FPU
MU
REGISTERS
ALU
8-bit 8-bit 8-bit
OP CODE OPERAND
.1 byte 1 to 2 byte
 An opcode is a short of “operation code”
 An opcode is a single instruction can be executed by the CPU. In
assembly language mnemonic form an opcode is a command such
as MOV or ADD or JMP.
 Example:
MOV AX, 1000H ; MOV is the opcode.
; AX (register) is an operand.
 Operands are manipulated by the opcode. In this example,
the operands are the register AX and the value 1000H.
Opcode and Operand in Microprocessor
8086/8088
Purpose of Addressing modes
1.) To give programming flexibility to the user
by providing such facilities as pointers to
memory, counters for loop control, indexing
of data and various other purposes.
2.) To reduce the number of bits in the addressing
field of the instructions.
To understand the various addressing modes:
• It is imperative that we understand the basic operation cycle of
the computer.
The control unit of a computer is designed to go through
an instruction cycle that is divided into 3 major parts:-
Fetch the instruction from memory
Decode the instruction and
Execute the instruction.
• The operation field of an instruction specifies the
operation to be performed.
• This operation must be executed on the data stored in
computer registers or the memory words.
• The way the operands are chosen during program
execution is dependent on the addressing mode of the
instruction
Contd..
Addressing Modes
• Microprocessor executes the instructions stored in memory
(RAM).
• It executes one instruction at a time.
• Each of the instruction contains operations and operands.
• Operation specifies the type of action to be performed.
• For example: ADD, SUB, MOV, INC, LOAD, STORE
• Operands are the data on which the operation is to be
performed. MOV B, A
ADD B
Here MOV is operation and (B & A) are
operands.
Here ADD is operation and (B) is
operand.
Addressing Modes
• Operand can be place either in one of the processor register or
in memory.
• There are different ways to get the operands.
• The way in which the operand is taken from register or memory
is named as addressing mode.
THE ADDRESSING MODE:
Specifies a rule for interpreting or modifying the address field of the
instruction before the operand is actually referenced.
Addressing Modes in Microprocessor
8086/8088
Types of Addressing Modes:
(1) Stack-Memory Addressing Modes
(2) Data Addressing Modes
(3) Program-Memory Addressing Modes
1- Stack-Memory Addressing Modes in
Microprocessor 8086/8088
 The stack plays an important role in all
microprocessors.
 It holds data temporarily and stores return addresses for
procedures.
 The stack memory is a LIFO (last-in, first-out) memory, which
describes the way that data are stored and removed from the stack.
 Data are placed onto the stack with a PUSH instruction and
removed with a POP instruction.
 The CALL instruction also uses the stack to hold the return address
for procedures and a RET (return) instruction to remove the return
address from the stack.
Lecture 10
2. Data Addressing Modes
1. Immediate Addressing Mode
2. Direct Addressing Mode
3. Indirect Addressing Mode
4. Register Addressing Mode
5. Register Indirect Addressing Mode
6. Implied Addressing Mode
7. Auto increment or Auto decrement Addressing
Mode
8. Relative Addressing Mode
9. Indexed Addressing Mode
10. Base Register Addressing Mode
 An addressing mode means the method by which an
operand can be specified in a register or a memory
location
1.ImmediateAddressing
• Thesource data is coded directly into the
instruction.
– Theterm immediate means that the data immediately follows
the hexadecimal opcode inthe memory.
• Immediate data are constant data suchas anumber,
acharacter, or an arithmetic expression.
• Examples:
– MOVAX,100
– MOVBX,189CH
– MOVAH, 10110110B
– MOVAL,(2 +3)/5
Contd
• The operand is specified with in the instruction.
• Operand itself is provided in the instruction rather than its
address.
• In other words, an immediate-mode instruction has
an operand field rather than an address field.
• Move Immediate
MVI A , 15h A ←15h Here 15h is the immediate
operand
Add
Immediate
ADI 3Eh A ← A + 3Eh Here 3Eh is the immediate
operand
Immediate Addressing Mode
 Example:
MOV AX, 2550H
MOV CX, 625
MOV BL, 40H
; move 2550H into AX
; load the decimal value 625 into
CX
; load 40H into BL
 The data must first be moved to a general-purpose
register and then to the segment register.
 Example:
MOV AX, 2550H
MOV DS, AX
MOV DS, 0123H ; illegal instruction!
Immediate Addressing Mode
 Transfers the source, an immediate byte or word of data,
into the destination register or memory location
 The source operand is a constant
 The operand comes immediately after the opcode
 For this reason, this addressing mode executes quickly
 Immediate addressing mode can be used to load
information into any of the registers except the segment
registers and flag registers.
Concluding remarks of
Immediate Addressing Mode
Effective address:
• The effective address is defined to be the memory
address obtained from the computation dictated
by the given addressing mode.
• The effective address is the address of the
operand in a computational-type instruction.
Important note:
3.Direct Addressing
• Theoperand is stored in amemory location, usuallyin data
segment.
Theinstruction takes the offsetaddress.
–Thisoffset addressmust be put in abracket [].
•
In this mode the effective address is equal to the
address part of the instruction. The operand resides in
memory and its address is given directly by the
address field of the instruction.
Contd.
• The instruction specifies the direct address of the operand.
• The memory address is specified where the actual operand
is.
Load Accumulator
LDA 2805h A ← [2805]
It loads the data from memory location 2805 toA.
Store Accumulator
STA 2803h [2803] ← A
It stores the data from A to memory location 2803.
Direct Addressing Mode
LDA 2805h A ← [2805]
It loads the data from memory location 2805 to
A.
Before After
2807
2806
2805 5C
2804
2803
2802
2801
2800
A 2807
2806
2805 5C
2804
2803
2802
2801
2800
A 5C
A ←
[2805]
A ←
5C
Direct Addressing Mode
STA 2803h [2803] ← A
It stores the data from A to memory location
2803.
Before After
2807
2806
2805
2804
2803
2802
2801
2800
A 9B 2807
2806
2805
2804
2803 9B
2802
2801
2800
A 9B
[2803] ←
A
[2803] ←
9B
Direct Addressing Mode
Moves a byte or word between a memory location and a register.
The data is in some memory location(s) and the address of
the data in memory comes immediately after the instruction
This address is the offset address
Example:
MOV AX, [2400] ; move contents of DS:2400H
into AX
The physical address is calculated by combining the contents of
offset location 2400 with DS (default segment)
 Example:
Find the physical address of the memory location and its contents after the
execution of the following, assuming that DS
= 1512H.
AL, 3BH
[3518],AL
MOV
MOV
 Solution:
 First 3BH is copied into AL,
 Then in line two, the contents of AL are moved to logical address DS:3518 which is
1512:3518.
 Shifting DS left and adding it to the offset gives the physical address of 18638H
(15120H + 3518H = 18638H).
 After the execution of the second instruction, the memory
.. with address 18638H will contain the value 3BH.
Direct Addressing Mode
Direct Addressing Mode
MOV AL, 3BH
MOV [3518], AL DS=1512H (segment address)
Offset address= 3518
Physical/effective address= 15120 + 3518= 18638
Before After
3500
3502
3504
3508
.
.
.
3518
AL 3B
3500
3502
3504
3508
.
.
.
3518 3B
AL 3B
AL← 3B [3518] ← AL
Question problem
1st instruc
500
Next Instruction
450
700
800
900
325
300
Address
200
201
202
Memory
399
400
500
600
702
PC 200
AC
800
PC = Program Counter
AC = Accumulator
• NOTE:
• Memory is having first instruction to load AC
• Mode will specify the addressing mode to get
operand.
• Address field of instruction is 500.
Find out the effective address of operand
and accumulator & operand value by
considering different addressing modes.
Load A ,500
Lda [500]
Example problem
Address Memory
200
201
1st instruc
500
Next Instruction
450
700
800
900
325
300
202
399
400
500
600
702
PC 200
AC
800
1. Immediate Addressing Mode
• As instruction contains immediate number
500.
Effective Address = nil
Operand = 500
AC 500
Instruction: Load A ,500
Example problem
Address
200
201
202
Memory
399
400
500
1st instruc
500
2nd Instruction
450
700
800
900
325
300
600
702
PC 202
AC
800
2. Direct Addressing
Mode
• Instruction contains the address 500.
• So effective address of operand is
500.
• The data stored at 500 is 800.
Effective Address = 500
Operand = 800
AC 800
Instruction: LdA [500]
Ans:
Addressing Mode Effective
Address
Accumulator Operand
Immediate Addressing Mode nil 500 500
Direct Addressing Mode 500 800 800
Conclusion
THANKYOU for listening

More Related Content

PPTX
Addressing mode Computer Architecture
PPTX
Addressing modes
PPTX
Lecture 3 instruction set
PDF
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
PPTX
Digital signal processing
PPT
Addressing modes
PPTX
Computer System Architecture
PPTX
Types of Addressing modes- COA
Addressing mode Computer Architecture
Addressing modes
Lecture 3 instruction set
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Digital signal processing
Addressing modes
Computer System Architecture
Types of Addressing modes- COA

What's hot (17)

PPTX
Addressing Modes
PPTX
Addressing mode
PPTX
Addresing modes
PPTX
Instruction codes
PPTX
Addressing modes
PPTX
Computer architecture addressing modes and formats
DOCX
Different types of Addressing.cao
PPTX
addressing modes
PPT
Data manipulation instructions
PPT
Addressing modes
PPTX
Computer organization and architecture
DOCX
Central processing unit
PPTX
Micro program example
PPT
11 instruction sets addressing modes
PPTX
Computer Organisation - Addressing Modes
PPT
Computer Architecture and organization ppt.
PPTX
Register transfer and micro-operation
Addressing Modes
Addressing mode
Addresing modes
Instruction codes
Addressing modes
Computer architecture addressing modes and formats
Different types of Addressing.cao
addressing modes
Data manipulation instructions
Addressing modes
Computer organization and architecture
Central processing unit
Micro program example
11 instruction sets addressing modes
Computer Organisation - Addressing Modes
Computer Architecture and organization ppt.
Register transfer and micro-operation
Ad

Similar to Lecture 10 (20)

PPTX
module-3.pptx
PPTX
computer organisation and architecture Module 2.pptx
PPTX
Module 3.1_Instruction Types and Addressing modes.pptx
PPTX
module 3 instruction set and control unit
PPTX
instruction format and addressing modes
PPTX
Microprocessor and Microcontroller.pptx
PPTX
PPTX
instruction sets (1).pptx
PPTX
Instruction Formats in computer architecture.pptx
PDF
L-3microproceessors and microcontrollers.pdf
PPTX
Unit-1_Processor_Basic Cpu_Organization.pptx
PPTX
3. Addressing Modes in 8085 microprocessor.pptx
PPTX
microprocesser Chapter three and foure.pptx
PPTX
Lecture 11
PPTX
Computer System Architecture Lecture Note 7 addressing
DOCX
PPTX
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
PPT
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
PPT
COA Chapter 3 final edited*Minimum 40 characters required.ppt
PPTX
addressing modes of microcontrooller 8051
module-3.pptx
computer organisation and architecture Module 2.pptx
Module 3.1_Instruction Types and Addressing modes.pptx
module 3 instruction set and control unit
instruction format and addressing modes
Microprocessor and Microcontroller.pptx
instruction sets (1).pptx
Instruction Formats in computer architecture.pptx
L-3microproceessors and microcontrollers.pdf
Unit-1_Processor_Basic Cpu_Organization.pptx
3. Addressing Modes in 8085 microprocessor.pptx
microprocesser Chapter three and foure.pptx
Lecture 11
Computer System Architecture Lecture Note 7 addressing
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
COA Chapter 3 final edited*Minimum 40 characters required.ppt
addressing modes of microcontrooller 8051
Ad

More from talhashahid40 (7)

DOCX
Talha 11009 call_quiz_addressing_modes
PPTX
Only floating point lecture 7 (1)
PPTX
Lecture 9 examples (1)
PPTX
Lect 8 updated (1)
PPTX
Coal (1)
PPT
Chapter 7
PPTX
Chapter 3 caal (1)
Talha 11009 call_quiz_addressing_modes
Only floating point lecture 7 (1)
Lecture 9 examples (1)
Lect 8 updated (1)
Coal (1)
Chapter 7
Chapter 3 caal (1)

Recently uploaded (20)

PPTX
Earth-and-Life-Pieces-of-Evidence-Q2.pptx
PDF
Thyroid Hormone by Iqra Nasir detail.pdf
PPTX
Bacterial and protozoal infections in pregnancy.pptx
PPTX
Introduction of Plant Ecology and Diversity Conservation
PDF
SOCIAL PSYCHOLOGY_ CHAPTER 2.pdf- the self in a social world
PDF
TOPIC-1-Introduction-to-Bioinformatics_for dummies
PDF
Human Anatomy (Anatomy and Physiology A)
PPTX
ELS 2ND QUARTER 2 FOR HUMSS STUDENTS.pptx
PDF
Unit Four Lesson in Carbohydrates chemistry
PPT
Chapter 52 introductory biology course Camp
PPTX
complications of tooth extraction.pptx FIRM B.pptx
PPTX
Chapter 1 Introductory course Biology Camp
PDF
SOCIAL PSYCHOLOGY chapter 1-what is social psychology and its definition
PPT
dcs-computertraningbasics-170826004702.ppt
PDF
Physics of Bitcoin #30 Perrenod Santostasi.pdf
PPTX
The Electromagnetism Wave Spectrum. pptx
PDF
naas-journal-rating-2025 for all the journals
PPTX
ELS 2ND QUARTER 1 FOR HUMSS STUDENTS.pptx
PDF
Sujay Rao Mandavilli Degrowth delusion FINAL FINAL FINAL FINAL FINAL.pdf
PDF
final prehhhejjehehhehehehebesentation.pdf
Earth-and-Life-Pieces-of-Evidence-Q2.pptx
Thyroid Hormone by Iqra Nasir detail.pdf
Bacterial and protozoal infections in pregnancy.pptx
Introduction of Plant Ecology and Diversity Conservation
SOCIAL PSYCHOLOGY_ CHAPTER 2.pdf- the self in a social world
TOPIC-1-Introduction-to-Bioinformatics_for dummies
Human Anatomy (Anatomy and Physiology A)
ELS 2ND QUARTER 2 FOR HUMSS STUDENTS.pptx
Unit Four Lesson in Carbohydrates chemistry
Chapter 52 introductory biology course Camp
complications of tooth extraction.pptx FIRM B.pptx
Chapter 1 Introductory course Biology Camp
SOCIAL PSYCHOLOGY chapter 1-what is social psychology and its definition
dcs-computertraningbasics-170826004702.ppt
Physics of Bitcoin #30 Perrenod Santostasi.pdf
The Electromagnetism Wave Spectrum. pptx
naas-journal-rating-2025 for all the journals
ELS 2ND QUARTER 1 FOR HUMSS STUDENTS.pptx
Sujay Rao Mandavilli Degrowth delusion FINAL FINAL FINAL FINAL FINAL.pdf
final prehhhejjehehhehehehebesentation.pdf

Lecture 10

  • 1. Lecture 10: Addressing Modes Lecture by Engr.Javeria Barkat Iqra University.
  • 2. Prerequisite - Intro to parts of CPU • Arithmetic and Logic Unit (ALU) It performs all the arithmetic and logical micro operations. • Floating Point Unit (FPU) It performs operations on floating point numbers. • Memory Unit (MU) It stores the set of instructions. • Control Unit (CU) It supervises the sequence of micro operations. • Registers Temporary storage area, which holds the data during the execution of an instruction. CU FPU MU REGISTERS ALU
  • 3. 8-bit 8-bit 8-bit OP CODE OPERAND .1 byte 1 to 2 byte  An opcode is a short of “operation code”  An opcode is a single instruction can be executed by the CPU. In assembly language mnemonic form an opcode is a command such as MOV or ADD or JMP.  Example: MOV AX, 1000H ; MOV is the opcode. ; AX (register) is an operand.  Operands are manipulated by the opcode. In this example, the operands are the register AX and the value 1000H. Opcode and Operand in Microprocessor 8086/8088
  • 4. Purpose of Addressing modes 1.) To give programming flexibility to the user by providing such facilities as pointers to memory, counters for loop control, indexing of data and various other purposes. 2.) To reduce the number of bits in the addressing field of the instructions.
  • 5. To understand the various addressing modes: • It is imperative that we understand the basic operation cycle of the computer. The control unit of a computer is designed to go through an instruction cycle that is divided into 3 major parts:- Fetch the instruction from memory Decode the instruction and Execute the instruction.
  • 6. • The operation field of an instruction specifies the operation to be performed. • This operation must be executed on the data stored in computer registers or the memory words. • The way the operands are chosen during program execution is dependent on the addressing mode of the instruction Contd..
  • 7. Addressing Modes • Microprocessor executes the instructions stored in memory (RAM). • It executes one instruction at a time. • Each of the instruction contains operations and operands. • Operation specifies the type of action to be performed. • For example: ADD, SUB, MOV, INC, LOAD, STORE • Operands are the data on which the operation is to be performed. MOV B, A ADD B Here MOV is operation and (B & A) are operands. Here ADD is operation and (B) is operand.
  • 8. Addressing Modes • Operand can be place either in one of the processor register or in memory. • There are different ways to get the operands. • The way in which the operand is taken from register or memory is named as addressing mode. THE ADDRESSING MODE: Specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced.
  • 9. Addressing Modes in Microprocessor 8086/8088 Types of Addressing Modes: (1) Stack-Memory Addressing Modes (2) Data Addressing Modes (3) Program-Memory Addressing Modes
  • 10. 1- Stack-Memory Addressing Modes in Microprocessor 8086/8088  The stack plays an important role in all microprocessors.  It holds data temporarily and stores return addresses for procedures.  The stack memory is a LIFO (last-in, first-out) memory, which describes the way that data are stored and removed from the stack.  Data are placed onto the stack with a PUSH instruction and removed with a POP instruction.  The CALL instruction also uses the stack to hold the return address for procedures and a RET (return) instruction to remove the return address from the stack.
  • 12. 2. Data Addressing Modes 1. Immediate Addressing Mode 2. Direct Addressing Mode 3. Indirect Addressing Mode 4. Register Addressing Mode 5. Register Indirect Addressing Mode 6. Implied Addressing Mode 7. Auto increment or Auto decrement Addressing Mode 8. Relative Addressing Mode 9. Indexed Addressing Mode 10. Base Register Addressing Mode  An addressing mode means the method by which an operand can be specified in a register or a memory location
  • 13. 1.ImmediateAddressing • Thesource data is coded directly into the instruction. – Theterm immediate means that the data immediately follows the hexadecimal opcode inthe memory. • Immediate data are constant data suchas anumber, acharacter, or an arithmetic expression. • Examples: – MOVAX,100 – MOVBX,189CH – MOVAH, 10110110B – MOVAL,(2 +3)/5
  • 14. Contd • The operand is specified with in the instruction. • Operand itself is provided in the instruction rather than its address. • In other words, an immediate-mode instruction has an operand field rather than an address field. • Move Immediate MVI A , 15h A ←15h Here 15h is the immediate operand Add Immediate ADI 3Eh A ← A + 3Eh Here 3Eh is the immediate operand
  • 15. Immediate Addressing Mode  Example: MOV AX, 2550H MOV CX, 625 MOV BL, 40H ; move 2550H into AX ; load the decimal value 625 into CX ; load 40H into BL  The data must first be moved to a general-purpose register and then to the segment register.  Example: MOV AX, 2550H MOV DS, AX MOV DS, 0123H ; illegal instruction!
  • 17.  Transfers the source, an immediate byte or word of data, into the destination register or memory location  The source operand is a constant  The operand comes immediately after the opcode  For this reason, this addressing mode executes quickly  Immediate addressing mode can be used to load information into any of the registers except the segment registers and flag registers. Concluding remarks of Immediate Addressing Mode
  • 18. Effective address: • The effective address is defined to be the memory address obtained from the computation dictated by the given addressing mode. • The effective address is the address of the operand in a computational-type instruction. Important note:
  • 19. 3.Direct Addressing • Theoperand is stored in amemory location, usuallyin data segment. Theinstruction takes the offsetaddress. –Thisoffset addressmust be put in abracket []. • In this mode the effective address is equal to the address part of the instruction. The operand resides in memory and its address is given directly by the address field of the instruction.
  • 20. Contd. • The instruction specifies the direct address of the operand. • The memory address is specified where the actual operand is. Load Accumulator LDA 2805h A ← [2805] It loads the data from memory location 2805 toA. Store Accumulator STA 2803h [2803] ← A It stores the data from A to memory location 2803.
  • 21. Direct Addressing Mode LDA 2805h A ← [2805] It loads the data from memory location 2805 to A. Before After 2807 2806 2805 5C 2804 2803 2802 2801 2800 A 2807 2806 2805 5C 2804 2803 2802 2801 2800 A 5C A ← [2805] A ← 5C
  • 22. Direct Addressing Mode STA 2803h [2803] ← A It stores the data from A to memory location 2803. Before After 2807 2806 2805 2804 2803 2802 2801 2800 A 9B 2807 2806 2805 2804 2803 9B 2802 2801 2800 A 9B [2803] ← A [2803] ← 9B
  • 23. Direct Addressing Mode Moves a byte or word between a memory location and a register. The data is in some memory location(s) and the address of the data in memory comes immediately after the instruction This address is the offset address Example: MOV AX, [2400] ; move contents of DS:2400H into AX The physical address is calculated by combining the contents of offset location 2400 with DS (default segment)
  • 24.  Example: Find the physical address of the memory location and its contents after the execution of the following, assuming that DS = 1512H. AL, 3BH [3518],AL MOV MOV  Solution:  First 3BH is copied into AL,  Then in line two, the contents of AL are moved to logical address DS:3518 which is 1512:3518.  Shifting DS left and adding it to the offset gives the physical address of 18638H (15120H + 3518H = 18638H).  After the execution of the second instruction, the memory .. with address 18638H will contain the value 3BH. Direct Addressing Mode
  • 25. Direct Addressing Mode MOV AL, 3BH MOV [3518], AL DS=1512H (segment address) Offset address= 3518 Physical/effective address= 15120 + 3518= 18638 Before After 3500 3502 3504 3508 . . . 3518 AL 3B 3500 3502 3504 3508 . . . 3518 3B AL 3B AL← 3B [3518] ← AL
  • 26. Question problem 1st instruc 500 Next Instruction 450 700 800 900 325 300 Address 200 201 202 Memory 399 400 500 600 702 PC 200 AC 800 PC = Program Counter AC = Accumulator • NOTE: • Memory is having first instruction to load AC • Mode will specify the addressing mode to get operand. • Address field of instruction is 500. Find out the effective address of operand and accumulator & operand value by considering different addressing modes. Load A ,500 Lda [500]
  • 27. Example problem Address Memory 200 201 1st instruc 500 Next Instruction 450 700 800 900 325 300 202 399 400 500 600 702 PC 200 AC 800 1. Immediate Addressing Mode • As instruction contains immediate number 500. Effective Address = nil Operand = 500 AC 500 Instruction: Load A ,500
  • 28. Example problem Address 200 201 202 Memory 399 400 500 1st instruc 500 2nd Instruction 450 700 800 900 325 300 600 702 PC 202 AC 800 2. Direct Addressing Mode • Instruction contains the address 500. • So effective address of operand is 500. • The data stored at 500 is 800. Effective Address = 500 Operand = 800 AC 800 Instruction: LdA [500]
  • 29. Ans: Addressing Mode Effective Address Accumulator Operand Immediate Addressing Mode nil 500 500 Direct Addressing Mode 500 800 800