aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorturret <turret@duck.com>2023-09-06 20:38:31 -0500
committerturret <turret@duck.com>2023-09-06 20:38:31 -0500
commit5286d18e2356684475b644cbad3ae581ff927796 (patch)
tree877a0a58b9af4f8d141276b6ad7b0d6425ab003a
parent0b874ac3d9a4ab1ecab73ae070f92b866c358f24 (diff)
downloadcat-5286d18e2356684475b644cbad3ae581ff927796.tar.gz
cat-5286d18e2356684475b644cbad3ae581ff927796.tar.bz2
cat-5286d18e2356684475b644cbad3ae581ff927796.zip
code initial commit
-rw-r--r--.gitignore2
-rwxr-xr-xbuild.sh2
-rw-r--r--cat.s16
3 files changed, 20 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a61ce72
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.o
+cat
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..a99b820
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,2 @@
+nasm -f elf64 cat.s -o cat.o
+ld cat.o -o cat
diff --git a/cat.s b/cat.s
new file mode 100644
index 0000000..79d9f30
--- /dev/null
+++ b/cat.s
@@ -0,0 +1,16 @@
+ global _start
+ section .text
+_start:
+ mov rax, 1
+ mov rdi, 1
+ mov rsi, msg
+ mov rdx, msgSize
+ syscall
+
+ mov rax, 60
+ mov rdi, 0
+ syscall
+
+ section .data
+msg: db "Hello, world!", 10
+msgSize: EQU $ - msg