title: Timer in MIPS assembly
body: <p>I am implementing a game in MIPS assembly using MARS. I would like to implement some sort of timer that begins at 60 seconds and runs until it is 0. Every time a certain action is executed I would like to add additional time to the clock. Also, I would like to print the time remaining. Is it possible to do something like this, if so, how could I go about doing it?
  Thanks</p>
  
  <p>EDIT:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>.text
  li $v0,30        
  syscall
  
  move $t1, $v0
  
  
  li $v0,30          
  syscall
  move $t0, $v0
  
  sub    $t2, $t1, $t0
  
  
  li  $v0, 1
  syscall</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm not sure if I'm doing this correctly but the output I get is 213148934.</p>