title: Converting Mips loop into C
body: <p>I'm having a lot of trouble converting MIPS to C (I'm very new to it). I've firstly tried to write what is happening next to the MIPS code.</p>
  
  <pre><code>blank: addi  $t0, $zero, 0                         t0 = 0;
         addi  $t2, $zero, ' '                       t2 = 32;
         j     L2                                  jump to L2;
  L1:    sb    $t2, 0($t1)                         store new value in array
         addi  $t0, $t0, 1                         t0++;
  L2:    add   $t1, $a0, $t0                     t1 = a0 + t0;
         lbu   $t3, 0($t1)                         t3 = array(t0)
         bne   $t3, $zero, L1                    if(t3!=0) jump to L1
         jr    $ra                                return; //jump to return address in ra
  </code></pre>
  
  <p>I've have then tried to convert it to C but I'm very confused and I think it is wrong. </p>
  
  <pre><code>int array[32];
  int i;
  
  for(int i=1; i!=0; i++)
      array[i]=i;
  
  return;
  </code></pre>
  
  <p>If anyone could offer some hints or corrections I would appreciate it greatly</p>