;;; int search(char *table[], int n, char *motif) { ;;; int i, j ;;; for (i=0;i ecx ;;; j <=> edx ;;; motif <=> ebx ;;; table <=> esi ;;; search: push ebp mov ebp,esp mov ebx,[ebp+16] mov esi,[ebp+8] xor ecx,ecx search_for_i: cmp ecx,[ebp+12] jge search_end_for_i xor edx,edx mov edi,[esi+ecx*4] search_while: mov al,[ebx+edx] mov ah,[edi+edx] cmp al,0 je search_end_while cmp ah,0 je search_end_while cmp al,ah jne search_end_while inc edx jmp search_while search_end_while: or al,ah jnz search_next mov eax,ecx jmp search_leave search_next: inc ecx jmp search_for_i search_end_for_i: mov eax,-1 search_leave: mov esp,ebp pop ebp ret main: push ebp mov ebp,esp pushad mov eax,4*N push eax call malloc add esp,4 mov [table],eax mov dword [eax],chn0 mov dword [eax+4],chn1 mov dword [eax+8],chn2 mov dword [eax+12],chn3 mov dword [eax+16],chn4 mov dword [eax+20],chn5 mov eax,motif push eax mov eax,N push eax mov eax,[table] push eax call search add esp,12 push eax push dword msg call printf add esp,8 popad mov esp,ebp pop ebp xor eax,eax ret