SlideShare a Scribd company logo
1 of 9
ADDRESSING MODES
Mr. C.KARTHIKEYAN,
ASSISTANT PROFESSOR,
ECE , RMKCET
MIPS ADDRESSING MODES
Immediate Addressing Mode
Register Addressing Mode
Base or Displacement Addressing Mode
PC-Relative Addressing Mode
Pseudo Direct Addressing Mode
Immediate Addressing Mode
Eg:1. addi $s0, $zero,7
Eg:4. ori $t0,$t1,8
$s0 = 0 + 7
$t0 = $t1 | 8
Register Addressing Mode
Eg:1. add $s1,$s2,$s3
Eg:2. or $t0,$t1,$t2
Eg:3. srl $s7,$s0,4
$s1 = $s2 + $s3
$t0 = $t1 | $t2
$s7 = $s0 >> 4
Base / Displacement Addressing Mode
Eg:1. lw $s1, 4($s2)
Eg:2. sw $s0, 8($s4)
$s1 = Mem [$s2+4]
Mem [$s4+8] = $s0
PC – Relative Addressing Mode
Eg:1. beq $s1, $s2, 25
Eg:2. bne $s0, $s1, 20
if($s1==$s2) goto PC+4+100
if($s0!=$s1) goto PC+4+80
Pseudo Direct Addressing Mode
Eg:1. j 2500
Eg:2. jr $ra
Eg:3. jal 2500
go to 10000
goto $ra
$ra=PC+4 goto 10000
EXAMPLE
Loop: add $t1,$s3,$s3
add $t1,$t1,$t1
add $t1,$t1,$s6
lw $t0,0($t1)
bne $t0,$s5,Exit
add $s3,$s3,$s4
j loop
Exit:
35 9 8 0
0 19 19 9 0 32
5 8 21 2
2 2000
8000
8004
8008
0 9 9 9 0 32
0 9 22 9 0 32
0 19 20 19 0 32
8012
8016
8020
8024
8028
Starting address 8000
0000 0000 0001 0000 0101 0001 0000 0000
0000 0000 0001 0000 0101 0001 0000 0000
00000000000100000101000100000000
000000 00000100000101000100000000
R - Type
000000 00000100000101000100 000000
sll
000000 00000 10000 01010 00100 000000
sll $t2,
op rs rt rd Shift amt fn
$s0, 4
0x00105100 00105100 hex

More Related Content

More from KarthikeyanC53 (14)

1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx
 
Floating Point Multiplication.pptx
Floating Point Multiplication.pptxFloating Point Multiplication.pptx
Floating Point Multiplication.pptx
 
Floating Point Addition.pptx
Floating Point Addition.pptxFloating Point Addition.pptx
Floating Point Addition.pptx
 
Floating Point Represenataion.pptx
Floating Point Represenataion.pptxFloating Point Represenataion.pptx
Floating Point Represenataion.pptx
 
Refined Version of Division.pptx
Refined Version of Division.pptxRefined Version of Division.pptx
Refined Version of Division.pptx
 
Version 1 Division.pptx
Version 1 Division.pptxVersion 1 Division.pptx
Version 1 Division.pptx
 
BOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxBOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptx
 
2. Addition and Subtraction.pptx
2. Addition and Subtraction.pptx2. Addition and Subtraction.pptx
2. Addition and Subtraction.pptx
 
1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx
 
6.Performance.pptx
6.Performance.pptx6.Performance.pptx
6.Performance.pptx
 
4.Instruction Formats.pptx
4.Instruction Formats.pptx4.Instruction Formats.pptx
4.Instruction Formats.pptx
 
3. Instruction Set.pptx
3. Instruction Set.pptx3. Instruction Set.pptx
3. Instruction Set.pptx
 
2. Eight Great Ideas.pptx
2. Eight Great Ideas.pptx2. Eight Great Ideas.pptx
2. Eight Great Ideas.pptx
 
1. Introduction to CAO.pptx
1. Introduction to CAO.pptx1. Introduction to CAO.pptx
1. Introduction to CAO.pptx
 

Recently uploaded

01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
AshwaniAnuragi1
 
☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...
☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...
☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...
mikehavy0
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
Kira Dess
 

Recently uploaded (20)

Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Geometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdfGeometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdf
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptx
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
DBMS-Report on Student management system.pptx
DBMS-Report on Student management system.pptxDBMS-Report on Student management system.pptx
DBMS-Report on Student management system.pptx
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdf
 
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Independent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging StationIndependent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging Station
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...
☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...
☎️Looking for Abortion Pills? Contact +27791653574.. 💊💊Available in Gaborone ...
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & Modernization
 

5. Addressing Modes.pptx

  • 2. MIPS ADDRESSING MODES Immediate Addressing Mode Register Addressing Mode Base or Displacement Addressing Mode PC-Relative Addressing Mode Pseudo Direct Addressing Mode
  • 3. Immediate Addressing Mode Eg:1. addi $s0, $zero,7 Eg:4. ori $t0,$t1,8 $s0 = 0 + 7 $t0 = $t1 | 8
  • 4. Register Addressing Mode Eg:1. add $s1,$s2,$s3 Eg:2. or $t0,$t1,$t2 Eg:3. srl $s7,$s0,4 $s1 = $s2 + $s3 $t0 = $t1 | $t2 $s7 = $s0 >> 4
  • 5. Base / Displacement Addressing Mode Eg:1. lw $s1, 4($s2) Eg:2. sw $s0, 8($s4) $s1 = Mem [$s2+4] Mem [$s4+8] = $s0
  • 6. PC – Relative Addressing Mode Eg:1. beq $s1, $s2, 25 Eg:2. bne $s0, $s1, 20 if($s1==$s2) goto PC+4+100 if($s0!=$s1) goto PC+4+80
  • 7. Pseudo Direct Addressing Mode Eg:1. j 2500 Eg:2. jr $ra Eg:3. jal 2500 go to 10000 goto $ra $ra=PC+4 goto 10000
  • 8. EXAMPLE Loop: add $t1,$s3,$s3 add $t1,$t1,$t1 add $t1,$t1,$s6 lw $t0,0($t1) bne $t0,$s5,Exit add $s3,$s3,$s4 j loop Exit: 35 9 8 0 0 19 19 9 0 32 5 8 21 2 2 2000 8000 8004 8008 0 9 9 9 0 32 0 9 22 9 0 32 0 19 20 19 0 32 8012 8016 8020 8024 8028 Starting address 8000
  • 9. 0000 0000 0001 0000 0101 0001 0000 0000 0000 0000 0001 0000 0101 0001 0000 0000 00000000000100000101000100000000 000000 00000100000101000100000000 R - Type 000000 00000100000101000100 000000 sll 000000 00000 10000 01010 00100 000000 sll $t2, op rs rt rd Shift amt fn $s0, 4 0x00105100 00105100 hex

Editor's Notes

  1. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
  2. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
  3. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
  4. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
  5. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.