title: Arrays in MASM Assembly (very confused beginner)
body: <p>I have a pretty basic question:
  How do you populate arrays in assembly? In high level programming languages you can use a for-loop to set a value to each index, but I'm not sure of how to accomplish the same thing assembly. I know this is wrong, but this is what I have:</p>
  
  <pre><code>ExitProcess PROTO
  .data
  warray WORD 1,2,3,4
  darray DWORD ?
  
  .code
  main PROC
  mov edi, OFFSET warray
  mov esi, OFFSET darray
  mov ecx, LENGTHOF warray
  
  
  L1:
  mov ax, [edi]          ;i want to move a number from warray to ax
  movzx esi,ax           ;i want to move that number into darray...
  add edi, TYPE warray   ;this points to the next number?
  
      loop L1 
  
      call ExitProcess
  main ENDP
  END
  </code></pre>
  
  <p>Each time the loop runs, ax will be overwritten with the value of the array's index, right? Instead how do I populate darray with the array elements from warray? Any help would be very much appreciated...I'm pretty confused.</p>