SlideShare a Scribd company logo
1 of 22
INSTRUCTION SET:
ADDRESSING MODES
ADDRESSING MODES
• Each instruction has 2 fields
• Operation code (Opcode) field
• Operand field
• The operand field holds the operands or the reference to operands
• Addressing modes specify the ways in which effective address of the operand is
represented in the instruction
• Effective address(EA) is the exact memory location where the value of the operand
is stored
• In an instruction set different addressing modes are used for different types of
instructions
Opcode operand
2
2/27/2021
DR. PRASENJIT DEY
Instruction
TYPES OF ADDRESSING MODE
• Inherent / Implied
• Immediate
• Direct
• Indirect
• Register
• Register Indirect
• Displacement
• Relative
• Indexed
• Auto-decrement or auto-increment
• Stack
3
2/27/2021
DR. PRASENJIT DEY
INHERENT / IMPLIED ADDRESSING
• In this type of addressing, operand is part of the opcode field
• e.g., CLC
• Clear carry flag to zero
4
2/27/2021
DR. PRASENJIT DEY
• Speed
• No need to fetch operand
• Fast
• Address space
• Fixed range, depends on instruction set
IMMEDIATE ADDRESSING
• In this type of addressing, operand is part of instruction
• Operand field = operand
• e.g., SUB #17
• Here, the instruction will subtract 17 from the content of the accumulator and
load the result in the accumulator
• Ac  Ac - 17
5
2/27/2021
DR. PRASENJIT DEY
• Speed
• No reference for fetching the operand
• Fast
• Address space
• Instruction format provides a limited size for operand so limited range
Opcode 17
Opcode field Operand field
DIRECT / ABSOLUTE ADDRESSING
• Here, operand field holds memory address of the operand
• Operand field = address of the operand = EA
• e.g., LDA A, [12]
• Load the data content at memory location 12 into the A register
• A  M[12]; EA = 12
Opcode [12]
6
2/27/2021
DR. PRASENJIT DEY
• Speed
• Single memory reference to access data
• No extra computation is required to get the effective address of the data
• Address space
• Range depends on the size of memory address space
DIRECT / ABSOLUTE ADDRESSING:
DEMONSTRATION
Instruction
Memory
Opcode [12]
operand
7
2/27/2021
DR. PRASENJIT DEY
24
04
08
12
16
20
00
INDIRECT ADDRESSING
• Memory address pointed to by operand field contains the address of the operand
• Operand field = address of the [EA]
• e.g., ADD A, @12
• Add content of memory location pointed to by memory location 12 into A register
• Temp M[12]; A  A + M[Temp]; EA = 12
• can be multilevel, cascaded
Opcode @12
8
2/27/2021
DR. PRASENJIT DEY
• Speed
• Comparatively slow as multiple (generally 2) memory access are required to get
the data
• Address space
• 2n where n = word length
INDIRECT ADDRESSING:
DEMONSTRATION
Instruction
Memory
Opcode 12
Pointer to operand=M[20]
operand
24
00
04
08
12
16
20
9
2/27/2021
DR. PRASENJIT DEY
REGISTER ADDRESSING
• Here, operand field holds the name of the register which contains the operand
• Operand field = R (name of the register)
• EA = R
• e.g., ADD A, B
• Add the content of B register with the content of A register and load the result into A
register
• A  A + B
Opcode A B
10
2/27/2021
DR. PRASENJIT DEY
• Speed
• Limited registers  smaller operand field  shorter instructions  faster fetch
• No memory access, very fast execution
• Address space
• Registers have limited address space so limited range
REGISTER ADDRESSING:
DEMONSTRATION
Instruction
Registers
Opcode Address of B register
operand
G
A
B
C
D
E
F
11
2/27/2021
DR. PRASENJIT DEY
REGISTER INDIRECT ADDRESSING
• Operand field holds the name of the register which contains memory location of the
operand
• Operand field = R (name of the register/register pair)
• e.g., ADD A, (B)
• Add the content of memory location pointed by B register with A register and store
the result into A register
• A  A + M[B];
Opcode A ( B)
12
2/27/2021
DR. PRASENJIT DEY
• Speed
• One register access and one memory access is required to get the data
• Address space
• Large address space: 2n where n = word length
REGISTER INDIRECT ADDRESSING:
DEMONSTRATION
Instruction
Memory
Opcode Address of B register
operand
00
04
08
12
16
20
Registers
Pointer to operand = M[08]
13
2/27/2021
DR. PRASENJIT DEY
A
B
C
D
E
24
DISPLACEMENT ADDRESSING
• Operand field contains two values:
1. Base register (B)
2. Offset value (R)
• Addition of offset value with base register value provides the effective
address of the operand
• EA = (B) + R
• e.g., ADD A, 12(B)
• Useful in accessing local variables
14
2/27/2021
DR. PRASENJIT DEY
DISPLACEMENT ADDRESSING:
DEMONSTRATION
Instruction
Memory
Opcode 12 Register B = 04
operand
24
00
04
08
12
16
20
+
15
2/27/2021
DR. PRASENJIT DEY
M[12+04]
RELATIVE ADDRESSING
• A version of displacement addressing
• B = Base register = Program counter (PC)
• R = Address part of the instruction
• EA = (PC) + R
• Addition of offset field value with PC register value provides the
effective address of the operand
• e.g., ADD A, 4(PC)
1. Add 4 with PC value and form EA=(PC+4)
2. A  A + PC[4]
• Used in control transfer instructions
16
2/27/2021
DR. PRASENJIT DEY
RELATIVE ADDRESSING:
DEMONSTRATION
Instruction
Memory
Opcode Register B = 04
operand
24
00
04
08
12
16
20
+
17
2/27/2021
DR. PRASENJIT DEY
PC[04]
PC
INDEXED ADDRESSING
• A version of displacement addressing
• B = Base register = Index register
• R = Address part of the instruction
• EA = (B) + R
• e.g., ADD A, 04(B)
1. Add 4 with B register value and form EA = (B+4)
2. A  A + B[4]
• Useful in array addressing
• B = base address of the array
• R = index amount
18
2/27/2021
DR. PRASENJIT DEY
INDEXED ADDRESSING:
DEMONSTRATION
Instruction
Memory
Opcode Index Register B Displacement = 04
operand
Registers
08
A
B
C
E
+
19
2/27/2021
DR. PRASENJIT DEY
D
24
00
04
08
12
16
20
M[08+04]
AUTO-INCREMENT OR AUTO-DECREMENT
ADDRESSING
• In case of auto-increment addressing
• B = base address of the array
• d = size of each element in the array
• e.g., ADD A, (B)+
1. A  A + M[B]
2. B  B + d
20
2/27/2021
DR. PRASENJIT DEY
• Useful when iterating through array in a loop
• Used to implement a stack as push and pop
• In case of auto-decrement addressing
• B = base address of the array
• d = size of each element in the array
• e.g., ADD A, -(B)
1. B  B - d;
2. A  A + M[B]
STACK ADDRESSING
• Operand is (implicitly) on top of stack
• e.g. ADD
• Pop top two items from stack and add and push result on top
21
2/27/2021
DR. PRASENJIT DEY
40
08
45
14
12
48
45
14
12
Before the operation After the operation
ADDRESSING MODES FOR DIFFERENT
INSTRUCTIONS
• Load/store instructions
• displacement and indexed addressing
22
2/27/2021
DR. PRASENJIT DEY
• Branch instructions
• Direct / Absolute addressing
• Relative addressing
• Register indirect addressing
• Arithmetic and logical instructions
• Immediate addressing
• Register addressing
• Register indirect addressing

