Advertisement
MosTzz

Lungime sir

Jan 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Lungimea unui sir.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5.  
  6. int lungimeSir(const char *)
  7. {
  8. _asm {
  9. mov eax,[ebp+8]
  10. mov ecx,0
  11. startwhile:
  12. mov bl,[eax+ecx]
  13. cmp bl,'\0'
  14. je stopwhile
  15. inc ecx
  16. jmp startwhile
  17.  
  18. stopwhile:
  19.  
  20. mov eax,ecx
  21. }
  22. }
  23.  
  24. int main()
  25. {
  26. char c[] = "Ana are mere";
  27. int i=0;
  28. i = lungimeSir(c);
  29.  
  30. printf("%d", i);
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement