title: convert int to float in MIPS assembly
body: <p>My method is to spill the int register and load into the float register and then convert</p>
  
  <pre><code>li $t0, 2       
  sw $t0, -88($fp)    
  l.s $f4, -88($fp)
  cvt.d.s $f6, $f4
  </code></pre>
  
  <p>I'm trying to translate an expression like</p>
  
  <pre><code>float a = 3.0;
  float b = a / 2;
  </code></pre>
  
  <p>But the above method doesn't give me a proper answer (print out <code>inf</code>).</p>
  
  <p>So where have I done wrong? Any suggestions?</p>
  
  <p>P.S.  <code>2</code> doesn't know the lhs operand is a float type so I can not load <code>2.0</code> instead </p>