From 0bcac824e5f604582e553f5e5a5802a3e9211a2f Mon Sep 17 00:00:00 2001 From: jstmaxlol <87650746+jstmaxlol@users.noreply.github.com> Date: Thu, 28 Aug 2025 19:31:00 +0200 Subject: random scheisse --- asm_print.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 asm_print.c diff --git a/asm_print.c b/asm_print.c new file mode 100644 index 0000000..f232661 --- /dev/null +++ b/asm_print.c @@ -0,0 +1,32 @@ +#include +#include + +#ifndef __stupid +#define __stupid + +void dprint(const char* str); + +int main(void) { + const char* message = "Hello, World!"; + + dprint(message); + + return 0; +} + +void dprint(const char* str) { + size_t len = strlen(str); + + asm volatile ( + "movq $1, %%rax;" + "movq $1, %%rdi;" + "movq %0, %%rsi;" + "movq %1, %%rdx;" + "syscall;" + : + : "r" (str), "r" (len) + : "%rax", "%rdi", "%rsi", "%rdx" + ); +} + +#endif -- cgit v1.3.1