This commit is contained in:
nub31
2025-10-20 20:15:29 +02:00
parent 7697f7b7cc
commit 7a3a461519
10 changed files with 125 additions and 70 deletions

View File

@@ -103,10 +103,11 @@ if (modules.TryGetValue("main", out var mainModule))
.text
.globl _start
_start:
mov rdi, rsp # Pass stack pointer to main (length + cstring pointers)
mov rdi, [rsp] # argc
mov rsi, [rsp + 8] # argv
call {mainFunction.Prototype.ExternSymbol}
mov rdi, rax # Move return value into rdi
mov rax, 60 # syscall: exit
mov rdi, rax # Move return value into rdi
mov rax, 60 # syscall: exit
syscall
""";