summaryrefslogtreecommitdiffhomepage
path: root/dev/user/src/SystemCall+IO.asm
diff options
context:
space:
mode:
Diffstat (limited to 'dev/user/src/SystemCall+IO.asm')
-rw-r--r--dev/user/src/SystemCall+IO.asm50
1 files changed, 50 insertions, 0 deletions
diff --git a/dev/user/src/SystemCall+IO.asm b/dev/user/src/SystemCall+IO.asm
new file mode 100644
index 00000000..769ae513
--- /dev/null
+++ b/dev/user/src/SystemCall+IO.asm
@@ -0,0 +1,50 @@
+;; /*
+;; * ========================================================
+;; *
+;; * libsci
+;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+;; *
+;; * ========================================================
+;; */
+
+[bits 64]
+
+section .text
+
+global sci_syscall_arg_1
+global sci_syscall_arg_2
+global sci_syscall_arg_3
+global sci_syscall_arg_4
+
+sci_syscall_arg_1:
+ mov r8, rcx
+ syscall
+ ret
+
+sci_syscall_arg_2:
+ mov r8, rcx
+ mov r9, rdx
+ syscall
+ ret
+
+sci_syscall_arg_3:
+ mov rbx, r8
+
+ mov r8, rcx
+ mov r9, rdx
+ mov r10, rbx
+
+ syscall
+ ret
+
+sci_syscall_arg_4:
+ mov rbx, r8
+ mov rax, r9
+
+ mov r8, rcx
+ mov r9, rdx
+ mov r10, rbx
+ mov r11, rax
+
+ syscall
+ ret