title: Unintended loop termination
body: <p>I'm writing a program for class that lowercases a text string. This works for the first character, but when it loops back for the second the beq $10,$0,done line always turns $10 to 0 and terminates the loop. I have no idea why.</p>
  
  <pre><code>.text
  .globl main
  main:
  lui $9, 0x1000
  
  loop:
  lbu $10,0($9)
  sll $0,$0,0
  
  beq $10,$0,done
  sll $0,$0,0
  
  addiu $10,$10,0x20
  sw  $10,0($9)
  addiu $9,$9,1
  ori $10,$0,1
  j loop
  
  sll $0,$0,0
  done: sll $0,$0,0
  
  .data
  string: .asciiz "ABCDEFG"
  </code></pre>