shithub: scc

ref: ba7282c77fe93ec17c42d1a3a11fbd4109d93616
dir: /src/libc/arch/amd64/darwin/crt.s/

View raw version
	.bss
	.globl	__environ
__environ:
	.quad	0

	.text
	.global	start
start:
	movq	%rsp,%rbp

	/* load argc, argv, envp from stack */
	movq	(%rbp),%rdi             /* argc */
	leaq	8(%rbp),%rsi            /* argv */
	leaq	16(%rbp,%rdi,8),%rdx    /* envp = argv + 8*argc + 8 */
	movq	%rdx,__environ(%rip)

	call	_main
	movl	%eax,%edi
	jmp	_exit