shithub: mc

ref: f16bf0e4f8dd5f23b41cfbfa6c24fd0ab79e6dad
dir: /libstd/syscall+linux-x64.s/

View raw version
.globl sys$syscall
sys$syscall:
	/*
	hack: We load 6 args regardless of
	how many we actually have. This may
	load junk values, but if the syscall
	doesn't use them, it's going to be
	harmless.
	 */
	movq %rdi,%rax
        /* 8(%rsp): hidden type arg */
	movq 16(%rsp),%rdi
	movq 24(%rsp),%rsi
	movq 32(%rsp),%rdx
	movq 40(%rsp),%r10
	movq 48(%rsp),%r8
	movq 56(%rsp),%r9

	syscall

	ret