title: Assembly Language Code issue
body: <p>I am learning Assembly language on my own time and trying to solve the following problem. I wrote the code, but it will not work.</p>
  
  <blockquote>
    <p>Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n -1) +Fib(n-2).</p>
  </blockquote>
  
  <p>I need this program written in Assembly language. Use the comments in the program template as instructions to write the code in Assembly language. I would like the program to be written in Assembly language following this programming logic:</p>
  
  <pre><code>.data
  ;declare an array 
  .code
  main proc
  ;move 0 into ebx to initialize
  ;move 1 into edx to store the first Fib value
  ;move edx into an array ; store the first Fib value
  
  ; prepare to loop
  ; loop counter for 6 more values
  ; move esi,4
  ; array index for 3rd Fib value
  
  L1:
  ;move ebx into eax
  ;add edx and eax
  ;move edx into the array of esi
  ; eax = ebx 
  ; eax = eax + edx 
  ; store the Fib value
  ;move edx into ebx
  ; prepare for next iteration
  ;move eax into edx
  ;add 4 to esi
  ;Loop  L1
  
  invoke  ExitProcess,0
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>ExitProcess PROTO
  
  .data
  
  numbers DWORD 10 DUP (?)
  
  .code
  main PROC
      mov ebx,0
      mov edx,1
      mov numbers,edx
  
      mov ecx,6
      mov esi,4
  
  L1:
      mov eax,ebx
      add eax,edx
      mov esi,OFFSET numbers
      mov [esi],edx
      mov eax,ebx
      add eax,edx
      mov edx,ebx
      mov eax,edx
      add esi,4
  Loop L1
  
      call ExitProcess
  main ENDP
  END
  </code></pre>
  
  <p>I edited my code to the following:</p>
  
  <pre><code>ExitProcess PROTO
  
  .data
  
  numbers DWORD 10 DUP (?)
  
  .code
  main PROC
      mov ebx,0
      mov edx,1
      mov numbers,edx
  
      mov ecx,10
      mov esi,4
      mov esi,OFFSET numbers
  
  L1:
      mov eax,ebx
      add eax,edx
      mov [esi],edx
      mov ebx,edx
      mov edx,eax
      add esi,4
      Loop L1
  
      call ExitProcess
  main ENDP
  END
  </code></pre>
  
  <p>When I step through the code, the eax register and edx register will show the Fibonacci sequence values: 1, 2, 3, 5, 8, 13, etc. However, does the code store the eax register or the edx register value in the numbers array? If not how do I do this.</p>
  
  <p>Is this a valid line of code? Does it store the edx value in the numbers array?</p>
  
  <pre><code>mov numbers,edx
  </code></pre>
  
  <p>How do I store the eax or edx value in the numbers array?</p>