#include #include #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 uint32_t tohost; extern volatile uint32_t fromhost; int main() { volatile int result = factorial(10); volatile char string[] = "hello world with write in hello"; volatile uint64_t payload[4] = {64, 0, (uintptr_t)string, (strlen(string) + 1)}; tohost = (uint32_t)payload; write(STDOUT_FILENO, string, sizeof(string)); printf("Factorial is %d", result); // printf("End of execution"); return 0; }