about summary refs log tree commit diff stats
path: root/cpp/090debug
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-18 22:08:19 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-18 22:08:19 -0700
commitb1299d632715669c90dde918f5522c776b853e66 (patch)
treeb853897c6e46f3c46f997374e8474832153d814e /cpp/090debug
parent442cdbf6f4bdfef8fe6938cb87bd5037954a0426 (diff)
downloadmu-b1299d632715669c90dde918f5522c776b853e66.tar.gz
955
Diffstat (limited to 'cpp/090debug')
-rw-r--r--cpp/090debug13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/090debug b/cpp/090debug
new file mode 100644
index 00000000..ca88b86c
--- /dev/null
+++ b/cpp/090debug
@@ -0,0 +1,13 @@
+:(before "End Globals")
+// Operator to look at fields of records.
+const int _PRINT = 99;
+:(before "End Primitive Recipe Numbers")
+Recipe_number["$print"] = _PRINT;
+assert(Next_recipe_number < _PRINT);
+:(before "End Primitive Recipe Implementations")
+//: beware: overridden in later layers
+case _PRINT: {
+  vector<int> result(read_memory(instructions[pc].ingredients[0]));
+  cout << result[0] << '\n';
+  break;
+}