title: Help with finding address from MIPS instruction in hex
body: <p>Hi I am stuck on my assignment, which requires me to write a c program which reads in an input file such as this:</p>
  
  <pre><code>Registers
  r1 = 0c100009
  
  Instructions
  0c100009
  3c071001
  8ce20011
  84e33080
  80e48000
  ace2ffff
  a4e39001
  a0e48088
  03e00008
  </code></pre>
  
  <p>and find out whether the instruction is a save or load, how many bytes accessed by the instruction, and the address of the first of these bytes in memory.</p>
  
  <p>I need help understanding how the instructions work. I do know that I have to translate the instruction to binary, for example </p>
  
  <pre><code>8ce20011
  </code></pre>
  
  <p>to</p>
  
  <pre><code>100011 00111 00010 0000000000010001 
  </code></pre>
  
  <p>which is </p>
  
  <pre><code>lw $t3 17($s7)
  </code></pre>
  
  <p>but i don't know how to calculate the address and the number of bytes accessed. I am suppose to ignore all the instructions that are not save or load.</p>
  
  <p>And also, what does it mean by sign extend?</p>
  
  <p>Thank you for your help.</p>