summaryrefslogtreecommitdiff
path: root/zp/source
diff options
context:
space:
mode:
Diffstat (limited to 'zp/source')
-rw-r--r--zp/source/amd64/bs/syscl.s27
-rw-r--r--zp/source/amd64/bs/trp.s10
-rw-r--r--zp/source/amd64/mem/memcpy.s66
-rw-r--r--zp/source/amd64/mem/memfil.s35
-rw-r--r--zp/source/any/bs/syscl.c11
-rw-r--r--zp/source/any/bs/trp.c14
-rw-r--r--zp/source/any/mem/memcpy.cc16
-rw-r--r--zp/source/any/mem/memequ.cc11
-rw-r--r--zp/source/any/mem/memfil.cc11
-rw-r--r--zp/source/any/mem/memsrh.cc11
-rw-r--r--zp/source/any/mth/abs.cc13
-rw-r--r--zp/source/any/mth/divmod.cc15
-rw-r--r--zp/source/any/mth/dot.cc21
-rw-r--r--zp/source/any/mth/vadd.cc21
-rw-r--r--zp/source/any/mth/vsub.cc21
-rw-r--r--zp/source/any/str/fmt.cc20
-rw-r--r--zp/source/any/str/fmtlen.cc21
-rw-r--r--zp/source/any/str/strcpy.cc11
-rw-r--r--zp/source/any/str/strequ.cc11
-rw-r--r--zp/source/any/str/strlen.cc11
-rw-r--r--zp/source/any/str/strsrh.cc11
-rw-r--r--zp/source/any/str/utf16dec.cc11
-rw-r--r--zp/source/any/str/utf16declen.cc11
-rw-r--r--zp/source/any/str/utf16enc.cc11
-rw-r--r--zp/source/any/str/utf16enclen.cc11
-rw-r--r--zp/source/any/str/utf32cpy.cc11
-rw-r--r--zp/source/any/str/utf32equ.cc11
-rw-r--r--zp/source/any/str/utf32len.cc11
-rw-r--r--zp/source/any/str/utf32srh.cc11
-rw-r--r--zp/source/any/str/utf8dec.cc11
-rw-r--r--zp/source/any/str/utf8declen.cc11
-rw-r--r--zp/source/any/str/utf8enc.cc11
-rw-r--r--zp/source/any/str/utf8enclen.cc11
-rw-r--r--zp/source/any/str/win1252dec.cc11
-rw-r--r--zp/source/any/str/win1252enc.cc11
-rw-r--r--zp/source/any/str/wstrcpy.cc11
-rw-r--r--zp/source/any/str/wstrequ.cc11
-rw-r--r--zp/source/any/str/wstrlen.cc11
-rw-r--r--zp/source/any/str/wstrsrh.cc11
-rw-r--r--zp/source/arm/bs/syscl.s32
-rw-r--r--zp/source/arm64/bs/syscl.s26
-rw-r--r--zp/source/ia32/bs/syscl.s34
42 files changed, 678 insertions, 0 deletions
diff --git a/zp/source/amd64/bs/syscl.s b/zp/source/amd64/bs/syscl.s
new file mode 100644
index 0000000..1161625
--- /dev/null
+++ b/zp/source/amd64/bs/syscl.s
@@ -0,0 +1,27 @@
+# Copyright 2022-2023 Gabriel Jensen.
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.globl zp_syscl
+
+zp_syscl:
+ # System calls on AMD64 use the following registers:
+ # rax : System call identifier
+ # rdi : First parameter
+ # rsi : Second parameter
+ # rdx : Third parameter
+ # r10 : Fourth parameter
+ # r8 : Fifth parameter
+ # r9 : Sixth parameter
+ # eax : Return value
+ # No registers to save.
+ movq %rdi,%rax # Move the first parameter (the identifier) to rax.
+ movq %rsi,%rdi # Move parameters into their designated registers.
+ movq %rdx,%rsi
+ movq %rcx,%rdx
+ movq %r8,%r10 # System calls use r10 instead of rcx.
+ movq %r9,%r8
+ movq 0x8(%rsp),%r9 # Extract the sixth argument from the stack.
+ syscall # Slime incident
+ # No need to move the return value.
+ ret
diff --git a/zp/source/amd64/bs/trp.s b/zp/source/amd64/bs/trp.s
new file mode 100644
index 0000000..614aba0
--- /dev/null
+++ b/zp/source/amd64/bs/trp.s
@@ -0,0 +1,10 @@
+# Copyright 2022-2023 Gabriel Jensen.
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.intel_syntax noprefix
+
+.globl zp_trp
+
+zp_trp:
+ ud2
diff --git a/zp/source/amd64/mem/memcpy.s b/zp/source/amd64/mem/memcpy.s
new file mode 100644
index 0000000..edc1c4e
--- /dev/null
+++ b/zp/source/amd64/mem/memcpy.s
@@ -0,0 +1,66 @@
+# Copyright 2022-2023 Gabriel Jensen.
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.intel_syntax noprefix
+
+.globl zp_memcpy
+
+zp_memcpy:
+ # zp_i8 val1;
+ # zp_i04 vali8;
+ # int unsigned128_t vali01;
+ # int unsigned256_t vali02;
+
+.big02cpy: # big02cpy:; // We assume AVX.
+ cmp rdx,0x20
+ jl short .big01cpy # if (rem < 0x20u) goto big01cpy;
+
+ vmovdqu ymm0,[rsi] # vali02 = *(int unsigned256_t *)src;
+ vmovdqu [rdi],ymm0 # *(int unsigned256_t *)dst = vali02;
+
+ add rdi,0x20 # dst += 0x20u;
+ add rsi,0x20 # src += 0x20u;
+ sub rdx,0x20 # rem -= 0x20u;
+ jmp short .big02cpy # goto big02cpy;
+
+.big01cpy: # big01cpy:;
+ cmp rdx,0x10
+ jl short .wrdcpy # if (rem < 0x10u) goto wrdcpy;
+
+ movdqu xmm0,[rsi] # vali01 = *(int unsigned128_t *)src;
+ movdqu [rdi],xmm0 # *(int unsigned128_t *)dst = vali01;
+
+ add rdi,0x10 # dst += 0x10u;
+ add rsi,0x10 # src += 0x10u;
+ sub rdx,0x10 # rem -= 0x10u;
+ jmp short .big01cpy # goto big01cpy;
+
+.wrdcpy: # wrdcpy:;
+ cmp rdx,0x8
+ jl short .bytcpy # if (rem < 0x8u) goto bytcpy;
+
+ mov rcx,[rsi] # vali8 = *(zp_i04 *)src;
+ mov [rdi],rcx # *(zp_i04 *)dst = vali8;
+
+ add rsi,0x8 # dst += 0x8u;
+ add rdi,0x8 # src += 0x8u;
+ sub rdx,0x8 # rem -= 0x8u;
+ jmp short .wrdcpy # goto wrdcpy
+
+.bytcpy: # bytcpy:;
+ test rdx,rdx # if (rem == 0x0)
+ jz short .done # goto done
+
+ mov cl,[rsi] # val1 = *(zp_i8 *)src;
+ mov [rdi],cl # *(zp_i8 *)dst = val1;
+
+ inc rdi # ++dst;
+ inc rsi # ++src;
+ dec rdx # --rem;
+ jmp short .bytcpy # goto bytcpy;
+
+.done:
+ mov rax,rdi
+ mov rdx,rsi
+ ret # return (zp_cpyret) {.dst = dst,.src = src};
diff --git a/zp/source/amd64/mem/memfil.s b/zp/source/amd64/mem/memfil.s
new file mode 100644
index 0000000..1ef09c2
--- /dev/null
+++ b/zp/source/amd64/mem/memfil.s
@@ -0,0 +1,35 @@
+# Copyright 2022-2023 Gabriel Jensen.
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.intel_syntax noprefix
+
+.globl zp_memfil
+
+zp_memfil:
+ movzx rsi,sil # zp_i04 extval = val;
+ mov rax,0x0101010101010101 # zp_i04 val = 0x0101010101010101u;
+ imul rax,rsi # val *= extval;
+
+.wrdfil: # wrdfil:;
+ cmp rdx,0x8
+ jl short .bytfil # if (num < 0x8u) goto bytfil;
+
+ mov [rdi],rax # *(zp_i04 *)dst = vali8;
+
+ add rdi,0x8 # dst += 0x8u;
+ sub rdx,0x8 # num -= 0x8u;
+ jmp short .wrdfil # goto wrdfil
+
+.bytfil: # bytfil:;
+ test rdx,rdx # if (rem == 0x0)
+ jz short .done # goto done
+
+ mov [rdi],al # *(zp_i8 *)dst = val1;
+
+ inc rdi # ++dst;
+ dec rdx # --rem;
+ jmp short .bytfil # goto bytfil;
+
+.done:
+ ret # return
diff --git a/zp/source/any/bs/syscl.c b/zp/source/any/bs/syscl.c
new file mode 100644
index 0000000..e2b8081
--- /dev/null
+++ b/zp/source/any/bs/syscl.c
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/bs.h>
+
+zp_sysclret zp_syscl(zp_nuse zp_sysclid id,...) {
+ zp_urch(); // Unsupported.
+}
diff --git a/zp/source/any/bs/trp.c b/zp/source/any/bs/trp.c
new file mode 100644
index 0000000..4082ffc
--- /dev/null
+++ b/zp/source/any/bs/trp.c
@@ -0,0 +1,14 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/bs.h>
+
+void zp_trp() {
+#if zp_priv_hasbuiltin(__builtin_trap)
+ __builtin_trap();
+#endif
+ for (;;) {}
+}
diff --git a/zp/source/any/mem/memcpy.cc b/zp/source/any/mem/memcpy.cc
new file mode 100644
index 0000000..eb7161b
--- /dev/null
+++ b/zp/source/any/mem/memcpy.cc
@@ -0,0 +1,16 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mem>
+
+extern "C" zp_nthrw auto zp_memcpy(void * const zp_restr dst,void const * const zp_restr src,zp_sz const num) -> struct zp_cpyret {
+ auto const ret = ::zp::cpy(static_cast<char unsigned *>(dst),static_cast<char unsigned const *>(src),num);
+
+ return ::zp_cpyret {
+ ret.dst,
+ ret.src,
+ };
+}
diff --git a/zp/source/any/mem/memequ.cc b/zp/source/any/mem/memequ.cc
new file mode 100644
index 0000000..d035510
--- /dev/null
+++ b/zp/source/any/mem/memequ.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mem>
+
+extern "C" zp_nthrw auto zp_memequ(void const * const lbuf,void const * const rbuf,::zp::sz const num) -> bool {
+ return ::zp::equ(static_cast<char unsigned const *>(lbuf),static_cast<char unsigned const *>(rbuf),num);
+}
diff --git a/zp/source/any/mem/memfil.cc b/zp/source/any/mem/memfil.cc
new file mode 100644
index 0000000..93111cd
--- /dev/null
+++ b/zp/source/any/mem/memfil.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mem>
+
+extern "C" zp_nthrw auto zp_memfil(void * const dst,char unsigned const val,::zp::sz const num) -> void {
+ return ::zp::fil(static_cast<char unsigned *>(dst),val,num);
+}
diff --git a/zp/source/any/mem/memsrh.cc b/zp/source/any/mem/memsrh.cc
new file mode 100644
index 0000000..768ed92
--- /dev/null
+++ b/zp/source/any/mem/memsrh.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mem>
+
+extern "C" zp_nthrw auto zp_memsrh(void const * const buf,char unsigned const val,::zp::sz const num) -> void * {
+ return const_cast<char unsigned *>(::zp::srh(static_cast<char unsigned const *>(buf),val,num));
+}
diff --git a/zp/source/any/mth/abs.cc b/zp/source/any/mth/abs.cc
new file mode 100644
index 0000000..aecae23
--- /dev/null
+++ b/zp/source/any/mth/abs.cc
@@ -0,0 +1,13 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+
+extern "C" {
+ zp_nthrw float zp_absf( float const val) {return ::zp::abs(val);}
+ zp_nthrw double zp_absd( double const val) {return ::zp::abs(val);}
+ zp_nthrw long double zp_absld(long double const val) {return ::zp::abs(val);}
+}
diff --git a/zp/source/any/mth/divmod.cc b/zp/source/any/mth/divmod.cc
new file mode 100644
index 0000000..9e158a2
--- /dev/null
+++ b/zp/source/any/mth/divmod.cc
@@ -0,0 +1,15 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+
+extern "C" {
+ zp_nthrw auto zp_divmodsc(char signed const num,char signed const den) -> ::zp_pairsc {return ::zp::divmod(num,den).cpair();}
+ zp_nthrw auto zp_divmods( short const num,short const den) -> ::zp_pairs {return ::zp::divmod(num,den).cpair();}
+ zp_nthrw auto zp_divmodi( int const num,int const den) -> ::zp_pairi {return ::zp::divmod(num,den).cpair();}
+ zp_nthrw auto zp_divmodl( long const num,long const den) -> ::zp_pairl {return ::zp::divmod(num,den).cpair();}
+ zp_nthrw auto zp_divmodll(long long const num,long long const den) -> ::zp_pairll {return ::zp::divmod(num,den).cpair();}
+}
diff --git a/zp/source/any/mth/dot.cc b/zp/source/any/mth/dot.cc
new file mode 100644
index 0000000..cc5bd56
--- /dev/null
+++ b/zp/source/any/mth/dot.cc
@@ -0,0 +1,21 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+
+extern "C" {
+ auto zp_dot2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> float {return ::zp::dot(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,});}
+ auto zp_dot2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> double {return ::zp::dot(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,});}
+ auto zp_dot2ld(::zp_vec2ld const lvec,::zp_vec2ld const rvec) -> long double {return ::zp::dot(::zp::vec2<long double> {lvec.x,lvec.y,},::zp::vec2<long double> {rvec.x,rvec.y,});}
+
+ auto zp_dot3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> float {return ::zp::dot(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,});}
+ auto zp_dot3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> double {return ::zp::dot(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,});}
+ auto zp_dot3ld(::zp_vec3ld const lvec,::zp_vec3ld const rvec) -> long double {return ::zp::dot(::zp::vec3<long double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<long double> {rvec.x,rvec.y,rvec.z,});}
+
+ auto zp_dot4f( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> float {return ::zp::dot(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,});}
+ auto zp_dot4d( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> double {return ::zp::dot(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,});}
+ auto zp_dot4ld(::zp_vec4ld const lvec,::zp_vec4ld const rvec) -> long double {return ::zp::dot(::zp::vec4<long double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<long double> {rvec.x,rvec.y,rvec.z,rvec.w,});}
+}
diff --git a/zp/source/any/mth/vadd.cc b/zp/source/any/mth/vadd.cc
new file mode 100644
index 0000000..3513ea5
--- /dev/null
+++ b/zp/source/any/mth/vadd.cc
@@ -0,0 +1,21 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+
+extern "C" {
+ auto zp_v2addf( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vadd(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();}
+ auto zp_v2addd( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vadd(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();}
+ auto zp_v2addld(::zp_vec2ld const lvec,::zp_vec2ld const rvec) -> ::zp_vec2ld {return ::zp::vadd(::zp::vec2<long double> {lvec.x,lvec.y,},::zp::vec2<long double> {rvec.x,rvec.y,}).cvec();}
+
+ auto zp_v3addf( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vadd(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();}
+ auto zp_v3addd( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vadd(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();}
+ auto zp_v3addld(::zp_vec3ld const lvec,::zp_vec3ld const rvec) -> ::zp_vec3ld {return ::zp::vadd(::zp::vec3<long double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<long double> {rvec.x,rvec.y,rvec.z,}).cvec();}
+
+ auto zp_v4addf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vadd(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+ auto zp_v4addd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vadd(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+ auto zp_v4addld(::zp_vec4ld const lvec,::zp_vec4ld const rvec) -> ::zp_vec4ld {return ::zp::vadd(::zp::vec4<long double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<long double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+}
diff --git a/zp/source/any/mth/vsub.cc b/zp/source/any/mth/vsub.cc
new file mode 100644
index 0000000..58977a4
--- /dev/null
+++ b/zp/source/any/mth/vsub.cc
@@ -0,0 +1,21 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+
+extern "C" {
+ auto zp_v2subf( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vsub(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();}
+ auto zp_v2subd( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vsub(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();}
+ auto zp_v2subld(::zp_vec2ld const lvec,::zp_vec2ld const rvec) -> ::zp_vec2ld {return ::zp::vsub(::zp::vec2<long double> {lvec.x,lvec.y,},::zp::vec2<long double> {rvec.x,rvec.y,}).cvec();}
+
+ auto zp_v3subf( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vsub(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();}
+ auto zp_v3subd( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vsub(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();}
+ auto zp_v3subld(::zp_vec3ld const lvec,::zp_vec3ld const rvec) -> ::zp_vec3ld {return ::zp::vsub(::zp::vec3<long double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<long double> {rvec.x,rvec.y,rvec.z,}).cvec();}
+
+ auto zp_v4subf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vsub(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+ auto zp_v4subd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vsub(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+ auto zp_v4subld(::zp_vec4ld const lvec,::zp_vec4ld const rvec) -> ::zp_vec4ld {return ::zp::vsub(::zp::vec4<long double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<long double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+}
diff --git a/zp/source/any/str/fmt.cc b/zp/source/any/str/fmt.cc
new file mode 100644
index 0000000..49a57e3
--- /dev/null
+++ b/zp/source/any/str/fmt.cc
@@ -0,0 +1,20 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" {
+ zp_nthrw auto zp_fmti( char32_t * const buf,int const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtl( char32_t * const buf,long const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtll( char32_t * const buf,long long const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmts( char32_t * const buf,short const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtsc( char32_t * const buf,char signed const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtuc( char32_t * const buf,char unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtui( char32_t * const buf,int unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtul( char32_t * const buf,long unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtull(char32_t * const buf,long long unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+ zp_nthrw auto zp_fmtus( char32_t * const buf,short unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);}
+}
diff --git a/zp/source/any/str/fmtlen.cc b/zp/source/any/str/fmtlen.cc
new file mode 100644
index 0000000..7c19a3f
--- /dev/null
+++ b/zp/source/any/str/fmtlen.cc
@@ -0,0 +1,21 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+#include <zp/str>
+
+extern "C" {
+ zp_nthrw auto zp_fmtleni( int const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenl( long const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenll( long long const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlens( short const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlensc( char signed const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenuc( char unsigned const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenui( int unsigned const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenul( long unsigned const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenull(long long unsigned const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+ zp_nthrw auto zp_fmtlenus( short unsigned const val,::zp::i8m const bs) -> ::zp::sz {return ::zp::fmtlen(val,bs);}
+}
diff --git a/zp/source/any/str/strcpy.cc b/zp/source/any/str/strcpy.cc
new file mode 100644
index 0000000..01b411c
--- /dev/null
+++ b/zp/source/any/str/strcpy.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_strcpy(char * const dst,char const * const src) -> ::zp::sz {
+ return ::zp::strcpy(dst,src);
+}
diff --git a/zp/source/any/str/strequ.cc b/zp/source/any/str/strequ.cc
new file mode 100644
index 0000000..ac15b82
--- /dev/null
+++ b/zp/source/any/str/strequ.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_strequ(char const * const lstr,char const * const rstr) -> bool {
+ return ::zp::strequ(lstr,rstr);
+}
diff --git a/zp/source/any/str/strlen.cc b/zp/source/any/str/strlen.cc
new file mode 100644
index 0000000..a730541
--- /dev/null
+++ b/zp/source/any/str/strlen.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_strlen(char const * const str) -> ::zp::sz {
+ return ::zp::strlen(str);
+}
diff --git a/zp/source/any/str/strsrh.cc b/zp/source/any/str/strsrh.cc
new file mode 100644
index 0000000..08cd8df
--- /dev/null
+++ b/zp/source/any/str/strsrh.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_strsrh(char const * const str,char const chr) -> char * {
+ return const_cast<char *>(::zp::strsrh(str,chr));
+}
diff --git a/zp/source/any/str/utf16dec.cc b/zp/source/any/str/utf16dec.cc
new file mode 100644
index 0000000..d996b24
--- /dev/null
+++ b/zp/source/any/str/utf16dec.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf16dec(::zp::c02 * const dst,::zp::c01 const * const src) -> void {
+ return ::zp::utf16dec(dst,src);
+}
diff --git a/zp/source/any/str/utf16declen.cc b/zp/source/any/str/utf16declen.cc
new file mode 100644
index 0000000..45f5260
--- /dev/null
+++ b/zp/source/any/str/utf16declen.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf16declen(::zp::c01 const * const str) -> ::zp::sz {
+ return ::zp::utf16declen(str);
+}
diff --git a/zp/source/any/str/utf16enc.cc b/zp/source/any/str/utf16enc.cc
new file mode 100644
index 0000000..0fabbf3
--- /dev/null
+++ b/zp/source/any/str/utf16enc.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf16enc(::zp::c01 * const dst,::zp::c02 const * const src) -> void {
+ return ::zp::utf16enc(dst,src);
+}
diff --git a/zp/source/any/str/utf16enclen.cc b/zp/source/any/str/utf16enclen.cc
new file mode 100644
index 0000000..cf42074
--- /dev/null
+++ b/zp/source/any/str/utf16enclen.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf16enclen(::zp::c02 const * const str) -> ::zp::sz {
+ return ::zp::utf16enclen(str);
+}
diff --git a/zp/source/any/str/utf32cpy.cc b/zp/source/any/str/utf32cpy.cc
new file mode 100644
index 0000000..bfa219b
--- /dev/null
+++ b/zp/source/any/str/utf32cpy.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf32cpy(::zp::c02 * const dst,::zp::c02 const * const src) -> ::zp::sz {
+ return ::zp::strcpy(dst,src);
+}
diff --git a/zp/source/any/str/utf32equ.cc b/zp/source/any/str/utf32equ.cc
new file mode 100644
index 0000000..3789217
--- /dev/null
+++ b/zp/source/any/str/utf32equ.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf32equ(::zp::c02 const * const lstr,::zp::c02 const * const rstr) -> bool {
+ return ::zp::strequ(lstr,rstr);
+}
diff --git a/zp/source/any/str/utf32len.cc b/zp/source/any/str/utf32len.cc
new file mode 100644
index 0000000..96f9d4b
--- /dev/null
+++ b/zp/source/any/str/utf32len.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf32len(::zp::c02 const * const str) -> ::zp::sz {
+ return ::zp::strlen(str);
+}
diff --git a/zp/source/any/str/utf32srh.cc b/zp/source/any/str/utf32srh.cc
new file mode 100644
index 0000000..78d52c0
--- /dev/null
+++ b/zp/source/any/str/utf32srh.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf32srh(::zp::c02 const * const str,::zp::c02 const chr) -> ::zp::c02 * {
+ return const_cast<::zp::c02 *>(::zp::strsrh(str,chr));
+}
diff --git a/zp/source/any/str/utf8dec.cc b/zp/source/any/str/utf8dec.cc
new file mode 100644
index 0000000..ab1d5de
--- /dev/null
+++ b/zp/source/any/str/utf8dec.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf8dec(::zp::c02 * const dst,::zp::c8 const * const src) -> void {
+ return ::zp::utf8dec(dst,src);
+}
diff --git a/zp/source/any/str/utf8declen.cc b/zp/source/any/str/utf8declen.cc
new file mode 100644
index 0000000..de9fa51
--- /dev/null
+++ b/zp/source/any/str/utf8declen.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf8declen(::zp::c8 const * const str) -> ::zp::sz {
+ return ::zp::utf8declen(str);
+}
diff --git a/zp/source/any/str/utf8enc.cc b/zp/source/any/str/utf8enc.cc
new file mode 100644
index 0000000..58b5ad3
--- /dev/null
+++ b/zp/source/any/str/utf8enc.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf8enc(::zp::c8 * const dst,::zp::c02 const * const src) -> void {
+ return ::zp::utf8enc(dst,src);
+}
diff --git a/zp/source/any/str/utf8enclen.cc b/zp/source/any/str/utf8enclen.cc
new file mode 100644
index 0000000..f6c4543
--- /dev/null
+++ b/zp/source/any/str/utf8enclen.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_utf8enclen(::zp::c02 const * const str) -> ::zp::sz {
+ return ::zp::utf8enclen(str);
+}
diff --git a/zp/source/any/str/win1252dec.cc b/zp/source/any/str/win1252dec.cc
new file mode 100644
index 0000000..e3ed028
--- /dev/null
+++ b/zp/source/any/str/win1252dec.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_win1252dec(::zp::c02 * const dst,::zp::c8 const * const src) -> void {
+ return ::zp::win1252dec(dst,src);
+}
diff --git a/zp/source/any/str/win1252enc.cc b/zp/source/any/str/win1252enc.cc
new file mode 100644
index 0000000..89733ca
--- /dev/null
+++ b/zp/source/any/str/win1252enc.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_win1252enc(::zp::c8 * const dst,::zp::c02 const * const src) -> void {
+ return ::zp::win1252enc(dst,src);
+}
diff --git a/zp/source/any/str/wstrcpy.cc b/zp/source/any/str/wstrcpy.cc
new file mode 100644
index 0000000..8eb4618
--- /dev/null
+++ b/zp/source/any/str/wstrcpy.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_wstrcpy(::zp::wchr * const dst,::zp::wchr const * const src) -> ::zp::sz {
+ return ::zp::strcpy(dst,src);
+}
diff --git a/zp/source/any/str/wstrequ.cc b/zp/source/any/str/wstrequ.cc
new file mode 100644
index 0000000..a56f565
--- /dev/null
+++ b/zp/source/any/str/wstrequ.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_wstrequ(::zp::wchr const * const lstr,::zp::wchr const * const rstr) -> bool {
+ return ::zp::strequ(lstr,rstr);
+}
diff --git a/zp/source/any/str/wstrlen.cc b/zp/source/any/str/wstrlen.cc
new file mode 100644
index 0000000..2f84246
--- /dev/null
+++ b/zp/source/any/str/wstrlen.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_wstrlen(::zp::wchr const * const str) -> ::zp::sz {
+ return ::zp::strlen(str);
+}
diff --git a/zp/source/any/str/wstrsrh.cc b/zp/source/any/str/wstrsrh.cc
new file mode 100644
index 0000000..068b27a
--- /dev/null
+++ b/zp/source/any/str/wstrsrh.cc
@@ -0,0 +1,11 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/str>
+
+extern "C" zp_nthrw auto zp_wstrsrh(::zp::wchr const * const str,::zp::wchr const chr) -> ::zp::wchr * {
+ return const_cast<::zp::wchr *>(::zp::strsrh(str,chr));
+}
diff --git a/zp/source/arm/bs/syscl.s b/zp/source/arm/bs/syscl.s
new file mode 100644
index 0000000..c7cca36
--- /dev/null
+++ b/zp/source/arm/bs/syscl.s
@@ -0,0 +1,32 @@
+@ Copyright 2022-2023 Gabriel Jensen.
+@ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.syntax unified
+
+.arm
+
+.globl zp_syscl
+
+zp_syscl:
+ @ System calls on ARM EABI use the following registers:
+ @ r0 : System call identifier
+ @ r1 : First parameter
+ @ r2 : Second parameter
+ @ r3 : Third parameter
+ @ r4 : Fourth parameter
+ @ r5 : Fifth parameter
+ @ r6 : Sixth parameter
+ @ r0 : Return value
+ push {r4-r5,r7,lr} @ Remember that the parameters are now further up the stack.
+ mov r7,r0 @ Move the identifier.
+ mov r0,r1 @ Place parameters.
+ mov r1,r2
+ mov r2,r3
+ ldr r3,[sp,0x10] @ Get the remaining parameters from the stack.
+ ldr r4,[sp,0x14]
+ ldr r5,[sp,0x18]
+ svc 0x0 @ Divinity
+ pop {r4-r5,r7} @ Restore the registers.
+ pop {r0}
+ bx r0
diff --git a/zp/source/arm64/bs/syscl.s b/zp/source/arm64/bs/syscl.s
new file mode 100644
index 0000000..7009fd7
--- /dev/null
+++ b/zp/source/arm64/bs/syscl.s
@@ -0,0 +1,26 @@
+// Copyright 2022-2023 Gabriel Jensen.
+// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+// If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.globl zp_syscl
+
+zp_syscl:
+ // System calls on ARM64 use the following registers:
+ // x0 : System call identifier
+ // x1 : First parameter
+ // x2 : Second parameter
+ // x3 : Third parameter
+ // x4 : Fourth parameter
+ // x5 : Fifth parameter
+ // x6 : Sixth parameter
+ // x0 : Return value
+ mov x8,x0 // Move the first parameter (the identifier) to x8.
+ mov x0,x1 // Shift all of the other parameters to the left.
+ mov x1,x2
+ mov x2,x3
+ mov x3,x4
+ mov x4,x5
+ mov x5,x6
+ svc 0x0 // Zephyr
+ // No need to move the return value (already in x0).
+ ret
diff --git a/zp/source/ia32/bs/syscl.s b/zp/source/ia32/bs/syscl.s
new file mode 100644
index 0000000..9dd3195
--- /dev/null
+++ b/zp/source/ia32/bs/syscl.s
@@ -0,0 +1,34 @@
+# Copyright 2022-2023 Gabriel Jensen.
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+
+.globl zp_syscl
+
+zp_syscl:
+ # System calls on IA-32 use the following registers:
+ # eax : System call identifier
+ # ebx : First parameter
+ # ecx : Second parameter
+ # edx : Third parameter
+ # esi : Fourth parameter
+ # edi : Fifth parameter
+ # ebp : Sixth parameter
+ # eax : Return value
+ pushl %ebx # Remember to save the registers.
+ pushl %esi
+ pushl %edi
+ pushl %ebp # Remember that the provided paramters are now further up the stack.
+ movl 0x14(%esp),%eax # Move the first parameter (the identifier) to eax.
+ movl 0x18(%esp),%ebx # Move the remaining parameters into their designated registers. This will read "out of bounds" memory if the number of passed parameters is less than six, but this shouldn't matter as long as the data isn't being used, which it won't be as long as the expected ammount of parameters have been passed.
+ movl 0x1C(%esp),%ecx
+ movl 0x20(%esp),%edx
+ movl 0x24(%esp),%esi
+ movl 0x28(%esp),%edi
+ movl 0x2C(%esp),%ebp
+ int $0x80 # Flying city
+ popl %ebp # Restore the registers.
+ popl %edi
+ popl %esi
+ popl %ebx
+ # No need to move the return value.
+ ret