summaryrefslogtreecommitdiffhomepage
path: root/dev/libSystem/src/SystemProc.asm
diff options
context:
space:
mode:
Diffstat (limited to 'dev/libSystem/src/SystemProc.asm')
-rw-r--r--dev/libSystem/src/SystemProc.asm66
1 files changed, 66 insertions, 0 deletions
diff --git a/dev/libSystem/src/SystemProc.asm b/dev/libSystem/src/SystemProc.asm
new file mode 100644
index 00000000..bc41059a
--- /dev/null
+++ b/dev/libSystem/src/SystemProc.asm
@@ -0,0 +1,66 @@
+;; /*
+;; * ========================================================
+;; *
+;; * libSystem/src/SystemCalls+IO.asm
+;; * Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
+;; *
+;; * ========================================================
+;; */
+
+[bits 64]
+
+section .text
+
+global libsys_syscall_arg_1
+global libsys_syscall_arg_2
+global libsys_syscall_arg_3
+global libsys_syscall_arg_4
+
+libsys_syscall_arg_1:
+ push rbp
+ mov rbp, rsp
+
+ mov r8, rcx
+ syscall
+
+ pop rbp
+
+ ret
+
+libsys_syscall_arg_2:
+ push rbp
+ mov rbp, rsp
+
+ mov r8, rcx
+ mov r9, rdx
+ syscall
+ pop rbp
+
+ ret
+
+libsys_syscall_arg_3:
+ push rbp
+ mov rbp, rsp
+
+ mov r8, rcx
+ mov r9, rdx
+ mov r10, rbx
+
+ syscall
+ pop rbp
+
+ ret
+
+libsys_syscall_arg_4:
+ push rbp
+ mov rbp, rsp
+
+ mov r8, rcx
+ mov r9, rdx
+ mov r10, rbx
+ mov r11, rax
+
+ syscall
+ pop rbp
+
+ ret