title: MIPS, Digital Lab Sim, Hexadecimal keyboard handling
body: <p>I have a problem with handling the keyboard in Digital Lab Sim.
  I don't know how to check which button is clicked.
  I tried to do this in loop:</p>
  
  <pre><code>.data
  key:        .word 0x11, 0x21, 0x41, 0x81, 0x12, 0x22, 0x42, 0x82, 0x14, 0x24, 0x44, 0x84, 0x18, 0x28, 0x48, 0x88
  val:        .word 0, 0, 0
  
  
  .text
  
          addi $t0, $zero, 1
          add $t3, $zero, $zero
  
          la $t4, val
          la $t1, 0xffff0014
  
  loop:   beq $t0, 0, exit
  
          lb $t2, ($t1)
  
          beqz $t2, loop
  
  
  
          sw $t2, ($t4)
          addi $t3, $t3, 1
          addi $t4, $t4, 4
  
          bne $t3, 3, exit
  
          j loop
  
  exit:
  </code></pre>
  
  <p>but it does not work.</p>
  
  <p>Thanks in advance.</p>