From 870ecce8e4921aba014841c42061d94582c6ec1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Grodzi=C5=84ski?= Date: Tue, 8 Jul 2025 22:49:04 +0900 Subject: [PATCH] Almost hello world --- .vscode/launch.json | 2 +- samples/hello.brc | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 samples/hello.brc diff --git a/.vscode/launch.json b/.vscode/launch.json index 4b91f3e..5574805 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "lldb-dap", "request": "launch", "program": "${command:cmake.launchTargetPath}", - "args": ["-v", "${workspaceFolder}/samples/test.brc"], + "args": ["-v", "${workspaceFolder}/samples/hello.brc"], "cwd": "${workspaceFolder}", "internalConsoleOptions": "openOnSessionStart", } diff --git a/samples/hello.brc b/samples/hello.brc new file mode 100644 index 0000000..0ed1ff9 --- /dev/null +++ b/samples/hello.brc @@ -0,0 +1,12 @@ +@extern putchar fun: character sint32 -> sint32 + +main fun -> sint32 + text data <- "Hello string!\n" + + rep i sint32 <- 0, i < 14: + putchar(text[i]) + i <- i + 1 + ; + + ret 0 +; \ No newline at end of file