summaryrefslogtreecommitdiff
path: root/stdlib/syscall.asm
blob: eba7ec0b361c1cf48e7fb4f84077ba07a82e5732 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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