title: How to find sum of even numbers in assembly?
body: <p>I am learning assembly on my own. I want to find sum of even numbers. However, it does not work, I can't understand why, it does not show any error.</p>
  <p>my code is below</p>
  <pre><code>        mov ebx, 0;
          mov ESI, [arr]; 
          mov ECX, [arr_size];
  
      sumeven:
          push ebx;
         
          mov eax, dword ptr[ESI];
          mov ebx, 2;
          cdq
          idiv ebx;
          cmp edx, 0;
          je adding;
          
  
  
      adding: 
          pop ebx;
          add ebx, dword ptr[ESI];
          add ESI, 4;
          loop sumeven;
  
  
      mov result, ebx;
  
  </code></pre>
  <p>I am using inline assembly in c language.</p>