Begin CPU assembly
authorAlyssa Rosenzweig <alyssa@backtick.town>
Thu, 23 Jun 2016 15:09:38 +0000 (08:09 -0700)
committerAlyssa Rosenzweig <alyssa@backtick.town>
Thu, 23 Jun 2016 15:09:38 +0000 (08:09 -0700)
src/CPU/build-cpu.js [new file with mode: 0644]

diff --git a/src/CPU/build-cpu.js b/src/CPU/build-cpu.js
new file mode 100644 (file)
index 0000000..82a3b42
--- /dev/null
@@ -0,0 +1,34 @@
+/* build-cpu.js
+ * this is the heart of the metaprogram
+ * at the entrypoint, the instruction set is complete and annotated,
+ * and the reference document is available.
+ * We can just sit back, relax, and put together parts :-)
+ */
+
+var fs = require("fs");
+
+// avoid excessive disk use
+var instruction_cache = {};
+
+// read the table in
+var table = JSON.parse(fs.readFileSync("bin/table.json").toString());
+
+// jump table emission, etc.
+var emission = [
+    "mapper read PC",
+    "set tmp to join \"0x\" (M)"
+];
+
+var sources = table.map(function(x) {
+    if(x) {
+        return "legit";
+    } else {
+        return "illegit";
+    });
+
+// dump out a 8 level deep BST
+console.log(bst(sources, 0, 256));
+
+function bst(sources, start, end) {
+    
+}
This page took 0.0228 seconds and 4 git commands to generate.