title: Is my MIPS program correct?
body: <p>Write a MIPS program that generates and adds up all even numbers from 1 to 100.</p>
  <ul>
  <li>it must have at least one loop</li>
  <li>it should store the sum in register R12</li>
  </ul>
  <hr />
  And this is what I wrote:
  <pre><code>main:
      li      $t0, 0               # clear register $t0 to zero
      li      $t4, 0               # clear register $t4 to zero
  loop:
      add     $t0, $t0, 2          # generating even numbers in register $t0
      add     $t4, $t4, $t0        #  compute the sume
      bne     $t0, 100, loop       # if t0 reached 100 then go to loop.
      b endloop                    # branch to endloop
  endloop:
      li      $v0, 10              # terminate program run and
      syscall                      # Exit 
  </code></pre>
  <p>Is this correct?</p>