From 87539a8433aeef13424aeef4acd3094f1444fd84 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Fri, 23 May 2025 09:31:47 +0200 Subject: [PATCH] cleans up hello.c --- hello-world/hello.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/hello-world/hello.c b/hello-world/hello.c index 090d3bd..3de6e3b 100644 --- a/hello-world/hello.c +++ b/hello-world/hello.c @@ -3,35 +3,19 @@ #include #include -#include "encoding.h" #include "platform.h" #include int factorial(int i) { - volatile int result = 1; for (int ii = 1; ii <= i; ii++) { result = result * ii; } return result; } -extern volatile uintptr_t tohost; - -void write_tohost(char *string) { - volatile uint64_t payload[4] = {64, 0, (uintptr_t)string, - (strlen(string) + 1)}; - tohost = (uintptr_t)payload; -} int main() { - char string[] = "hello world with write in hello"; - - write_tohost(string); - - write(STDOUT_FILENO, string, sizeof(string)); - int result = factorial(10); printf("Factorial is %d", result); - return 0; }