aboutsummaryrefslogtreecommitdiff
path: root/src/tools/build.zc
diff options
context:
space:
mode:
authorGravatar Moon Flower <moonflower@elhenney.local> 2026-10-12 08:46:23 +0330
committerGravatar Moon Flower <moonflower@elhenney.local> 2026-10-12 08:46:23 +0330
commitecc350ca5c2eb50be8309c5f14f8bf0d87db9a02 (patch)
tree70e0af76a1b13affff7c6cc8aac7b3e6ef960478 /src/tools/build.zc
a
Diffstat (limited to 'src/tools/build.zc')
-rw-r--r--src/tools/build.zc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/build.zc b/src/tools/build.zc
new file mode 100644
index 0000000..547b70f
--- /dev/null
+++ b/src/tools/build.zc
@@ -0,0 +1,14 @@
+// compiles the rest of stdin (after the backtick) as a genome image at GORG
+// and writes it to stdout as little-endian 64-bit words.
+docs on;
+// writes the compiled genome image to stdout as little-endian 64-bit words.
+int main() {
+ int n = build_image_grow(GORG, 4096), i = 0, w;
+ while (i < n) {
+ w = image_words[i];
+ put_c(w); put_c(w >> 8); put_c(w >> 16); put_c(w >> 24);
+ put_c(w >> 32); put_c(w >> 40); put_c(w >> 48); put_c(w >> 56);
+ i++;
+ }
+ return 0;
+}