Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. .equ EXIT, 1
  2. .equ READ, 3
  3. .equ WRITE, 4
  4. .equ CLOSE, 6
  5. .equ PIPE, 42
  6.  
  7. .equ STDOUT, 0
  8.  
  9. .equ PIPE_WRITE, 4
  10. .equ PIPE_READ, 0
  11.  
  12. .section .data
  13. hello:
  14. .ascii "Hello\n"
  15.  
  16. .section .bss
  17. .lcomm buf, 6
  18. .lcomm pipes, 8
  19.  
  20. .section .text
  21. .globl _start
  22. _start:
  23. movl $PIPE, %eax
  24. movl $pipes, %ebx
  25. int $0x80
  26.  
  27. movl $WRITE, %eax
  28. movl $pipes, %ecx
  29. movl PIPE_WRITE(%ecx), %ebx
  30. movl $hello, %ecx
  31. movl $6, %edx
  32. int $0x80
  33.  
  34. movl $CLOSE, %eax
  35. int $0x80
  36.  
  37. movl $READ, %eax
  38. movl $pipes, %ecx
  39. movl PIPE_READ(%ecx), %ebx
  40. movl $buf, %ecx
  41. movl $6, %edx
  42. int $0x80
  43.  
  44. movl $CLOSE, %eax
  45. int $0x80
  46.  
  47. movl $WRITE, %eax
  48. movl $STDOUT, %ebx
  49. movl $buf, %ecx
  50. movl $6, %edx
  51. int $0x80
  52.  
  53. movl $EXIT, %eax
  54. movl $0, %ebx
  55. int $0x80
Add Comment
Please, Sign In to add comment