title: MIPS : address out of range error
body: <p>I am trying to turn this C code:</p>
  
  <pre><code>    if (op == '+') {
        acc += val;
      }
  </code></pre>
  
  <p>into MIPS, and I can't figure out what is causing the address out of range error</p>
  
  <pre><code>#reads user input for the op
  li $v0, 12      # system call number for operator
  syscall         # reads the integer
  sw $v0, op      # stores the user input in op
  
  
  lw $t0, op      # stores op in $t0
  lbu $t1, '+'        # stores '+' in $t1
  
  # "if" statement
  bne $t0, $t1, Else  # branches if op is not equal to +
  lw $t2, acc     # stores acc in $t2
  lw $t3, val     # stores val in $t3
  
  add $t2, $t2, $t3   # adds $t2 and $t3 and stores the sum in $t2
  </code></pre>
  
  <p>Any help would be appreciated.</p>