Kernel - General fixing after ARM7 changes
[tpg/acess2.git] / Usermode / Libraries / crt0.o_src / crt0.asm
index 07db9de..531a378 100644 (file)
 [global _start]
 [global start]
 [extern main]
+[extern _exit]
 _start:
 start:
        call main
-       mov eax, ebx    ; Set Argument 1 to Return Value
-       xor eax, eax    ; Set EAX to SYS_EXIT (0)
-       int     0xAC
+       push eax
+
+       mov eax, [_crt0_exit_handler]
+       test eax, eax
+       jz .exit
+       call eax
+       
+.exit:
+       call _exit
        jmp $   ; This should never be reached
+[section .bss]
+[global _crt0_exit_handler]
+_crt0_exit_handler:
+       resd    1

UCC git Repository :: git.ucc.asn.au