Luna/libc/src/arch/x86_64/crt0.S

21 lines
313 B
ArmAsm
Raw Normal View History

.section .text
.global _start
.extern exit
_start:
# Set up end of the stack frame linked list.
movq $0, %rbp
pushq %rbp # rip=0
pushq %rbp # rbp=0
movq %rsp, %rbp
# Run the global constructors.
call _init
# Run main
call main
# Terminate the process with the exit code.
movl %eax, %edi
call exit