Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int strstrProblem(char*, char*) STRSTR PROBLEM IMPLEMENTATION
- {
- _asm
- {
- mov esi, 0
- mov eax, [ebp + 8]
- mov ebx, [ebp + 12]
- while_i: cmp[ebx + esi], 0
- je stop_while_i
- mov edi, 0
- push esi
- while_j : cmp[eax + edi], 0
- je finalsir_2
- mov cl, [eax + edi]
- cmp cl, [ebx + esi]
- jne finalsir_2
- inc esi
- inc edi
- jmp while_j
- finalsir_2 : cmp[eax + edi], 0
- je return_ok
- pop esi
- inc esi
- jmp while_i
- stop_while_i : mov eax, -1
- jmp gata
- return_ok:
- pop esi
- mov eax,esi
- gata:
- }
- }
- /*main*/
- cin.getline(s1,NMAX);
- cin.getline(s2,NMAX);
- int pozitie;
- _asm
- {
- lea eax,s1
- lea ebx,s2
- push ebx
- push eax
- call strstrProblem
- add esp,8
- mov pozitie, eax
- }
- cout << pozitie;
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement