Advertisement
eXFq7GJ1cC

Untitled

Jun 24th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. # linux
  2. $ gcc -xc -S -o - -<<<'int main() { puts("Hello, world!"); }' -std=c99 -include stdio.h -masm=intel -m32 -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables
  3. .file ""
  4. .intel_syntax noprefix
  5. .section .rodata
  6. .LC0:
  7. .string "Hello, world!"
  8. .text
  9. .globl main
  10. .type main, @function
  11. main:
  12. push ebp
  13. mov ebp, esp
  14. and esp, -16
  15. sub esp, 16
  16. mov DWORD PTR [esp], OFFSET FLAT:.LC0
  17. call puts
  18. mov eax, 0
  19. leave
  20. ret
  21. .size main, .-main
  22. .ident "GCC: (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1"
  23. .section .note.GNU-stack,"",@progbits
  24.  
  25.  
  26. # mingw
  27. $ i686-pc-mingw32-gcc -xc -S -o - -<<<'int main() { puts("Hello, world!"); }' -std=c99 -include stdio.h -masm=intel
  28. .file ""
  29. .intel_syntax noprefix
  30. .def ___main; .scl 2; .type 32; .endef
  31. .section .rdata,"dr"
  32. LC0:
  33. .ascii "Hello, world!\0"
  34. .text
  35. .globl _main
  36. .def _main; .scl 2; .type 32; .endef
  37. _main:
  38. push ebp
  39. mov ebp, esp
  40. and esp, -16
  41. sub esp, 16
  42. call ___main
  43. mov DWORD PTR [esp], OFFSET FLAT:LC0
  44. call _puts
  45. mov eax, 0
  46. leave
  47. ret
  48. .def _puts; .scl 2; .type 32; .endef
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement