From 848c0c6a3fcd3a05a2d8d5fbb3eb550bc423f807 Mon Sep 17 00:00:00 2001 From: Druid520 Date: Mon, 17 Aug 2026 10:47:46 -0700 Subject: ADD: charge basics stuff. --- src/start.s | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/start.s (limited to 'src/start.s') diff --git a/src/start.s b/src/start.s new file mode 100644 index 0000000..58efed0 --- /dev/null +++ b/src/start.s @@ -0,0 +1,17 @@ +.section .text +.globl _start +.type _start, @function +_start: + xorq %rbp, %rbp # frame ptr (%rbp) = null. marks stack bottom. + + movl (%rsp), %edi # argc = first 4 bytes of stack. + leaq 8(%rsp), %rsi # argv = address of first arg ptr. + + call main # see main.c. + + movl %eax, %edi # status = ret val. + movl $1, %eax # SYS_exit = 1. + syscall + + .size _start, .-_start + hlt # if syscall fails hang. -- cgit 1.4.1