More Related Content

What's hot

Addressing modes
Addressing modesAddressing modes
Addressing modesAJAL A J
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instructionDeepikaT13
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentationTech_MX
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processors9007912
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)rishi ram khanal
 
Chapter 02 instructions language of the computer
Chapter 02   instructions language of the computerChapter 02   instructions language of the computer
Chapter 02 instructions language of the computerBảo Hoang
 
CPU Register Organization.ppt
CPU Register Organization.pptCPU Register Organization.ppt
CPU Register Organization.pptprathamgunj
 
Csc1401 lecture05 - cache memory
Csc1401   lecture05 - cache memoryCsc1401   lecture05 - cache memory
Csc1401 lecture05 - cache memoryIIUM
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxDr.YNM
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED CAman Sharma
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly languageMir Majid
 

What's hot (20)

Memory Reference instruction
Memory Reference instructionMemory Reference instruction
Memory Reference instruction
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instruction
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processor
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Instruction types
Instruction typesInstruction types
Instruction types
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)
 
Chapter 02 instructions language of the computer
Chapter 02   instructions language of the computerChapter 02   instructions language of the computer
Chapter 02 instructions language of the computer
 
CPU Register Organization.ppt
CPU Register Organization.pptCPU Register Organization.ppt
CPU Register Organization.ppt
 
Csc1401 lecture05 - cache memory
Csc1401   lecture05 - cache memoryCsc1401   lecture05 - cache memory
Csc1401 lecture05 - cache memory
 
07 Input Output
07  Input  Output07  Input  Output
07 Input Output
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptx
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 

Similar to Addressing mode

11_ Instruction Sets addressing modes -1.ppt
11_ Instruction Sets addressing modes -1.ppt11_ Instruction Sets addressing modes -1.ppt
11_ Instruction Sets addressing modes -1.pptSuchikage
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Seshu Chakravarthy
 
11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .pptSwarajKumarPradhan
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Anwal Mirza
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Kanika Thakur
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Wasif Naeem
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architectureSubesh Kumar Yadav
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes dilip kumar
 
Lec3 instructions branch carl hamcher
Lec3 instructions branch carl hamcher Lec3 instructions branch carl hamcher
Lec3 instructions branch carl hamcher Venkata Krishnakanth P
 
Presentation of addressing mode presentation
Presentation of addressing mode presentationPresentation of addressing mode presentation
Presentation of addressing mode presentationkiranrawkey2912
 
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086samirbharat77
 
Ch13- Inst Addressing Modes & Formats.pdf
Ch13- Inst Addressing Modes & Formats.pdfCh13- Inst Addressing Modes & Formats.pdf
Ch13- Inst Addressing Modes & Formats.pdfsaimawarsi
 
Computer Architecture and organization ppt.
Computer Architecture and organization ppt.Computer Architecture and organization ppt.
Computer Architecture and organization ppt.mali yogesh kumar
 
All-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptxAll-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptxVidyaAshokNemade
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Compreport
CompreportCompreport
Compreportxdarlord
 
Assignment on different types of addressing modes
Assignment on different types of addressing modesAssignment on different types of addressing modes
Assignment on different types of addressing modesNusratJahan263
 

Similar to Addressing mode (20)

11_ Instruction Sets addressing modes -1.ppt
11_ Instruction Sets addressing modes -1.ppt11_ Instruction Sets addressing modes -1.ppt
11_ Instruction Sets addressing modes -1.ppt
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
Anshika 1111.pptx
Anshika 1111.pptxAnshika 1111.pptx
Anshika 1111.pptx
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
Lec3 instructions branch carl hamcher
Lec3 instructions branch carl hamcher Lec3 instructions branch carl hamcher
Lec3 instructions branch carl hamcher
 
Presentation of addressing mode presentation
Presentation of addressing mode presentationPresentation of addressing mode presentation
Presentation of addressing mode presentation
 
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
 
Ch13- Inst Addressing Modes & Formats.pdf
Ch13- Inst Addressing Modes & Formats.pdfCh13- Inst Addressing Modes & Formats.pdf
Ch13- Inst Addressing Modes & Formats.pdf
 
Addressing modes ppt
Addressing modes pptAddressing modes ppt
Addressing modes ppt
 
Ch 11
Ch 11Ch 11
Ch 11
 
Computer Architecture and organization ppt.
Computer Architecture and organization ppt.Computer Architecture and organization ppt.
Computer Architecture and organization ppt.
 
All-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptxAll-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptx
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Compreport
CompreportCompreport
Compreport
 
Assignment on different types of addressing modes
Assignment on different types of addressing modesAssignment on different types of addressing modes
Assignment on different types of addressing modes
 

More from Prasenjit Dey

Dynamic interconnection networks
Dynamic interconnection networksDynamic interconnection networks
Dynamic interconnection networksPrasenjit Dey
 
Machine Learning in Agriculture Module 6: classification
Machine Learning in Agriculture Module 6: classificationMachine Learning in Agriculture Module 6: classification
Machine Learning in Agriculture Module 6: classificationPrasenjit Dey
 
Machine Learning in Agriculture Module 3: linear regression
Machine Learning in Agriculture Module 3: linear regressionMachine Learning in Agriculture Module 3: linear regression
Machine Learning in Agriculture Module 3: linear regressionPrasenjit Dey
 
