Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. section .text
  2. global main
  3.  
  4. main:
  5. call _open
  6. call _read
  7. call _write
  8. mov eax, 0
  9. ret
  10.  
  11. _read:
  12. mov eax, 3
  13. mov ebx, esi
  14. mov ecx, str
  15. mov edx, 999
  16. int 0x80
  17.  
  18. _open:
  19. mov eax, 5
  20. mov ebx, file
  21. mov ecx, 00
  22. int 0x80
  23. mov esi, eax
  24. mov edx, 999
  25. int 0x80
  26.  
  27. _open:
  28. mov eax, 5
  29. mov ebx, file_write:
  30. mov eax, 4
  31. mov ebx, 1
  32. mov ecx, str
  33. mov edx, 999
  34. int 0x80
  35. call _n
  36.  
  37. _n:
  38. mov eax, 4
  39. mov ebx, 1
  40. mov ecx, 0xa
  41. mov edx, 1
  42. int 0x80
  43.  
  44. _exit:
  45. mov eax, 1
  46. mov ebx, 0
  47. int 0x80
  48.  
  49.  
  50. section .data
  51. file: db './ex_1.S'
  52.  
  53. section .bss
  54. str: resb 999
  55. mov ecx, 00
  56. int 0x80
  57. mov esi, eax
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement