title: MIPS Roman numeral converter
body: <p>So I am in the beginning stages of planning my Roman numeral converter (Roman numerals to integers) in MIPS. I am stuck on how to convert the numbers where there's a number less than the next number (i.e. <code>IV</code> [<code>4</code>]). I was thinking about doing the below but it still doesn't solve my problem. </p>
  
  <p>put this somewhere in the data section:</p>
  
  <pre><code>all_numerals: .asciiz "IVXLCDMivxlcdm"
  all_values:   .byte 1, 5, 10, 50, 100, 500, 1000, 1, 5, 10, 50, 100, 500, 1000
  </code></pre>
  
  <p>I would then read the character and compare it to its index in <code>all_values</code> and add that to a register and repeat. </p>
  
  <p>Does anyone know an efficient way to do this? As it stands I am going to do a loop that would compare the last character (<code>I</code> [<code>1</code>]) to the next character (<code>V</code> [<code>5</code>]) and if it is less subtract the character from the most recent (<code>5 - 1</code>), but I think this would be inefficient. Any help is much appreciated. </p>