We can only edit bold part to find positive number from given array. This is what i have tried in visual basic and i am just getting result as zero, Can someone say where it got wrong?
int solution(const int arr[], size_t arr_size)
{
int result = 0;
__asm
{
**MOV eax, arr
MOV edx, eax
MOV ebx, 10
XOR ecx, ecx
LEA esi, size arr
NEXT2 :
MOV edi, esi
SHR edi, 10
JNC NEXT1
JMP NEXT3
NEXT1 : INC ecx
NEXT3 : INC SI
DEC ebx
JNZ NEXT2
MOV[result], ecx;**
}
return result;
}
int main()
{
int result;
int arr[] = { 0, -1, 2, -3, 4, -5, 6, -7, 8, -9 };
result = solution(arr, sizeof(arr) / sizeof(arr[0]));
printf("Grade 6 result = %d\n", result);
getchar();
return 0;
}