summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjstmaxlol <87650746+jstmaxlol@users.noreply.github.com>2025-08-28 19:31:00 +0200
committerjstmaxlol <87650746+jstmaxlol@users.noreply.github.com>2025-08-28 19:31:00 +0200
commit0bcac824e5f604582e553f5e5a5802a3e9211a2f (patch)
tree32101a4e83f3ffbba453dd483695add65894e38f
parentf388cd066f25b4b5bfb81463e40ea795f58c6d21 (diff)
random scheisse
-rw-r--r--asm_print.c32
1 files changed, 32 insertions, 0 deletions
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 <string.h>
+#include <stddef.h>
+
+#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