title: MIPS load byte (lb) with offset
body: <p>I'm trying to load a byte from a word saved in data:</p>
  
  <pre><code>.data
      number:
      .word w1
  </code></pre>
  
  <p>part of the .text:  </p>
  
  <pre><code>stringlength:
  
      li $t2, 10
      li $t1, -1
  
      la $a0, number
  
  loop:
  
      addiu $t1, $t1, 1
  
      lb $t0, $t1($a0)
      bne $t0, $t2, loop
  
      move $v0, $t1
  
  jr $ra
  </code></pre>
  
  <p>*the code is not finished</p>
  
  <p>My problem is with,  </p>
  
  <pre><code>lb $t0, $t1($a0)
  </code></pre>
  
  <p>I'm trying to achieve a dynamic offset that will increment by 1, to check each byte in the string, to check wether it's equal to 10 (dec) or not.</p>
  
  <p>QtSPIM raises an exception syntax error about this line,</p>
  
  <p>What's the correct way of doing so?</p>