title: Loading an address in MIPS64
body: <p>This is probably a simple, obvious thing I'm just not seeing, but how do I load an address in a MIPS64 processor?  In a MIPS32 processor the following assembler pseudo-instruction:</p>
  
  <pre><code>la $at, LabelAddr
  </code></pre>
  
  <p>Expands into:</p>
  
  <pre><code>lui $at, LabelAddr[31:16]
  ori $at,$at, LabelAddr[15:0]
  </code></pre>
  
  <p>Looking at the MIPS64 instruction set, I see that <code>lui</code> still loads a 16-bit immediate into the upper half of a 32-bit word.  There doesn't appear to be any kind of expanded instruction that loads an immediate anywhere into the upper area of a 64-bit word.  This seems, then, that to do the equivalent of an <code>la</code> pseudo-instruction I'd need to expand into code something like:</p>
  
  <pre><code>lui $at, LabelAddr[63:48]
  ori $at, $at, LabelAddr[47:32]
  sll $at, 16
  ori $at, $at, LabelAddr[31:16]
  sll $at, 16
  ori $at, $at, LabelAddr[15:0]
  </code></pre>
  
  <p>This strikes me as a bit ... convoluted for something as basic as loading an address so it leaves me convinced that I've overlooked something.</p>
  
  <p>What is it I've overlooked (if anything)?</p>