title: Storing values from an array into a register (Assembly)
body: <p>I have an array of longs (size 4) and I want to store each of those 4 values into its own separate register. But I'm not sure how to do this because I've never worked with arrays in assembly. For example, I want to store <code>array[0]</code> into <code>r9</code>, <code>array[1]</code> into <code>r10</code>, etc. Can someone help me in doing this? Here is my code so far. <code>lhs</code> is the pointer to the array.</p>
  
  <pre><code>define(lhs,%rdi)
  define(rhs_d,%esi)
  define(rhs,%rsi)
  define(result,%rdx)
  
  .text
  
  
  .globl addBignumInt
      .type   addBignumInt, @function
  addBignumInt:
  .LFB18:
      .cfi_startproc
      # code goes here
      movslq  rhs_d, rhs
  
      .cfi_endproc
  .LFE18:
      .size   addBignumInt, .-addBignumInt
  </code></pre>
  
  <p>So, essentially what I want to do is
      <code>movq    lhs[0], %r9</code>
  but obviously this isn't correct</p>