Call exit syscall on program exit

This commit is contained in:
Mathieu Strypsteen 2024-12-25 13:39:06 +01:00
parent 692725dc96
commit e1b61560c9

View file

@ -25,6 +25,15 @@ global_asm!(
_start:
mov $stack, %rsp
call main
mov $1, %rdi
mov %rax, %rsi
call _syscall
.global _syscall
_syscall:
mov %rcx, %r10
syscall
ret
.section .bss
.align 16