title: MIPS getting around using pseudo-instructions, What is going wrong?
body: <p>My question is about how I'm supposed to get around the use of pseudo-instructions such as <code>la</code> and <code>li</code>. Many Internet sources just use pseudo-instructions anyway, which confuses me to some extent.
  Part of my problem is with what is going wrong with this snippet. The simulator spits out a syntax error with the <code>liu</code> instruction and I don't understand what is going wrong. </p>
  
  <p>From my understanding, the <code>liu</code> command grabs the significant bits, shifts left 16 bits, and puts that in the register ($a0). The <code>ori</code> instruction takes the label, and performs an OR on the lower 16 bits which is effectively adding it to the register. </p>
  
  <pre><code>       .data
  m1:    .asciiz "Some string"
  
         .text
  main:   
         lui     $a0, m1        # loads m1 into $a0 to be printed
         ori     $a0, $a0, m1
  </code></pre>
  
  <p>Am I not supposed to use the label m1 for <code>liu</code> or <code>ori</code>? And if I'm not meant to, what do I do instead?</p>
  
  <p>I've already read <a href="https://stackoverflow.com/questions/1535228/mips-the-equivalent-of-la-instruction-without-using-pseudo-codes">this</a> and I understand what is supposed to be happening, but I'm still not sure as to why my instructions has a different effect, and why there is a <code>andi $a0,$a0,0x0000ffff</code> before the <code>liu</code> and <code>ori</code> commands. </p>
  
  <p>The MIPS simulator I'm using is QtSpim if that is relevant.
  I've gone looking for answers to this question here and elsewhere, and I've failed to understand them. 
  Any help/corrections would be wonderful.</p>