From 0672bcedffb5e604859c11a2e9caadaad7b8c91e Mon Sep 17 00:00:00 2001 From: stickynotememo Date: Thu, 18 Dec 2025 16:15:02 +1100 Subject: [PATCH] Add stage 1: assembly --- src/1_assembly.S | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/1_assembly.S diff --git a/src/1_assembly.S b/src/1_assembly.S new file mode 100644 index 0000000..c5520b7 --- /dev/null +++ b/src/1_assembly.S @@ -0,0 +1,18 @@ +global _1_assembly_func +section .text +; _start: mov rax, 1 ; system call for write + ; mov rdi, 1 ; file handle 1 is stdout + ; mov rsi, message ; address of string to output + ; mov rdx, 13 ; number of bytes + ; syscall ; invoke operating system to do the write + ; mov rax, 60 ; system call for exit + ; xor rdi, rdi ; exit code 0 + ; syscall ; invoke operating system to exit + +_1_assembly_func: + mov rax, message + ret + +section .data + +message: db "Hello from Assembly.", 21 ; note the newline at the end; Define variables in the data section