fork download
  1. global _start
  2.  
  3. ;
  4. ; CONSTANTS
  5. ;
  6. SYS_WRITE equ 1
  7. SYS_EXIT equ 60
  8. STDOUT equ 1
  9.  
  10. ;
  11. ; Initialised data goes here
  12. ;
  13. SECTION .data
  14. hello db "Hello World!", 10 ; char *
  15. hello_len equ $-hello ; size_t
  16.  
  17. ;
  18. ; Code goes here
  19. ;
  20. SECTION .text
  21.  
  22. _start:
  23. ; syscall(SYS_WRITE, STDOUT, hello, hello_len);
  24. mov rax, SYS_WRITE
  25. mov rdi, STDOUT
  26. mov rsi, hello
  27. mov rdx, hello_len
  28. syscall
  29. push rax
  30.  
  31. ; syscall(SYS_EXIT, <sys_write return value> - hello_len);
  32. mov rax, SYS_EXIT
  33. pop rdi
  34. sub rdi, hello_len
  35. syscall
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Hello World!