Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. int strstrProblem(char*, char*) STRSTR PROBLEM IMPLEMENTATION
  2. {
  3. _asm
  4. {
  5. mov esi, 0
  6. mov eax, [ebp + 8]
  7. mov ebx, [ebp + 12]
  8. while_i: cmp[ebx + esi], 0
  9. je stop_while_i
  10. mov edi, 0
  11. push esi
  12. while_j : cmp[eax + edi], 0
  13. je finalsir_2
  14. mov cl, [eax + edi]
  15. cmp cl, [ebx + esi]
  16. jne finalsir_2
  17. inc esi
  18. inc edi
  19. jmp while_j
  20. finalsir_2 : cmp[eax + edi], 0
  21. je return_ok
  22. pop esi
  23. inc esi
  24. jmp while_i
  25. stop_while_i : mov eax, -1
  26. jmp gata
  27. return_ok:
  28. pop esi
  29. mov eax,esi
  30. gata:
  31.  
  32. }
  33. }
  34. /*main*/
  35. cin.getline(s1,NMAX);
  36. cin.getline(s2,NMAX);
  37. int pozitie;
  38. _asm
  39. {
  40. lea eax,s1
  41. lea ebx,s2
  42. push ebx
  43. push eax
  44. call strstrProblem
  45. add esp,8
  46. mov pozitie, eax
  47. }
  48. cout << pozitie;
  49. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement