title: MIPS: Comparing user input string to an array of strings in memory
body: <p>I am new to assembly language, and I have a project that I am struggling with. I don't want code; I just want to make sure I am thinking about the problem correctly so I don't drive myself crazy implementing a bad or down-right incorrect approach. </p>
  
  <p>The problem can be summarized as such:</p>
  
  <p>We have an array of strings in memory as such:</p>
  
  <pre><code>.data
  animals:    .asciiz    "bear", "tiger", "gorilla", "horse", "dog"
  </code></pre>
  
  <p>We want to take a user's input string and store it into str:</p>
  
  <pre><code>.data
  animals:    .asciiz    "bear", "tiger", "gorilla", "horse", "dog"
  str: .space  64    #user input stored here
  </code></pre>
  
  <p>Then we want to see if the user has entered something that exists in the existing arry of strings in memory. So if the user were to enter, "horse" we would return "Found!" and if they were to enter "garage" we would return "Not found."</p>
  
  <p>To actually do this, I am thinking that I would need to compare every character (each byte) of the input string with the corresponding character (byte) of each string in the array. </p>
  
  <p>I have two main questions: is this a good approach/correct thinking about the problem? and how could I go about making the program recognize when has hit the end of one string in the array and started a new one? </p>
  
  <p>Thank you so much for any responses. I'm sorry if any of this is unclear or a bad question. I am having a hard time wrapping my head around assembly.</p>