title: MIPS asm syntax - how to address lower 16 bits?
body: <p>when using offset+reg with <code>sw</code> instruction, the offset has to be signed 16 bit. How do I express it in an acceptable form? The GNU <code>as</code> complains the <code>expression is too complex</code>. Note that I do <em>not</em> want to use macro instructions.</p>
  
  <p>In fact, these 2 instructions are what macro instr <code>sw   $0, foo</code> expands to.</p>
  
  <pre><code>lui $1, (foo &gt;&gt; 16)         ; &lt;---- OK
  sw $0, (foo &amp; 0xFFFF)($1)   ; &lt;---- error: expr too complex ;)
  
  ...
  
  foo:
  .word 123
  </code></pre>