Advertisement
LanguageAgnostic

ASM_hello64

Apr 5th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. section .data
  2. message: db "Hello, World", 10
  3.  
  4. section .text
  5. global _start
  6.  
  7. _start: mov rax, 1 ; system call for write
  8. mov rdi, 1 ; file handle 1 is stdout
  9. mov rsi, message ; address of string to output
  10. mov rdx, 13 ; number of bytes
  11. syscall ; invoke operating system to do the write
  12.  
  13. mov rax, 60 ; system call for exit
  14. xor rdi, rdi ; exit code 0
  15. syscall ; invoke operating system to exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement