SlideShare a Scribd company logo
1 of 11
Assignment on
TOPIC: Different types of Addressing Modes
Course code: CSE322
COURSE TITTLE: Computer Architecture & Organization
SUBMITTED TO
Dewan Mamun Raza
Lecturer in Department of CSE
Daffodil InternationalUniversity
SUBMITTED BY
Nusrat Jahan Tamanna
SEC: 0-2
Date of submission: 2.08.2020
Addressing modes:
Addressing modes are nothing but the different ways in which the
location of an operand can be specified in an instruction. The number
of addressing modes that a processor supports changes according to
the instruction set it is based on, however there are a few generic ones
that are present in almost all processors and are thus of utmost
importance.
They are as follows:
• register (or register-direct) addressing: R1
• register indirect addressing: M[R1]
• immediate addressing: data
• direct (or absolute) addressing: M[address]
• indirect addressing: M[M[address]]
• implicit addressing: default location
• relative & indexed addressing: M[R1+address]
• pre-decrement, post-decrement, pre-increment, ...
(1)Register (or register-direct) Addressing:
In register mode ,a register contains the operand. The operand is
specified with in one of the processor register. Instruction specifies the
register in which the operand is stored. In register addressing the
operand is placed in one of 8 bit or 16 bit general purpose registers.The
data is in the register that is specifiedby the instruction. Here one register
reference is required to access the data.
Example: Move
MOV C , A C ← A ( Here A is the operand specified in register)
In register,
Add
ADD B A ← A + B ( Here B is the operand specified in register)
In register,
Figure:
Figure: Register Addressing Diagram
(2)Register Indirect Addressing:
The instruction specifies the register in which the memory address of operand is
placed. Itdo not specify the operand itself but its location with in the memory
whereoperand is placed. In this addressing, theoperand offsetis placed in any
one of the registers BX,BP,SI,DI as specified in the instruction.
Example:
Move
MOV A , M A ← [[H][L]] Itmoves the data frommemory location specified
by HL register pair to A
The 8086 CPU’s let me access memory directly through a register using the
register indirect addressing mode.
Figure:
Figure: Register Indirect Addressing Diagram
(3)Immediate Addressing:
The operand is specified with in the instruction.Operand itself is provided in the
instruction rather than its address. In this mode data is present in address field of
instruction .Designed like one address instruction format.
Note:Limitation in the immediate mode is that the range of constants are restricted by
size of address field.
Example:
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)
Figure:
Figure: Immediate Addressing Diagram
Example: MOV AL, 35H (move the data 35H into AL register)
(4)Direct (or absolute) addressing:
The instruction specifies the direct address of the operand.Thememory address
is specified wherethe actual operand is. The operand’s offset is given in the
instruction as an 8 bit or 16 bit displacement element. In this addressing mode the 16 bit
effective address of the data is the part of the instruction.Here only one memory
reference operation is required to access the data.
Example:
Load Accumulator
LDA 2805h A ← [2805] Itloads the data frommemory location 2805 to
A.
Store Accumulator STA
2803h [2803] ←A Itstores the data fromA to memory location 2803
Example: ADD AL,[0301] //add the contents of offset address 0301 to AL
Figure:
Figure: Direct Addressing Diagram
(5)Indirect Addressing:
The instruction specifies the indirect address where the effective
address of the operand is placed. The memory address is specified
where the actual address of operand is placed. The indirect addressing
mode uses a register to hold the actual address that will finally be used
in data moves ,the register itself is not the address, but rather the
number in the register.
Example:
Move
MOV A, 2802h A ← [[2802]]
It moves the data from memory location
specified by the location 2802 to A.
Figure:
Figure: Indirect Addressing Diagram
(6)Implicit Addressing:
It is also called inherent addressing mode. The operand is implied by the
instruction. The operand is hidden/fixed inside the instruction. All actions occur in
CPU. Mostof the logical Group instructions belong to this addressing mode. All
actions occur within CPU.
Example:Complement Accumulator CMA
(Hereaccumulator A is implied by the instruction) Complement
Carry Flag CMC (HereFlags register is implied by the instruction) Set Carry Flag
STC (HereFlags register is implied by the instruction).
(7)Relative Addressing Mode:
In relative addressing mode, contents of ProgramCounter PC is added to address
part of instruction to obtain effective address. Theaddress partof the instruction
is called as offsetand it can +ve or – ve. When the offset is added to the PC the
resultant number is the memory location where the operand will be placed.
Example:
Relative Addressing Mode:
Figure: Relative Addressing Diagram
(8)Index Addressing Mode:
In index addressing mode, contents of Indexregister is added to address partof
instruction to obtain effective address. The address partof instruction holds the
beginning/baseaddress and is called as base. The index register hold the index
value, which is +ve. Base remains same, the index changes. When the baseis
added to the index register the resultant number is the memory location where
the operand will be placed.
Example:
Figure: Indexed Addressing Diagram
(9)Auto-increment or Auto-decrement Addressing Mode:
Itis similar to register indirect addressing mode.Herethe register is incremented
or decremented before or after its value is used.
I. Example:
Figure: IndirectAddressing Diagram
II. Example:
Figure: Indirect Addressing Diagram

More Related Content

What's hot

Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
Introduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control BusIntroduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control BusHem Pokhrel
 
Cohen and Sutherland Algorithm for 7-8 marks
Cohen and Sutherland Algorithm for 7-8 marksCohen and Sutherland Algorithm for 7-8 marks
Cohen and Sutherland Algorithm for 7-8 marksRehan Khan
 
32 dynamic linking nd overlays
32 dynamic linking nd overlays32 dynamic linking nd overlays
32 dynamic linking nd overlaysmyrajendra
 
3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )MdFazleRabbi18
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modesRamaPrabha24
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash functionChirag Patel
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & DecoderPritam Shil
 
Addressing modes
Addressing modesAddressing modes
Addressing modesMukta Garg
 
Sequential circuits in digital logic design
Sequential circuits in digital logic designSequential circuits in digital logic design
Sequential circuits in digital logic designNallapati Anindra
 
Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)Imesha Perera
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generationVipul Naik
 

What's hot (20)

Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Huffman coding
Huffman coding Huffman coding
Huffman coding
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Introduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control BusIntroduction to Bus | Address, Data, Control Bus
Introduction to Bus | Address, Data, Control Bus
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
 
Cohen and Sutherland Algorithm for 7-8 marks
Cohen and Sutherland Algorithm for 7-8 marksCohen and Sutherland Algorithm for 7-8 marks
Cohen and Sutherland Algorithm for 7-8 marks
 
RTL
RTLRTL
RTL
 
32 dynamic linking nd overlays
32 dynamic linking nd overlays32 dynamic linking nd overlays
32 dynamic linking nd overlays
 
3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
ADDRESSING MODE
ADDRESSING MODEADDRESSING MODE
ADDRESSING MODE
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
Back patching
Back patchingBack patching
Back patching
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & Decoder
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Sequential circuits in digital logic design
Sequential circuits in digital logic designSequential circuits in digital logic design
Sequential circuits in digital logic design
 
Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 

Similar to Assignment on different types of addressing modes

Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.caoUmme habiba
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxujjwalmatoliya
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Advanced computer architect lesson 3 and 4
Advanced computer architect lesson 3 and 4Advanced computer architect lesson 3 and 4
Advanced computer architect lesson 3 and 4Ismail Mukiibi
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086sravanithonta79
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Chinmayee samal
 
Addressing modes presentation
Addressing modes presentationAddressing modes presentation
Addressing modes presentationUmeshBhattarai4
 
Addressing modes Breifly
Addressing modes BreiflyAddressing modes Breifly
Addressing modes BreiflyTahir Jalali
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdfHimanshuPant41
 
(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)Alveena Saleem
 
02 Addressing Modes.pptx
02 Addressing Modes.pptx02 Addressing Modes.pptx
02 Addressing Modes.pptxssuser586772
 
Unit i ca- mips addressing
Unit i  ca- mips addressingUnit i  ca- mips addressing
Unit i ca- mips addressingPraba haran
 
ITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxSabaNaeem26
 
Addressing modes
Addressing modesAddressing modes
Addressing modesSelvi Suba
 

Similar to Assignment on different types of addressing modes (20)

Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.cao
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptx
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Advanced computer architect lesson 3 and 4
Advanced computer architect lesson 3 and 4Advanced computer architect lesson 3 and 4
Advanced computer architect lesson 3 and 4
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
Chapter3.1 3-mikroprocessor
Chapter3.1 3-mikroprocessorChapter3.1 3-mikroprocessor
Chapter3.1 3-mikroprocessor
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085
 
Addressing modes presentation
Addressing modes presentationAddressing modes presentation
Addressing modes presentation
 
Addressing modes Breifly
Addressing modes BreiflyAddressing modes Breifly
Addressing modes Breifly
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
02 Addressing Modes.pptx
02 Addressing Modes.pptx02 Addressing Modes.pptx
02 Addressing Modes.pptx
 
Al2ed chapter4
Al2ed chapter4Al2ed chapter4
Al2ed chapter4
 
Unit i ca- mips addressing
Unit i  ca- mips addressingUnit i  ca- mips addressing
Unit i ca- mips addressing
 
Lecture 06
Lecture 06Lecture 06
Lecture 06
 
ITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptx
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing
Addressing Addressing
Addressing
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 

Recently uploaded (20)

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Assignment on different types of addressing modes

  • 1. Assignment on TOPIC: Different types of Addressing Modes Course code: CSE322 COURSE TITTLE: Computer Architecture & Organization SUBMITTED TO Dewan Mamun Raza Lecturer in Department of CSE Daffodil InternationalUniversity SUBMITTED BY Nusrat Jahan Tamanna SEC: 0-2 Date of submission: 2.08.2020 Addressing modes:
  • 2. Addressing modes are nothing but the different ways in which the location of an operand can be specified in an instruction. The number of addressing modes that a processor supports changes according to the instruction set it is based on, however there are a few generic ones that are present in almost all processors and are thus of utmost importance. They are as follows: • register (or register-direct) addressing: R1 • register indirect addressing: M[R1] • immediate addressing: data • direct (or absolute) addressing: M[address] • indirect addressing: M[M[address]] • implicit addressing: default location • relative & indexed addressing: M[R1+address] • pre-decrement, post-decrement, pre-increment, ... (1)Register (or register-direct) Addressing: In register mode ,a register contains the operand. The operand is specified with in one of the processor register. Instruction specifies the register in which the operand is stored. In register addressing the operand is placed in one of 8 bit or 16 bit general purpose registers.The data is in the register that is specifiedby the instruction. Here one register reference is required to access the data. Example: Move MOV C , A C ← A ( Here A is the operand specified in register) In register, Add
  • 3. ADD B A ← A + B ( Here B is the operand specified in register) In register, Figure: Figure: Register Addressing Diagram (2)Register Indirect Addressing: The instruction specifies the register in which the memory address of operand is placed. Itdo not specify the operand itself but its location with in the memory whereoperand is placed. In this addressing, theoperand offsetis placed in any one of the registers BX,BP,SI,DI as specified in the instruction. Example: Move MOV A , M A ← [[H][L]] Itmoves the data frommemory location specified by HL register pair to A
  • 4. The 8086 CPU’s let me access memory directly through a register using the register indirect addressing mode. Figure: Figure: Register Indirect Addressing Diagram (3)Immediate Addressing: The operand is specified with in the instruction.Operand itself is provided in the instruction rather than its address. In this mode data is present in address field of instruction .Designed like one address instruction format. Note:Limitation in the immediate mode is that the range of constants are restricted by size of address field. Example: 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)
  • 5. Figure: Figure: Immediate Addressing Diagram Example: MOV AL, 35H (move the data 35H into AL register) (4)Direct (or absolute) addressing: The instruction specifies the direct address of the operand.Thememory address is specified wherethe actual operand is. The operand’s offset is given in the instruction as an 8 bit or 16 bit displacement element. In this addressing mode the 16 bit effective address of the data is the part of the instruction.Here only one memory reference operation is required to access the data. Example: Load Accumulator LDA 2805h A ← [2805] Itloads the data frommemory location 2805 to A. Store Accumulator STA 2803h [2803] ←A Itstores the data fromA to memory location 2803 Example: ADD AL,[0301] //add the contents of offset address 0301 to AL Figure:
  • 6. Figure: Direct Addressing Diagram (5)Indirect Addressing: The instruction specifies the indirect address where the effective address of the operand is placed. The memory address is specified where the actual address of operand is placed. The indirect addressing mode uses a register to hold the actual address that will finally be used in data moves ,the register itself is not the address, but rather the number in the register. Example: Move MOV A, 2802h A ← [[2802]] It moves the data from memory location specified by the location 2802 to A.
  • 8. (6)Implicit Addressing: It is also called inherent addressing mode. The operand is implied by the instruction. The operand is hidden/fixed inside the instruction. All actions occur in CPU. Mostof the logical Group instructions belong to this addressing mode. All actions occur within CPU. Example:Complement Accumulator CMA (Hereaccumulator A is implied by the instruction) Complement Carry Flag CMC (HereFlags register is implied by the instruction) Set Carry Flag STC (HereFlags register is implied by the instruction). (7)Relative Addressing Mode: In relative addressing mode, contents of ProgramCounter PC is added to address part of instruction to obtain effective address. Theaddress partof the instruction is called as offsetand it can +ve or – ve. When the offset is added to the PC the resultant number is the memory location where the operand will be placed. Example: Relative Addressing Mode:
  • 9. Figure: Relative Addressing Diagram (8)Index Addressing Mode: In index addressing mode, contents of Indexregister is added to address partof instruction to obtain effective address. The address partof instruction holds the beginning/baseaddress and is called as base. The index register hold the index value, which is +ve. Base remains same, the index changes. When the baseis added to the index register the resultant number is the memory location where the operand will be placed. Example:
  • 10. Figure: Indexed Addressing Diagram (9)Auto-increment or Auto-decrement Addressing Mode: Itis similar to register indirect addressing mode.Herethe register is incremented or decremented before or after its value is used. I. Example:
  • 11. Figure: IndirectAddressing Diagram II. Example: Figure: Indirect Addressing Diagram