Adds eprintf (printf but print to stderr)

This commit is contained in:
2025-07-26 00:57:30 +02:00
parent 8a18695328
commit 69d7a52c62
2 changed files with 23 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ section .text
global print
global puts
global printf
global eprintf
;----- print(*str[]) -----;
; Prints given string to the console to stdout
@@ -101,6 +102,12 @@ printf:
mov rax, FD_stdout
jmp __INTERNAL_fmt
;----- eprintf(*format[], ...) -----;
; Same as printf, except prints to stderr
eprintf:
mov rax, FD_stderr
jmp __INTERNAL_fmt
;----- __INTERNAL_fmt(*format[], ...) -----;
; See printf description above, +
; 1) Return value can be amount of printed characters or -errno (eg if bad FD was passed, -EBADF is returned)