shithub: elf-loader

ref: e5e12f806ecf322946c093fe59d909beb9160d0c
dir: /hello/l.s/

View raw version
	.global _start
_start:
	lea	0x08(%rsp), %rdi
	call	main
1:	jmp	1b

	.global syscall
syscall:
	sub	$0x40, %rsp
	mov	%rbp, 0x28(%rsp)
	mov	%rbx, 0x30(%rsp)

	mov	%rdi, %rbp
	mov	%rsi, 0x08(%rsp)
	mov	%rdx, 0x10(%rsp)
	mov	%rcx, 0x18(%rsp)
	mov	%r8, 0x20(%rsp)
	syscall

	mov	0x28(%rsp), %rbp
	mov	0x30(%rsp), %rbx
	add	$0x40, %rsp
	ret