Created
October 6, 2017 01:34
-
-
Save taida957789/0b13ebdf3bbc9d956d53fa7c51c2380e to your computer and use it in GitHub Desktop.
hello.asm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global _start | |
section .text: | |
_start: | |
call main | |
db 'Hello World', 00 | |
main: | |
xor rax, rax | |
xor rdi, rdi | |
xor rdx, rdx | |
xor rcx, rcx | |
mov rax, 1 ; rax = sys_write | |
mov rdi, 1 ; stdout | |
mov rsi, [rsp] ; buffer | |
mov rdx, 12 ; len(buffer) | |
syscall | |
mov rax, 60 ; rax = sys_exit | |
mov rdi, 0 | |
syscall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment