summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm-64/Makefile5
-rw-r--r--asm-64/hello.asm14
2 files changed, 19 insertions, 0 deletions
diff --git a/asm-64/Makefile b/asm-64/Makefile
new file mode 100644
index 0000000..c208e6c
--- /dev/null
+++ b/asm-64/Makefile
@@ -0,0 +1,5 @@
+all: hello
+
+hello:
+ nasm -felf64 -o hello.o hello.asm
+ ld -o hello hello.o
diff --git a/asm-64/hello.asm b/asm-64/hello.asm
new file mode 100644
index 0000000..9a1f712
--- /dev/null
+++ b/asm-64/hello.asm
@@ -0,0 +1,14 @@
+section .data
+ message db "Hello, World!"
+
+section .text
+ global _start
+_start:
+ mov rax, 1
+ mov rdi, 1
+ mov rsi, message
+ mov rdx, 13
+ syscall
+ mov rax, 60
+ mov rdi, 0
+ syscall