From 347bf17586ae073e98f49d79810d0c7e1f47b6c7 Mon Sep 17 00:00:00 2001 From: Tom-on64 Date: Sun, 19 May 2024 17:04:39 +0200 Subject: [PATCH] Added a very bad stdio.h --- include/c/stdio.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 include/c/stdio.h diff --git a/include/c/stdio.h b/include/c/stdio.h new file mode 100644 index 0000000..aaf259d --- /dev/null +++ b/include/c/stdio.h @@ -0,0 +1,14 @@ +#ifndef STDIO_H +#define STDIO_H + +void print(const char* s) { // Use Syscall(1) - Puts() + __asm__ volatile ("int $0x80" : : "a"(1), "b"(s)); +} + +char* read() { // Use Syscall(2) - Gets() + char* s; + __asm__ volatile ("int $0x80" : "=b"(s) : "a"(2)); + return s; +} + +#endif