title: MIPS Assembly: Immediate value is too large for field error
body: <p>When trying to store a user's inputed string, for part of a project, I receive the following error in spim when I simply load the file:</p>
  
  <p>Immediate value is too large for field: [0x0040009c]</p>
  
  <p>Below is my code:</p>
  
  <pre><code>.globl main
  .data
  prompt: .asciiz "0: exit, 1: enter string, 2: convert, 3: mean, 4: median, 5: display                 string, 6: display array: " #94 char long
  enter:  .asciiz "Enter string: "
  .text
  main:
  display: addi $v0, $v0, 4 #print prompt
          lui $a0, 0x1000  #grabbing prompt
          syscall
  
          addi $v0, $0, 5 #get integer
          syscall
  
          beq $v0, 0, rtn #if user type's 0, exit program
          nor $0, $0, $0 #nop
  
          beq $v0, 1, enterString #if user type's 1, enterString
          nor $0, $0, $0 #nop
  
  enterString:
      addi $v0, $0, 4 #printing string
      lui $a0, 0x1000 #grabbing prompt
      addi $a0, $a0, 95 #grabbing enter
      syscall
  
      addi $v0, $0, 8 #grabbing input
      sw $a0, 0x10000100 #storing inpuit - this specific address is a requirement
      syscall
  
  rtn: jr $ra
  </code></pre>
  
  <p>Now, when I run this I get the above mentioned error. However, I'm not quite sure why. It may be due to a string being 32 bit? Any explanations as to why would be appreciated. Thanks again!</p>