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.
my code is below
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;
I am using inline assembly in c language.