2011-04-19 00:09:44 +04:00
|
|
|
; ToAruOS User CRT0
|
2011-04-07 01:50:37 +04:00
|
|
|
BITS 32
|
|
|
|
|
|
|
|
global _start
|
2011-04-19 00:09:44 +04:00
|
|
|
_start: ; Global entry point
|
|
|
|
pop eax ; Our stack is slightly off
|
|
|
|
extern main ;
|
|
|
|
call main ; call C main function
|
2011-04-09 00:27:12 +04:00
|
|
|
mov ebx, eax ; return value from main
|
2011-04-19 00:09:44 +04:00
|
|
|
mov eax, 0x0 ; sys_exit
|
|
|
|
int 0x7F ; syscall
|
|
|
|
_wait: ; wait until we've been deschuled
|
2011-04-07 01:50:37 +04:00
|
|
|
hlt
|
|
|
|
jmp _wait
|
2011-04-19 00:09:44 +04:00
|
|
|
|
|
|
|
; vim:syntax=nasm
|
|
|
|
; vim:noexpandtab
|
|
|
|
; vim:tabstop=4
|
|
|
|
; vim:shiftwidth=4
|