title: MIPS (or SPIM): Loading floating point numbers
body: <p>I am working on a little mini compiler while trying to learn some MIPS here.  Here's my issue:</p>
  
  <p>MIPS has an instruction li (load immediate) which would work like this</p>
  
  <pre><code>li $5,100
  </code></pre>
  
  <p>which would load 100 into register 5.</p>
  
  <p>However, I need to load floats into registers right now and am struggling with figuring out a way to do it...since li $5,2.5 does not work.</p>
  
  <p>Anyone have any advice?</p>
  
  <p>I am working in C, I was thinking I could somehow get the integer representation of the float I am working with (i.e. so the floats binary representation == the ints binary representation) then load the "integer" into the register and treat it like a float from then on.  </p>
  
  <p>Maybe its too late but Im stuck right now.</p>