SlideShare a Scribd company logo
1 of 31
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.
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

What's hot

Addressing Modes
Addressing ModesAddressing Modes
Addressing ModesMayank Garg
 
Addressing mode
Addressing modeAddressing mode
Addressing modeilakkiya
 
Addressing modes
Addressing modesAddressing modes
Addressing modesMukta Garg
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.caoUmme habiba
 
Data manipulation instructions
Data manipulation instructionsData manipulation instructions
Data manipulation instructionsMahesh Kumar Attri
 
Addressing modes
Addressing modesAddressing modes
Addressing modesAJAL A J
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architectureSubesh Kumar Yadav
 
Central processing unit
Central processing unitCentral processing unit
Central processing unitjyoti_lakhani
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Wasif Naeem
 
Computer Organisation - Addressing Modes
Computer Organisation - Addressing ModesComputer Organisation - Addressing Modes
Computer Organisation - Addressing ModesArunaDevi63
 
Computer Architecture and organization ppt.
Computer Architecture and organization ppt.Computer Architecture and organization ppt.
Computer Architecture and organization ppt.mali yogesh kumar
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operationNikhil Pandit
 

What's hot (17)

Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
 
Addresing modes
Addresing modesAddresing modes
Addresing modes
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.cao
 
addressing modes
addressing modesaddressing modes
addressing modes
 
Data manipulation instructions
Data manipulation instructionsData manipulation instructions
Data manipulation instructions
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
 
Micro program example
Micro program exampleMicro program example
Micro program example
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
Computer Organisation - Addressing Modes
Computer Organisation - Addressing ModesComputer Organisation - Addressing Modes
Computer Organisation - Addressing Modes
 
Computer Architecture and organization ppt.
Computer Architecture and organization ppt.Computer Architecture and organization ppt.
Computer Architecture and organization ppt.
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 

Similar to Lecture 10

instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modesRamaPrabha24
 
Microprocessor and Microcontroller.pptx
Microprocessor and Microcontroller.pptxMicroprocessor and Microcontroller.pptx
Microprocessor and Microcontroller.pptxpvg123456
 
instruction sets (1).pptx
instruction sets (1).pptxinstruction sets (1).pptx
instruction sets (1).pptxAmanMomin9
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptxISMT College
 
Computer System Architecture Lecture Note 7 addressing
Computer System Architecture Lecture Note 7 addressingComputer System Architecture Lecture Note 7 addressing
Computer System Architecture Lecture Note 7 addressingBudditha Hettige
 
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
micro chapter 3jjgffffyeyhhuyerfftfgggffgjjmicro chapter 3jjgffffyeyhhuyerfftfgggffgjj
micro chapter 3jjgffffyeyhhuyerfftfgggffgjjTadeseBeyene
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGFrankie Jones
 
Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...
Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...
Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...preethi3173
 
Bca examination 2016 csa
Bca examination 2016 csaBca examination 2016 csa
Bca examination 2016 csaAnjaan Gajendra
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modesSuchismita Paul
 
Intel x86 and ARM Data types
Intel x86 and ARM Data typesIntel x86 and ARM Data types
Intel x86 and ARM Data typesRowena Cornejo
 
Microprocessors-based systems (under graduate course) Lecture 3 of 9
Microprocessors-based systems (under graduate course) Lecture 3 of 9 Microprocessors-based systems (under graduate course) Lecture 3 of 9
Microprocessors-based systems (under graduate course) Lecture 3 of 9 Randa Elanwar
 
advancsed microprocessor and interfacing
advancsed microprocessor and interfacingadvancsed microprocessor and interfacing
advancsed microprocessor and interfacing@zenafaris91
 

Similar to Lecture 10 (20)

module-3.pptx
module-3.pptxmodule-3.pptx
module-3.pptx
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
Microprocessor and Microcontroller.pptx
Microprocessor and Microcontroller.pptxMicroprocessor and Microcontroller.pptx
Microprocessor and Microcontroller.pptx
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
instruction sets (1).pptx
instruction sets (1).pptxinstruction sets (1).pptx
instruction sets (1).pptx
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Computer System Architecture Lecture Note 7 addressing
Computer System Architecture Lecture Note 7 addressingComputer System Architecture Lecture Note 7 addressing
Computer System Architecture Lecture Note 7 addressing
 
Cao
CaoCao
Cao
 
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
micro chapter 3jjgffffyeyhhuyerfftfgggffgjjmicro chapter 3jjgffffyeyhhuyerfftfgggffgjj
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
 
MPMC UNIT-2.pdf
MPMC UNIT-2.pdfMPMC UNIT-2.pdf
MPMC UNIT-2.pdf
 
Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...
Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...
Computer organisation and architecture jntuh 2rd year 2nd unit # central proc...
 
UNIT-3.pptx
UNIT-3.pptxUNIT-3.pptx
UNIT-3.pptx
 
Bca examination 2016 csa
Bca examination 2016 csaBca examination 2016 csa
Bca examination 2016 csa
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modes
 
Intel x86 and ARM Data types
Intel x86 and ARM Data typesIntel x86 and ARM Data types
Intel x86 and ARM Data types
 
Microprocessors-based systems (under graduate course) Lecture 3 of 9
Microprocessors-based systems (under graduate course) Lecture 3 of 9 Microprocessors-based systems (under graduate course) Lecture 3 of 9
Microprocessors-based systems (under graduate course) Lecture 3 of 9
 
advancsed microprocessor and interfacing
advancsed microprocessor and interfacingadvancsed microprocessor and interfacing
advancsed microprocessor and interfacing
 
Bc0040
Bc0040Bc0040
Bc0040
 

More from talhashahid40

Talha 11009 call_quiz_addressing_modes
Talha 11009 call_quiz_addressing_modesTalha 11009 call_quiz_addressing_modes
Talha 11009 call_quiz_addressing_modestalhashahid40
 
Only floating point lecture 7 (1)
Only floating point lecture 7 (1)Only floating point lecture 7 (1)
Only floating point lecture 7 (1)talhashahid40
 
Lecture 9 examples (1)
Lecture 9 examples (1)Lecture 9 examples (1)
Lecture 9 examples (1)talhashahid40
 

More from talhashahid40 (7)

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

Recently uploaded

Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024AyushiRastogi48
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxmalonesandreagweneth
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024innovationoecd
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRlizamodels9
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzohaibmir069
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxRESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxFarihaAbdulRasheed
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsHajira Mahmood
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |aasikanpl
 

Recently uploaded (20)

Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
 
Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistan
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxRESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutions
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
 

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.
  • 11.
  • 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