Guest User

Untitled

a guest
Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. .file "hw2.c"
  2. .def ___main; .scl 2; .type 32; .endef
  3. .text
  4. .globl _main
  5. .def _main; .scl 2; .type 32; .endef
  6. _main:
  7. pushl %ebp
  8. movl %esp, %ebp
  9. andl $-16, %esp
  10. subl $16, %esp
  11. call ___main
  12. movl $5, (%esp)
  13. call _hello
  14. leave
  15. ret
  16. .section .rdata,"dr"
  17. LC0:
  18. .ascii "Hello, world!\0"
  19. .text
  20. .globl _hello
  21. .def _hello; .scl 2; .type 32; .endef
  22. _hello:
  23. pushl %ebp
  24. movl %esp, %ebp
  25. subl $40, %esp
  26. movl $0, -12(%ebp)
  27. jmp L3
  28. L4:
  29. movl $LC0, (%esp)
  30. call _puts
  31. incl -12(%ebp)
  32. L3:
  33. movl -12(%ebp), %eax
  34. cmpl 8(%ebp), %eax
  35. jl L4
  36. leave
  37. ret
  38. .def _puts; .scl 2; .type 32; .endef
Add Comment
Please, Sign In to add comment