bits 64 global _start extern main section .text ; Begin the program with main() function _start: call main ; Exit the program by exit() syscall .exit: mov rdi, rax ; put the value of "return X;" (rax) as arg1 (error_code) mov rax, 60 ; sys_exit int 0x80 .loop: jmp .loop