// ships required in order to run this code
#ship debug : Debug
-#ship iscratch : Iscratch
+#ship memory : Memory
// instructions not in any codebag are part of the "root codebag"
// which is dispatched when the code is loaded
-BOB: sendto iscratch.inCBD;
-iscratch.inCBD: [*] take, deliver;
+BOB: sendto memory.inCBD;
+memory.inCBD: [*] take, deliver;
debug.in: [*] take, deliver;
--- /dev/null
+// output ///////////////////////////////////////////////////////////////////
+#expect 14
+#expect 13
+#expect 12
+#expect 11
+
+// program //////////////////////////////////////////////////////////////////
+#ship debug : Debug
+#ship memory : Memory
+#ship fifo : Fifo
+
+// dumb configurations
+debug.in: [*] take, deliver;
+memory.inAddr: [*] take, deliver;
+memory.inData: [*] take, deliver;
+fifo.in: [*] take, deliver;
+
+// addresses and values to initialize the memory with
+1: sendto memory.inAddr.write;
+2: sendto memory.inAddr.write;
+3: sendto memory.inAddr.write;
+4: sendto memory.inAddr.write;
+11: sendto memory.inData;
+12: sendto memory.inData;
+13: sendto memory.inData;
+14: sendto memory.inData;
+
+// send write-completion tokens to the fifo output
+memory.out:
+ [4] take, notify fifo.out;
+ [*] take, sendto debug.in;
+
+// when the write-completion tokens accumulate, unleash
+// the read addresses
+fifo.out:
+ [4] wait;
+ [4] take, sendto memory.inAddr.read;
+
+// read addresses
+4: sendto fifo.in;
+3: sendto fifo.in;
+2: sendto fifo.in;
+1: sendto fifo.in;
+