-;; Print a string of a given length.
-;;
-;; Input:
-;; - RCX = Pointer to buffer
-;; - RDX = Buffer length
-;;
-;; Clobbers: RAX, RCX, R11, RDI, RSI
-macro sys_print_string {
- push r8
- push r9
- push r10
-
- call os_print_string
-
- pop r10
- pop r9
- pop r8
-}
-
-;; Read a character from the user into the given buffer.
-;;
-;; Input:
-;; - RSI = Character buffer
-;;
-;; Output:
-;; - BYTE [RSI] = Character
-;;
-;; Clobbers: RAX, RCX, R11, RDI, RSI, RDX
-macro sys_read_char {
- push rbx
- push r8
- push r9
- push r10
- push r15
-
- mov rcx, rsi
- call os_read_char
-
- pop r15
- pop r10
- pop r9
- pop r8
- pop rbx
-}
-
-macro sys_terminate code {
- mov rax, code
- call os_terminate
-}
-