1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
%ifndef _BUILTIN_EXIT_ASM %define _BUILTIN_EXIT_ASM builtin_exit: push bp mov bp, sp push .msg_fmt call printf add sp, 2 * 1 add sp, 2 ; cleanup previous call address jmp terminal .msg_fmt db 'exiting...\n', 0 %endif