aboutsummaryrefslogtreecommitdiff
path: root/docs/history/17-o3-boundaries/code/tools/build.zc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/history/17-o3-boundaries/code/tools/build.zc')
-rw-r--r--docs/history/17-o3-boundaries/code/tools/build.zc13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/history/17-o3-boundaries/code/tools/build.zc b/docs/history/17-o3-boundaries/code/tools/build.zc
new file mode 100644
index 0000000..a38e97f
--- /dev/null
+++ b/docs/history/17-o3-boundaries/code/tools/build.zc
@@ -0,0 +1,13 @@
+// compiles the rest of stdin (after the backtick) as a genome image at GORG
+// and writes it to stdout as little-endian 32-bit words.
+const OUT = 0x10000;
+fn main()
+{
+ let n = build_image(GORG, OUT), i = 0, w;
+ while (i < n) {
+ w = OUT[i];
+ putc(w); putc(w >> 8); putc(w >> 16); putc(w >> 24);
+ i++;
+ }
+ return 0;
+}