about summary refs log tree commit diff stats
path: root/cpp/020array
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-28 19:20:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-28 19:20:58 -0700
commitd39883ec7eaa17a3efafeff86ee3f0d75e4d0ebf (patch)
treef8430a788ea15a4dfd6b76b33a6df740749f62b1 /cpp/020array
parentf1a3be1c542120b01fd8273aabf8a674530df981 (diff)
downloadmu-d39883ec7eaa17a3efafeff86ee3f0d75e4d0ebf.tar.gz
989
Diffstat (limited to 'cpp/020array')
-rw-r--r--cpp/020array12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/020array b/cpp/020array
index f6f2c0c5..bfa2b4ac 100644
--- a/cpp/020array
+++ b/cpp/020array
@@ -122,3 +122,15 @@ case INDEX_ADDRESS: {
   write_memory(instructions[pc].products[0], result);
   break;
 }
+
+:(scenario "index_indirect")
+recipe main [
+  1:integer <- copy 3:literal
+  2:integer <- copy 14:literal
+  3:integer <- copy 15:literal
+  4:integer <- copy 16:literal
+  5:address:array:integer <- copy 1:literal
+  6:integer <- index 5:address:array:integer/deref, 1:literal
+]
++run: instruction main/5
++mem: storing 15 in location 6