Guest User

Untitled

a guest
Oct 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. section .text
  2. global _start
  3. _start:
  4. ;get input
  5. sub esp,2
  6. push name1
  7. call getString
  8. pop word[length1]
  9.  
  10. sub esp,2
  11. push name2
  12. call getString
  13. pop word[length2]
  14.  
  15. terminate:
  16. mov eax,4
  17. mov ebx,1
  18. mov ecx,lowername1
  19. mov edx,[length1]
  20. int 80h
  21.  
  22. mov eax,1
  23. mov ebx,0
  24. int 80h
  25.  
  26. getString:
  27. mov ebp,esp ;ebp+4=&name
  28. ;ebp+8=length
  29. mov eax,4
  30. mov ebx,1
  31. mov ecx,enterName
  32. mov edx,enterNameLen
  33. int 80h
  34.  
  35. mov eax,3
  36. mov ebx,0
  37. mov ecx,[ebp+4]
  38. mov edx,21
  39. int 80h
  40.  
  41. ;ecx = length
  42. dec al ;remove the n character
  43. ;byte[ecx]=length
  44. mov [ebp+8],al
  45. ret 4
Add Comment
Please, Sign In to add comment