diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-13 16:43:49 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-13 16:43:49 -0500 |
commit | 4130562b1555cabe441efe9420cebe12e7ed8d39 (patch) | |
tree | beaf0012373aab2c3a13fe0147a5cda4af28ef78 /stdlib/syscall.asm | |
parent | 882e74b2191c059a9226cbd8bcb51c97da36247c (diff) | |
download | hilbert-os-4130562b1555cabe441efe9420cebe12e7ed8d39.tar.gz |
application loading
Diffstat (limited to 'stdlib/syscall.asm')
-rw-r--r-- | stdlib/syscall.asm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/stdlib/syscall.asm b/stdlib/syscall.asm new file mode 100644 index 0000000..eba7ec0 --- /dev/null +++ b/stdlib/syscall.asm @@ -0,0 +1,35 @@ +bits 64 + +global encode_color +global get_framebuffer +global draw_framebuffer + +section .text + +encode_color: + mov rax, 0 + syscall + ret + +get_framebuffer: + push rcx + push rdx + push rsi + push rdi + mov rax, 1 + syscall + pop rcx + mov qword [rcx], rax + pop rcx + mov dword [rcx], edi + shr rdi, 32 + pop rcx + mov dword [rcx], edi + pop rcx + mov dword [rcx], esi + ret + +draw_framebuffer: + mov rax, 2 + syscall + ret |