Machine learning in agriculture module 2
Machine learning in agriculture module 2Machine learning in agriculture module 2
Machine learning in agriculture module 2Prasenjit Dey
 
Machine Learning in Agriculture Module 1
Machine Learning in Agriculture Module 1Machine Learning in Agriculture Module 1
Machine Learning in Agriculture Module 1Prasenjit Dey
 
Support vector machine
Support vector machineSupport vector machine
Support vector machinePrasenjit Dey
 
Numerical on general pipelines
Numerical on general pipelinesNumerical on general pipelines
Numerical on general pipelinesPrasenjit Dey
 
General pipeline concepts
General pipeline conceptsGeneral pipeline concepts
General pipeline conceptsPrasenjit Dey
 
Evaluation of computer performance
Evaluation of computer performanceEvaluation of computer performance
Evaluation of computer performancePrasenjit Dey
 
Instruction Set Architecture: MIPS
Instruction Set Architecture: MIPSInstruction Set Architecture: MIPS
Instruction Set Architecture: MIPSPrasenjit Dey
 
Page replacement and thrashing
Page replacement and thrashingPage replacement and thrashing
Page replacement and thrashingPrasenjit Dey
 
Register transfer and microoperations part 2
Register transfer and microoperations part 2Register transfer and microoperations part 2
Register transfer and microoperations part 2Prasenjit Dey
 
Instruction set (prasenjit dey)
Instruction set (prasenjit dey)Instruction set (prasenjit dey)
Instruction set (prasenjit dey)Prasenjit Dey
 
Register transfer and microoperations part 1
Register transfer and microoperations part 1Register transfer and microoperations part 1
Register transfer and microoperations part 1Prasenjit Dey
 
Different types of memory and hardware designs of RAM and ROM
Different types of memory and hardware designs of RAM and ROMDifferent types of memory and hardware designs of RAM and ROM
Different types of memory and hardware designs of RAM and ROMPrasenjit Dey
 
Carry look ahead adder
Carry look ahead adder Carry look ahead adder
Carry look ahead adder Prasenjit Dey
 
Binary division restoration and non restoration algorithm
Binary division restoration and non restoration algorithmBinary division restoration and non restoration algorithm
Binary division restoration and non restoration algorithmPrasenjit Dey
 
Computer organization basics and number systems
Computer organization basics and number systemsComputer organization basics and number systems
Computer organization basics and number systemsPrasenjit Dey
 

More from Prasenjit Dey (20)

Dynamic interconnection networks
Dynamic interconnection networksDynamic interconnection networks
Dynamic interconnection networks
 
Machine Learning in Agriculture Module 6: classification
Machine Learning in Agriculture Module 6: classificationMachine Learning in Agriculture Module 6: classification
Machine Learning in Agriculture Module 6: classification
 
Machine Learning in Agriculture Module 3: linear regression
Machine Learning in Agriculture Module 3: linear regressionMachine Learning in Agriculture Module 3: linear regression
Machine Learning in Agriculture Module 3: linear regression
 
Machine learning in agriculture module 2
Machine learning in agriculture module 2Machine learning in agriculture module 2
Machine learning in agriculture module 2
 
Machine Learning in Agriculture Module 1
Machine Learning in Agriculture Module 1Machine Learning in Agriculture Module 1
Machine Learning in Agriculture Module 1
 
Support vector machine
Support vector machineSupport vector machine
Support vector machine
 
Numerical on general pipelines
Numerical on general pipelinesNumerical on general pipelines
Numerical on general pipelines
 
General pipeline concepts
General pipeline conceptsGeneral pipeline concepts
General pipeline concepts
 
Evaluation of computer performance
Evaluation of computer performanceEvaluation of computer performance
Evaluation of computer performance
 
Instruction Set Architecture: MIPS
Instruction Set Architecture: MIPSInstruction Set Architecture: MIPS
Instruction Set Architecture: MIPS
 
Page replacement and thrashing
Page replacement and thrashingPage replacement and thrashing
Page replacement and thrashing
 
Register transfer and microoperations part 2
Register transfer and microoperations part 2Register transfer and microoperations part 2
Register transfer and microoperations part 2
 
Instruction set (prasenjit dey)
Instruction set (prasenjit dey)Instruction set (prasenjit dey)
Instruction set (prasenjit dey)
 
Register transfer and microoperations part 1
Register transfer and microoperations part 1Register transfer and microoperations part 1
Register transfer and microoperations part 1
 
Different types of memory and hardware designs of RAM and ROM
Different types of memory and hardware designs of RAM and ROMDifferent types of memory and hardware designs of RAM and ROM
Different types of memory and hardware designs of RAM and ROM
 
Cache memory
Cache  memoryCache  memory
Cache memory
 
Carry look ahead adder
Carry look ahead adder Carry look ahead adder
Carry look ahead adder
 
Binary division restoration and non restoration algorithm
Binary division restoration and non restoration algorithmBinary division restoration and non restoration algorithm
Binary division restoration and non restoration algorithm
 
Booth's algorithm
Booth's algorithm Booth's algorithm
Booth's algorithm
 
Computer organization basics and number systems
Computer organization basics and number systemsComputer organization basics and number systems
Computer organization basics and number systems
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 

Addressing mode

  • 2. ADDRESSING MODES • Each instruction has 2 fields • Operation code (Opcode) field • Operand field • The operand field holds the operands or the reference to operands • Addressing modes specify the ways in which effective address of the operand is represented in the instruction • Effective address(EA) is the exact memory location where the value of the operand is stored • In an instruction set different addressing modes are used for different types of instructions Opcode operand 2 2/27/2021 DR. PRASENJIT DEY Instruction
  • 3. TYPES OF ADDRESSING MODE • Inherent / Implied • Immediate • Direct • Indirect • Register • Register Indirect • Displacement • Relative • Indexed • Auto-decrement or auto-increment • Stack 3 2/27/2021 DR. PRASENJIT DEY
  • 4. INHERENT / IMPLIED ADDRESSING • In this type of addressing, operand is part of the opcode field • e.g., CLC • Clear carry flag to zero 4 2/27/2021 DR. PRASENJIT DEY • Speed • No need to fetch operand • Fast • Address space • Fixed range, depends on instruction set
  • 5. IMMEDIATE ADDRESSING • In this type of addressing, operand is part of instruction • Operand field = operand • e.g., SUB #17 • Here, the instruction will subtract 17 from the content of the accumulator and load the result in the accumulator • Ac  Ac - 17 5 2/27/2021 DR. PRASENJIT DEY • Speed • No reference for fetching the operand • Fast • Address space • Instruction format provides a limited size for operand so limited range Opcode 17 Opcode field Operand field
  • 6. DIRECT / ABSOLUTE ADDRESSING • Here, operand field holds memory address of the operand • Operand field = address of the operand = EA • e.g., LDA A, [12] • Load the data content at memory location 12 into the A register • A  M[12]; EA = 12 Opcode [12] 6 2/27/2021 DR. PRASENJIT DEY • Speed • Single memory reference to access data • No extra computation is required to get the effective address of the data • Address space • Range depends on the size of memory address space
  • 7. DIRECT / ABSOLUTE ADDRESSING: DEMONSTRATION Instruction Memory Opcode [12] operand 7 2/27/2021 DR. PRASENJIT DEY 24 04 08 12 16 20 00
  • 8. INDIRECT ADDRESSING • Memory address pointed to by operand field contains the address of the operand • Operand field = address of the [EA] • e.g., ADD A, @12 • Add content of memory location pointed to by memory location 12 into A register • Temp M[12]; A  A + M[Temp]; EA = 12 • can be multilevel, cascaded Opcode @12 8 2/27/2021 DR. PRASENJIT DEY • Speed • Comparatively slow as multiple (generally 2) memory access are required to get the data • Address space • 2n where n = word length
  • 9. INDIRECT ADDRESSING: DEMONSTRATION Instruction Memory Opcode 12 Pointer to operand=M[20] operand 24 00 04 08 12 16 20 9 2/27/2021 DR. PRASENJIT DEY
  • 10. REGISTER ADDRESSING • Here, operand field holds the name of the register which contains the operand • Operand field = R (name of the register) • EA = R • e.g., ADD A, B • Add the content of B register with the content of A register and load the result into A register • A  A + B Opcode A B 10 2/27/2021 DR. PRASENJIT DEY • Speed • Limited registers  smaller operand field  shorter instructions  faster fetch • No memory access, very fast execution • Address space • Registers have limited address space so limited range
  • 11. REGISTER ADDRESSING: DEMONSTRATION Instruction Registers Opcode Address of B register operand G A B C D E F 11 2/27/2021 DR. PRASENJIT DEY
  • 12. REGISTER INDIRECT ADDRESSING • Operand field holds the name of the register which contains memory location of the operand • Operand field = R (name of the register/register pair) • e.g., ADD A, (B) • Add the content of memory location pointed by B register with A register and store the result into A register • A  A + M[B]; Opcode A ( B) 12 2/27/2021 DR. PRASENJIT DEY • Speed • One register access and one memory access is required to get the data • Address space • Large address space: 2n where n = word length
  • 13. REGISTER INDIRECT ADDRESSING: DEMONSTRATION Instruction Memory Opcode Address of B register operand 00 04 08 12 16 20 Registers Pointer to operand = M[08] 13 2/27/2021 DR. PRASENJIT DEY A B C D E 24
  • 14. DISPLACEMENT ADDRESSING • Operand field contains two values: 1. Base register (B) 2. Offset value (R) • Addition of offset value with base register value provides the effective address of the operand • EA = (B) + R • e.g., ADD A, 12(B) • Useful in accessing local variables 14 2/27/2021 DR. PRASENJIT DEY
  • 15. DISPLACEMENT ADDRESSING: DEMONSTRATION Instruction Memory Opcode 12 Register B = 04 operand 24 00 04 08 12 16 20 + 15 2/27/2021 DR. PRASENJIT DEY M[12+04]
  • 16. RELATIVE ADDRESSING • A version of displacement addressing • B = Base register = Program counter (PC) • R = Address part of the instruction • EA = (PC) + R • Addition of offset field value with PC register value provides the effective address of the operand • e.g., ADD A, 4(PC) 1. Add 4 with PC value and form EA=(PC+4) 2. A  A + PC[4] • Used in control transfer instructions 16 2/27/2021 DR. PRASENJIT DEY
  • 17. RELATIVE ADDRESSING: DEMONSTRATION Instruction Memory Opcode Register B = 04 operand 24 00 04 08 12 16 20 + 17 2/27/2021 DR. PRASENJIT DEY PC[04] PC
  • 18. INDEXED ADDRESSING • A version of displacement addressing • B = Base register = Index register • R = Address part of the instruction • EA = (B) + R • e.g., ADD A, 04(B) 1. Add 4 with B register value and form EA = (B+4) 2. A  A + B[4] • Useful in array addressing • B = base address of the array • R = index amount 18 2/27/2021 DR. PRASENJIT DEY
  • 19. INDEXED ADDRESSING: DEMONSTRATION Instruction Memory Opcode Index Register B Displacement = 04 operand Registers 08 A B C E + 19 2/27/2021 DR. PRASENJIT DEY D 24 00 04 08 12 16 20 M[08+04]
  • 20. AUTO-INCREMENT OR AUTO-DECREMENT ADDRESSING • In case of auto-increment addressing • B = base address of the array • d = size of each element in the array • e.g., ADD A, (B)+ 1. A  A + M[B] 2. B  B + d 20 2/27/2021 DR. PRASENJIT DEY • Useful when iterating through array in a loop • Used to implement a stack as push and pop • In case of auto-decrement addressing • B = base address of the array • d = size of each element in the array • e.g., ADD A, -(B) 1. B  B - d; 2. A  A + M[B]
  • 21. STACK ADDRESSING • Operand is (implicitly) on top of stack • e.g. ADD • Pop top two items from stack and add and push result on top 21 2/27/2021 DR. PRASENJIT DEY 40 08 45 14 12 48 45 14 12 Before the operation After the operation
  • 22. ADDRESSING MODES FOR DIFFERENT INSTRUCTIONS • Load/store instructions • displacement and indexed addressing 22 2/27/2021 DR. PRASENJIT DEY • Branch instructions • Direct / Absolute addressing • Relative addressing • Register indirect addressing • Arithmetic and logical instructions • Immediate addressing • Register addressing • Register indirect addressing

Editor's Notes

  1. 2
  2. 5
  3. 5
  4. 5
  5. 6
  6. 7
  7. 6
  8. 7
  9. 6
  10. 7
  11. 6
  12. 15
  13. 6
  14. 17
  15. 6
  16. 19
  17. 6
  18. 7
  19. 21