Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. .intel_syntax noprefix
  2. .text
  3. .globl main
  4.  
  5. main:
  6. mov eax,offset messg
  7. push eax
  8. call policz
  9.  
  10. push eax
  11. mov eax,offset printf_arg1
  12. push eax
  13. call printf
  14.  
  15. add esp,8
  16. exit:
  17. mov eax,0
  18. ret
  19.  
  20. policz:
  21. push esi
  22. mov esi,[esp+8]
  23. mov eax,0
  24.  
  25. spacjousuwacz:
  26. cmpb [esi],0
  27. je koniecstring
  28. cmpb [esi],' '
  29. jne wyraz
  30. inc esi
  31. jmp spacjousuwacz
  32. wyraz:
  33. inc eax
  34. przewijamwyraz:
  35. inc esi
  36. cmpb [esi],0
  37. je koniecstring
  38. cmpb [esi],' '
  39. je spacjousuwacz
  40. jmp przewijamwyraz
  41. koniecstring:
  42. pop esi
  43. ret 4
  44.  
  45.  
  46. .data
  47. messg:
  48. .asciz "a bc d"
  49. printf_arg1:
  50. .asciz "%i"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement