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/euler/source/syscall.asm

32 lines
362 B
NASM

bits 64
section .text
global __euler_do_syscall
__euler_do_syscall:
push rdi
push rsi
push rdx
push rcx
mov rax, qword [rdi]
mov rdi, qword [rsi]
mov rsi, qword [rdx]
mov rdx, qword [rcx]
syscall
pop rcx
mov qword [rcx], rdx
pop rdx
mov qword [rdx], rsi
pop rsi
mov qword [rsi], rdi
pop rdi
mov qword [rdi], rax
ret