hello,
i'm writing a c code in wich i use asm code.
the asm part consists in comparing two arrays and returns 1 if the array2 contains array1 and 0 if not. but it doesnt work if you could correct me plz
here is my code:


SEGMENT .code

GLOBAL _compar
_compar:
mov eax,dword
cmp eax,dword
jl fin
xor ebx, ebx
outer_loop:
xor esi,esi
inner_loop:
mov ebx,dword
cmp ebx,dword
jne isdifferent
add ebx, 2
cmp ebx,dword
jne outer_loop
xor eax,eax
ret
isdifferent:
add esi,2
cmp esi,dword
jl inner_loop
fin:
mov eax,1
ret

i don't know if the way to use the var used inc in the asm code is correct
i called the asm function in my c code code like this
if (compar(taille,a,aux,t)==0)
{printf ("il ya egalité dans la ligne%d",f);
nbr++;
}
Posted on 2011-02-08 15:51:55 by marooh