title: passing arrays to functions in x86 asm
body: <p>I'm learning x86 asm and using masm, and am trying to write a function which has the equivalent signature to the following c function:</p>
  
  <pre><code>void func(double a[], double b[], double c[], int len);
  </code></pre>
  
  <p>I'm not sure how to implement it?</p>
  
  <p>The asm file will be compiled into a win32 DLL.</p>
  
  <p>So that I can understand how to do this, can someone please translate this very simple function into asm for me:</p>
  
  <pre><code>void func(double a[], double b[], double c[], int len)
  {
    // a, b, and c have the same length, given by len
    for (int i = 0; i &lt; length; i++)
      c[i] = a[i] + b[i];
  }
  </code></pre>
  
  <p>I tried writing a function like this in C, compiling it, and looking at the corresponding disassembled code in the exe using OllyDbg but I couldn't even find my function in it.</p>
  
  <p>Thank you kindly.</p>