Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 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, strsection .text
  15. global main
  16.  
  17. main:
  18. call _open
  19. call _read
  20. call _write
  21. mov eax, 0
  22. ret
  23.  
  24. _read:
  25. mov eax, 3
  26. mov ebx, esi
  27. mov ecx, str
  28. mov edx, 999
  29. int 0x80
  30.  
  31. _open:
  32. mov eax, 5
  33. mov ebx, file
  34. mov ecx, 00
  35. int 0x80
  36. mov esi, eax
  37. mov edx, 999
  38. int 0x80
  39.  
  40. _open:
  41. mov eax, 5
  42. mov ebx, file_write:
  43. mov eax, 4
  44. mov ebx, 1
  45. mov ecx, str
  46. mov edx, 999
  47. int 0x80
  48. call _n
  49.  
  50. _n:
  51. mov eax, 4
  52. mov ebx, 1
  53. mov ecx, 0xa
  54. mov edx, 1
  55. int 0x80
  56.  
  57. _exit:
  58. mov eax, 1
  59. mov ebx, 0
  60. int 0x80
  61.  
  62.  
  63. section .data
  64. file: db './ex_1.S'
  65.  
  66. section .bss
  67. str: resb 999
  68. mov ecx, 00
  69. int 0x80
  70. mov esi, eax
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement