SlideShare a Scribd company logo
GOOD MORNING
FRIENDS!!!!!
ADDRESSING MODES
By Nithin Santhosh
WHAT IS ADDRESSING MODE?
The different ways in which location of an operand is specified in an instruction are
referred to as “Addressing Modes”.
The different types of generic addressing modes are Immediate, Register,
Absolute(Direct), Indirect, Index, Base with index, Base with index and offset, Relative,
Autoincrement, Autodecrement .
Register Addressing Mode
Register addressing mode involves the use of registers to hold the data to be
manipulated.
Eg : Mov A,R0
Mov R1,R0
Mov Res,R1
In this mode operand is the content of a processor register.
ABSOLUTE MODE(DIRECT MODE)
In the absolute or direct addressing mode, the data is in a ram memory location whose
address is known, and this address is given as a part of the instruction.
Eg : Mov Loc,R1
IMMEDIATE ADDRESSING MODE
In this addressing mode, the source operand is a constant.
In immediate addressing mode, as the name indicates when the
instruction is assembled, the operand comes immediately after the
opcode.
In this addressing mode the data must be immediately
preceded by the pound sign, ‘#’;
INDIRECT ADDRESSING MODE
In this addressing mode, the instruction does not give the operand or
its address explicitly.
This addressing mode provides information from which the memory address
or the operand can be determined. This address is the effective address of
the operand.
When we use this addressing mode here actually the register acts as a pointer, where
pointer is nothing but the register or memory location that contains the address of an
operand.
Continuation…..
Example : Move N,R1
Move #Num1,R2
Clear R0
LOOP: Add (R2),R0
Add #4,R2
Decrement R1
Branch>0 LOOP
Move R0,Sum
INDEX ADDRESSING MODE
This is useful in dealing with lists and arrays.
The effective address of the operand is generated by adding a constant
value to the contents of the register.
The register used may be either a special function register or general purpose
register, the register which we use here is known as “index register”.
We indicate the Index mode symbolically as X(Ri).
Continuation……….
In X(Ri)
X denotes the constant value contained in the instruction
and
Ri is the name of the register involved.
The effective address of the operand is given by
EA = X+[Ri].
The contents of the index registers are not changed in the
process of generating the effective address.
The value X defines an offset also called as a
displacement.
Continuation…….
Move #LIST,R0
Clear R1
Clear R2
Clear R3
Move N,R4
Add 4(R0),R1
Add 8(R0),R2
Add 12(R0),R3
Add #16,R0
Decrement R4
Branch>0 LOOP
Move R1,SUM1
Move R2,SUM2
Move R3,SUM3
LOOP:
RELATIVE ADDRESSING MODE
In this addressing mode the effective address is determined by the Index
mode using the program counter in the place of general purpose register
Ri.
ADDITIONAL MODES
The two additional modes are Autoincrement and Autodecrement mode.
Autoincrementmode – The effective address of the operand is the
contents of a register specified in the instruction. After accessing the
operand, the contents of this register are automatically incremented to
point to the next item in a list. The autoincrement mode is written as
(Ri)+
Autodecrementmode - The contents of a register specified in the
instruction are first automatically decremented and are then used as the
effective address of the operand. The Autodecrementmode is written as
-(Ri)
ADVANTAGE OF INDIRECT OVERDIRECT MODE
In direct addressing mode we cannot use loops, and in case of indirect addressing mode we
can use loop.
QUESTIONS
Registers R1 and R2 of a computer contain the decimal values 1200 and 4600. What is the
effective address of the memory operand in each of the following instructions?
Q1.
i) Load 20(R1),R5
a) 20 b) 4600 c)1220 d)1200
Ans : 1220
ii) Move #3000,R5
a)1220 b)1400 c)4600 d)None of the above
Ans : d) None of the above
iii) Store R5,30(R1,R2)
a)5830 b)5600 c)1200 d)4600
Ans : a)5830
iv) Add -(R2),R5
v) Add (R1)+,R5
a)1200 b)4599 c)1199 d)4600
Ans : b)4599
a)1199 b)1200 c)1198d)1201
Ans : d)1199
Q 2. Identify the addressing modes
i) ADD #6,R1
a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a) and e)
ii) ADD R1
a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a)
iii) ADD (R1)+,R5
a)Increment Mode b)Absolute(Direct) c) Autoincrement Mode d)Index e)Immediate
Ans : C) Autoincrement Mode
iv) Load 20(R1),R5
a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : d)Index
v) Store R5,30(R1,R2)
a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a)Base with index and offset
Sorting
The process of rearranging the elements so that they are in ascending
or descending order is called as sorting
The various types of sorting are bubble sort, quick sort, insertion
sort etc…
C-Language for bubble sorting
for (j=n-1;j>0;j=j-1)
{
for(k=j-1;k>0;k=k-1)
{
if(List[k]>List[j])
{
Temp=List[k];
List[k]=List[j];
List[j]=Temp;
}
}
}
ALP For Bubble Sorting
Move #LIST,R0
Move N,R1
Subtract #1,R1
OUTER Move R2,R2
Subtract #1,R1
MoveByte (R0,R1),R3
INNER CompareByte R3,(R0,R2)
Branch<=0 NEXT
MoveByte (R0,R2),R4
MoveByte R3,(R0,R2)
MoveByte R4,(R0,R1)
MoveByte R4,R3
NEXT Decrement R2
Branch>=0 INNER
Decrement R1
Branch>0 OUTER
END!!!!!

More Related Content

What's hot

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
Mani Kanth
 
Minimization of DFA.pptx
Minimization of DFA.pptxMinimization of DFA.pptx
Minimization of DFA.pptx
SadagopanS
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
Kevin Jadiya
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
Mohamed El-Serngawy
 
Computer Graphics - clipping
Computer Graphics - clippingComputer Graphics - clipping
Adjacency list
Adjacency listAdjacency list
Adjacency listStefi Yu
 
Data Structures- Part5 recursion
Data Structures- Part5 recursionData Structures- Part5 recursion
Data Structures- Part5 recursion
Abdullah Al-hazmy
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
Dr. Girish GS
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics Functions
SHAKOOR AB
 
fractals
fractalsfractals
Composite transformations
Composite transformationsComposite transformations
Composite transformationsMohd Arif
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
Jothi Lakshmi
 
Modes of data transfer
Modes of data transferModes of data transfer
Modes of data transfer
Shah Ishtiyaq Mehfooze
 
Register Organization of 80386
Register Organization of 80386Register Organization of 80386
Cohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping AlgorithmCohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping Algorithm
Maruf Abdullah (Rion)
 
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)
Prashant Srivastav
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
Dr.MAYA NAYAK
 
Clipping
ClippingClipping
Clipping
AMIT VIRAMGAMI
 
Elements of Dynamic Programming
Elements of Dynamic ProgrammingElements of Dynamic Programming
Elements of Dynamic Programming
Vishwajeet Shabadi
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
Arvind Kumar
 

What's hot (20)

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 
Minimization of DFA.pptx
Minimization of DFA.pptxMinimization of DFA.pptx
Minimization of DFA.pptx
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
 
Computer Graphics - clipping
Computer Graphics - clippingComputer Graphics - clipping
Computer Graphics - clipping
 
Adjacency list
Adjacency listAdjacency list
Adjacency list
 
Data Structures- Part5 recursion
Data Structures- Part5 recursionData Structures- Part5 recursion
Data Structures- Part5 recursion
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics Functions
 
fractals
fractalsfractals
fractals
 
Composite transformations
Composite transformationsComposite transformations
Composite transformations
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 
Modes of data transfer
Modes of data transferModes of data transfer
Modes of data transfer
 
Register Organization of 80386
Register Organization of 80386Register Organization of 80386
Register Organization of 80386
 
Cohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping AlgorithmCohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping Algorithm
 
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES(CBNST)
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 
Clipping
ClippingClipping
Clipping
 
Elements of Dynamic Programming
Elements of Dynamic ProgrammingElements of Dynamic Programming
Elements of Dynamic Programming
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
 

Similar to Addressing modes

Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
Dr. AISHWARYA N
 
Module 2 PPT of ES.pptx
Module 2 PPT of ES.pptxModule 2 PPT of ES.pptx
Module 2 PPT of ES.pptx
shruthi810379
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes ppt
mananjain543
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers final
SARITHA REDDY
 
8051 Addressing modes
8051 Addressing modes8051 Addressing modes
8051 Addressing modes
Ravikumar Tiwari
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
sb108ec
 
Unit vi
Unit viUnit vi
addressing-mode-of-8051.pdf
addressing-mode-of-8051.pdfaddressing-mode-of-8051.pdf
addressing-mode-of-8051.pdf
DhilibanSwaminathan
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
 
15CS44 MP & MC module 5
15CS44 MP & MC  module 515CS44 MP & MC  module 5
15CS44 MP & MC module 5
RLJIT
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction set
Shail Modi
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
Manju Badiger
 
UNIT 2 ERTS.ppt
UNIT 2 ERTS.pptUNIT 2 ERTS.ppt
UNIT 2 ERTS.ppt
CHENAGANIMEGHANA
 
Microprocessors and microcontrollers
Microprocessors and microcontrollers Microprocessors and microcontrollers
Microprocessors and microcontrollers durga_sekar
 
Lecture 06
Lecture 06Lecture 06
Lecture 06
sohelranasweet
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
Karthik Vivek
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
RAMESHBABUA3
 
COMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.pptCOMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.ppt
ssuserebb9821
 

Similar to Addressing modes (20)

Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Module 2 PPT of ES.pptx
Module 2 PPT of ES.pptxModule 2 PPT of ES.pptx
Module 2 PPT of ES.pptx
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes ppt
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers final
 
8051 Addressing modes
8051 Addressing modes8051 Addressing modes
8051 Addressing modes
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
addressingmodes8051.ppt
addressingmodes8051.pptaddressingmodes8051.ppt
addressingmodes8051.ppt
 
Unit vi
Unit viUnit vi
Unit vi
 
addressing-mode-of-8051.pdf
addressing-mode-of-8051.pdfaddressing-mode-of-8051.pdf
addressing-mode-of-8051.pdf
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
15CS44 MP & MC module 5
15CS44 MP & MC  module 515CS44 MP & MC  module 5
15CS44 MP & MC module 5
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction set
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
 
UNIT 2 ERTS.ppt
UNIT 2 ERTS.pptUNIT 2 ERTS.ppt
UNIT 2 ERTS.ppt
 
Microprocessors and microcontrollers
Microprocessors and microcontrollers Microprocessors and microcontrollers
Microprocessors and microcontrollers
 
Avr instruction set
Avr instruction setAvr instruction set
Avr instruction set
 
Lecture 06
Lecture 06Lecture 06
Lecture 06
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
COMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.pptCOMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.ppt
 

Recently uploaded

bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
RicletoEspinosa1
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 

Recently uploaded (20)

bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 

Addressing modes

  • 3. WHAT IS ADDRESSING MODE? The different ways in which location of an operand is specified in an instruction are referred to as “Addressing Modes”. The different types of generic addressing modes are Immediate, Register, Absolute(Direct), Indirect, Index, Base with index, Base with index and offset, Relative, Autoincrement, Autodecrement .
  • 4. Register Addressing Mode Register addressing mode involves the use of registers to hold the data to be manipulated. Eg : Mov A,R0 Mov R1,R0 Mov Res,R1 In this mode operand is the content of a processor register.
  • 5. ABSOLUTE MODE(DIRECT MODE) In the absolute or direct addressing mode, the data is in a ram memory location whose address is known, and this address is given as a part of the instruction. Eg : Mov Loc,R1
  • 6. IMMEDIATE ADDRESSING MODE In this addressing mode, the source operand is a constant. In immediate addressing mode, as the name indicates when the instruction is assembled, the operand comes immediately after the opcode. In this addressing mode the data must be immediately preceded by the pound sign, ‘#’;
  • 7. INDIRECT ADDRESSING MODE In this addressing mode, the instruction does not give the operand or its address explicitly. This addressing mode provides information from which the memory address or the operand can be determined. This address is the effective address of the operand. When we use this addressing mode here actually the register acts as a pointer, where pointer is nothing but the register or memory location that contains the address of an operand.
  • 8. Continuation….. Example : Move N,R1 Move #Num1,R2 Clear R0 LOOP: Add (R2),R0 Add #4,R2 Decrement R1 Branch>0 LOOP Move R0,Sum
  • 9. INDEX ADDRESSING MODE This is useful in dealing with lists and arrays. The effective address of the operand is generated by adding a constant value to the contents of the register. The register used may be either a special function register or general purpose register, the register which we use here is known as “index register”. We indicate the Index mode symbolically as X(Ri).
  • 10. Continuation………. In X(Ri) X denotes the constant value contained in the instruction and Ri is the name of the register involved. The effective address of the operand is given by EA = X+[Ri]. The contents of the index registers are not changed in the process of generating the effective address. The value X defines an offset also called as a displacement.
  • 11. Continuation……. Move #LIST,R0 Clear R1 Clear R2 Clear R3 Move N,R4 Add 4(R0),R1 Add 8(R0),R2 Add 12(R0),R3 Add #16,R0 Decrement R4 Branch>0 LOOP Move R1,SUM1 Move R2,SUM2 Move R3,SUM3 LOOP:
  • 12. RELATIVE ADDRESSING MODE In this addressing mode the effective address is determined by the Index mode using the program counter in the place of general purpose register Ri.
  • 13. ADDITIONAL MODES The two additional modes are Autoincrement and Autodecrement mode. Autoincrementmode – The effective address of the operand is the contents of a register specified in the instruction. After accessing the operand, the contents of this register are automatically incremented to point to the next item in a list. The autoincrement mode is written as (Ri)+ Autodecrementmode - The contents of a register specified in the instruction are first automatically decremented and are then used as the effective address of the operand. The Autodecrementmode is written as -(Ri)
  • 14. ADVANTAGE OF INDIRECT OVERDIRECT MODE In direct addressing mode we cannot use loops, and in case of indirect addressing mode we can use loop.
  • 15. QUESTIONS Registers R1 and R2 of a computer contain the decimal values 1200 and 4600. What is the effective address of the memory operand in each of the following instructions? Q1. i) Load 20(R1),R5 a) 20 b) 4600 c)1220 d)1200 Ans : 1220
  • 16. ii) Move #3000,R5 a)1220 b)1400 c)4600 d)None of the above Ans : d) None of the above iii) Store R5,30(R1,R2) a)5830 b)5600 c)1200 d)4600 Ans : a)5830
  • 17. iv) Add -(R2),R5 v) Add (R1)+,R5 a)1200 b)4599 c)1199 d)4600 Ans : b)4599 a)1199 b)1200 c)1198d)1201 Ans : d)1199
  • 18. Q 2. Identify the addressing modes i) ADD #6,R1 a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : a) and e) ii) ADD R1 a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : a)
  • 19. iii) ADD (R1)+,R5 a)Increment Mode b)Absolute(Direct) c) Autoincrement Mode d)Index e)Immediate Ans : C) Autoincrement Mode iv) Load 20(R1),R5 a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : d)Index
  • 20. v) Store R5,30(R1,R2) a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : a)Base with index and offset
  • 21. Sorting The process of rearranging the elements so that they are in ascending or descending order is called as sorting The various types of sorting are bubble sort, quick sort, insertion sort etc…
  • 22. C-Language for bubble sorting for (j=n-1;j>0;j=j-1) { for(k=j-1;k>0;k=k-1) { if(List[k]>List[j]) { Temp=List[k]; List[k]=List[j]; List[j]=Temp; } } }
  • 23. ALP For Bubble Sorting Move #LIST,R0 Move N,R1 Subtract #1,R1 OUTER Move R2,R2 Subtract #1,R1 MoveByte (R0,R1),R3 INNER CompareByte R3,(R0,R2) Branch<=0 NEXT MoveByte (R0,R2),R4 MoveByte R3,(R0,R2) MoveByte R4,(R0,R1) MoveByte R4,R3 NEXT Decrement R2 Branch>=0 INNER Decrement R1 Branch>0 OUTER