summaryrefslogtreecommitdiff
path: root/src/nonstd/x86-64.s
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-08 18:45:05 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-08 18:45:05 -0500
commit84217308cf704fda8a9db817b458ccadf444efe9 (patch)
tree1d65e1610c22d6a68c90d67f4c7f3b147bfa151f /src/nonstd/x86-64.s
parent7ef8a7379f7f7d09e71ccae2a0b688c3cd80423f (diff)
add headers and assembly
Diffstat (limited to 'src/nonstd/x86-64.s')
-rw-r--r--src/nonstd/x86-64.s19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nonstd/x86-64.s b/src/nonstd/x86-64.s
new file mode 100644
index 00000000..60aba7a1
--- /dev/null
+++ b/src/nonstd/x86-64.s
@@ -0,0 +1,19 @@
+.global __syscall
+__syscall:
+ mov %rdi, %rax
+ mov %rsi, %rdi
+ mov %rdx, %rsi
+ mov %rcx, %rdx
+ mov %r8, %r10
+ mov %r9, %r8
+ mov 8(%rsp), %r9
+ syscall
+ ret
+
+/* FIXME: this seems to be unpossible to put in a shared library */
+/* FIXME: it may be worthwhile to separate this into crt1.s */
+.global _start
+_start:
+ popq %rdi
+ movq %rsp, %rsi
+ call __libc_start