fork download
  1. .globl main
  2. .data
  3. _string: .ascii "Hello\0"
  4. _string2: .ascii "World\0"
  5. _format: .ascii "%s %s\n\0"
  6.  
  7. .text
  8. main: // push params, format params, call fn, clear params, return
  9.  
  10. pushl $_string2
  11. pushl $_string
  12. call _printStr
  13. addl $8, %esp
  14. xor %eax, %eax
  15. ret
  16.  
  17. //function to print a string passed to it on the stack
  18. _printStr:
  19. push %ebp # save old frame ptr
  20. movl %esp, %ebp # set frame ptr
  21. pushl 12(%ebp)
  22. pushl 8(%ebp)
  23. pushl $_format
  24. call printf
  25. addl $12, %esp # clear params from stack
  26. leave
  27. ret
  28.  
Success #stdin #stdout 0.02s 1524KB
stdin
Standard input is empty
stdout
Hello World