Call exit syscall on program exit
This commit is contained in:
parent
692725dc96
commit
e1b61560c9
1 changed files with 9 additions and 0 deletions
|
@ -25,6 +25,15 @@ global_asm!(
|
||||||
_start:
|
_start:
|
||||||
mov $stack, %rsp
|
mov $stack, %rsp
|
||||||
call main
|
call main
|
||||||
|
mov $1, %rdi
|
||||||
|
mov %rax, %rsi
|
||||||
|
call _syscall
|
||||||
|
|
||||||
|
.global _syscall
|
||||||
|
_syscall:
|
||||||
|
mov %rcx, %r10
|
||||||
|
syscall
|
||||||
|
ret
|
||||||
|
|
||||||
.section .bss
|
.section .bss
|
||||||
.align 16
|
.align 16
|
||||||
|
|
Loading…
Add table
Reference in a new issue