title: How to pass an input string from user to a MIPS program
body: <p>I'm trying to solve a problem to write assembly language program to detect if a phrase or characters entered by the user is a
  palindrome.</p>
  
  <p>I've gotten this far, and I believe everything should work, but I'm wondering how I can implement this so that it takes an actual word to test.
  When I run in MARS, there's simply no input option.</p>
  
  <pre><code>.data
  string_space: .space 1024
  is_palin_msg: .asciiz "The string is a palindrome.\n"
  not_palin_msg: .asciiz "The string is not a palindrome.\n"
  
  .text
  main: 
  la $a0, string_space
  li $a1, 1024
  li $v0, 8
  syscall
  
  la $t1, string_space
  la $t2, string_space
  
  length_loop:
  lb $t3, ($t2)
  beqz $t3, end_length_loop
  addu $t2, $t2, 1 
  b length_loop
  
  end_length_loop:
  subu $t2, $t2, 2
  
  test_loop:
  bge $t1, $t2, is_palin
  
  lb $t3, ($t1)
  lb $t4, ($t2)
  bne $t3, $t4, not_palin
  
  addu $t1, $t1, 1
  subu $t2, $t2, 1
  b test_loop
  
  is_palin: 
  la $a0, is_palin_msg
  li $v0, 4
  syscall
  b exit
  
  not_palin:
  la $a0, not_palin_msg
  li $v0, 4
  syscall
  b exit
  
  exit: 
  li $v0, 10
  syscall
  </code></pre>
  
  <p>I've tried</p>
  
  <pre><code>string_space: .asciiz "Enter your word:\n"
  </code></pre>
  
  <p>and also</p>
  
  <pre><code>string_space: .asciiz "racecar"
  </code></pre>
  
  <p>but I haven't quite been able to get it yet.</p>
  
  <p>Any tips?</p>