crt-posix.s - scc - simple c99 compiler
HTML git clone git://git.simple-cc.org/scc
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
crt-posix.s (332B)
---
1 .globl _environ
2 .comm _environ,8,8
3
4 .text
5 .globl _start
6 _start:
7 movq %rsp,%rbp
8
9 /* load argc, argv, envp from stack */
10 movq (%rbp),%rdi /* argc */
11 leaq 8(%rbp),%rsi /* argv */
12 leaq 16(%rbp,%rdi,8),%rdx /* envp = argv + 8*argc + 8 */
13 movq %rdx,_environ(%rip)
14
15 call main
16 movl %eax,%edi
17 jmp exit