scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

crt.s (341B)


      1 	.bss
      2 	.globl	__environ
      3 __environ:
      4 	.quad	0
      5 
      6 	.text
      7 	.global	start
      8 start:
      9 	movq	%rsp,%rbp
     10 
     11 	/* load argc, argv, envp from stack */
     12 	movq	(%rbp),%rdi             /* argc */
     13 	leaq	8(%rbp),%rsi            /* argv */
     14 	leaq	16(%rbp,%rdi,8),%rdx    /* envp = argv + 8*argc + 8 */
     15 	movq	%rdx,__environ(%rip)
     16 
     17 	call	_main
     18 	movl	%eax,%edi
     19 	jmp	_exit