This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
hilbert-os/stdlib/syscall.asm
2024-01-13 16:43:49 -05:00

35 lines
420 B
NASM

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