Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. .intel_syntax noprefix
  2. .globl main
  3. .text
  4. main:
  5. xor edx,edx
  6. mov eax, offset messg
  7. push eax
  8. call znajdz
  9. add esp,4
  10. push eax
  11. mov eax, offset printf_arg1
  12. push eax
  13. call printf
  14. add esp , 8
  15. exit:
  16. mov eax,0
  17. ret
  18. znajdz:
  19. mov bl,[eax]
  20. inc eax
  21.  
  22. cmp bl,'*'
  23. je koniec
  24.  
  25. cmp bl,0
  26. je zero
  27.  
  28. inc edx
  29. jmp znajdz
  30.  
  31. koniec:
  32. mov eax,edx
  33. ret
  34. zero:
  35. ;#pop ecx
  36. mov eax,-1
  37. ret
  38.  
  39. .data
  40. messg: .asciz "Prz*ykladowy *tekst"
  41. printf_arg1: .asciz "%i"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement