shithub: scc

ref: 272bc8e3488ce5c7220ebf7cc731a04211b6dba4
dir: /src/libcrt/crt-amd64-posix.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

	call	main
	movl	%eax,%edi
	jmp	exit