diff options
Diffstat (limited to 'newlib/crt0.s')
| -rw-r--r-- | newlib/crt0.s | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/newlib/crt0.s b/newlib/crt0.s new file mode 100644 index 0000000..e8f0405 --- /dev/null +++ b/newlib/crt0.s @@ -0,0 +1,19 @@ +.global _start + +_start: + +# environment adress was passed on stack +pop %eax +mov %eax, environ + +# call main (argc and argv are on the stack) +call main + +# push exit code and pass to _exit syscall +push %eax +call _exit + +# this should never be reached! +.wait: + hlt +jmp .wait |
