title: How do you load each byte from a string and convert them to integer values in MIPS?
body: <p>For example, I have a string that only consists of characters from 1 to f(i.e. the hexes):</p>
  
  <pre><code>1f2698
  </code></pre>
  
  <p>It's passed in from command line as one of the argvs. How do I read each character and convert it into its corresponding integer?</p>
  
  <pre><code>1 -&gt; 1
  
  2 -&gt; 2
  
  ....
  
  f -&gt; 15
  </code></pre>
  
  <p>I know we have to use the load byte instruction and manipulate the ASCII values for the characters but now sure how to put everything together. Also, since the length of the input string is uncertain, how can we count the number of bytes it has?</p>
  
  <p>Could someone show me an example? I'm a beginner in MIPS assembly language, and some of the explanations of instructions I found online are really confusing, so it'd be great if you can go into more detail about how this works!</p>
  
  <p>Thanks in advance:)</p>