title: While Loop in Mips (New to Mips)
body: <p>How would I convert this code into Mips?</p>
  
  <pre><code>    int n = 100; int sum = 0; while (n&gt;0) {
      sum = sum + n;
      n--; }
  </code></pre>
  
  <p>I have this so far and am not sure what to do to finish this. </p>
  
  <pre><code>    .data
  
      n: .word 100
  
      .text
  
      main:
  
      la $t0, n   
      lw $t1, 0(t0)
      li $so, 0
  
      Loop:
         bgt $t1, $zero, EXIT
         add $t1, $s0, $t1
         addi $t1, $t1, -1
  
         j Loop
  
      exit:
  </code></pre>