title: Case statement code runs in Mars simulator but errors in QtSpim
body: <p>so as the title mentions I have written this code in the Mars MIPS simulator and assembling and running the code there works fine, no errors. When I take the same file to QtSpim and run it there I get the following error:</p>
  
  <blockquote>
  <pre><code>Instruction references undefined symbol at 0x00400014
  [0x00400014] 0x0c000000  jal 0x00000000 [main]           ; 188: jal main
  </code></pre>
  </blockquote>
  
  <p>Seems that QtSpim has issues with me calling the label address of <code>CASE</code> and I'm not experienced enough to see why. Here is my code:</p>
  
  <pre><code>.data
  jumptable: .word isD, is1, is2, is3, is4
  currentvalue: .asciiz "Returned : i = "     #Used for result output
  space: .asciiz " \n"                        #Used for result output
  
  .text
  MAIN:
  li $a0, 0               #testing use of the argument register toholdinput
  jal CASE                #set $ra and go to the case procedure
  
  li $v0, 4               #load syscall 4 to print text
  la $a0, currentvalue    #load the string value of currentvalue into $a0
  syscall                 #print out currentvalue
  
  li $v0, 1               #load syscall 1 to print integer
  move $a0, $t3           #move the contents of $t3 to $a0
  syscall                 #print the integer in $a0
  
  li $v0, 10              #load syscall 10 to exit program
  syscall                 #exit program
  
  
  CASE:
      la $t3, ($a0)       #load 'i' into a temporary value since we will be using $a0 for syscalls shortly
  
      blt $a0, 1, isD     #jump to default if i less than 1
      bgt $a0, 4, isD     #jump to default if i greater than 4
  
      sll $t0, $a0, 2     #multiplies 'i' by 2^2
      la $t1, jumptable   #load the base address of the jump table into $t1
      add $t1, $t1, $t0   #$t1 = $t1(base address of table) + $t0('i' * 4)
      lw $t2, ($t1)       #$t2 is loaded with the address of label found in $t1
      jr $t2
  
      is1:
          addi $t3, $t3, 1    #increment 'i' by 1
          jr $ra              #jump back to the return address in main
      is2:
          addi $t3, $t3, 2    #increment 'i' by 2
          jr $ra              #jump back to the return address in main
      is3:
          addi $t3, $t3, 3    #increment 'i' by 3
          jr $ra              #jump back to the return address in main
      is4:
          addi $t3, $t3, 4    #increment 'i' by 4
          jr $ra              #jump back to the return address in main
      isD:
          li $t0, 0           #set 'i' to 0
          jr $ra              #jump back to the return address in main
  </code></pre>