about summary refs log tree commit diff stats
path: root/cpp/015jump
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-25 01:24:11 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-25 01:24:11 -0800
commit6f5d7864f6c0c62b8849349cb182c61f8dbed452 (patch)
treec4c22032dc09eefbc3b55268044d29607804c4fd /cpp/015jump
parentdc3803320013059ad400853e3f6a2851f7f82c04 (diff)
downloadmu-6f5d7864f6c0c62b8849349cb182c61f8dbed452.tar.gz
832 - call-stack for C++ version
These #defines and references now span many different layers. Let's see
if the lack of encapsulation causes problems.

Also interesting to run into a case where I need to modify a
foundational layer and touch every single scenario/trace. Only
alternative was to duplicate all the different layers that add
instructions. Sign of problems with this model?
Diffstat (limited to 'cpp/015jump')
-rw-r--r--cpp/015jump26
1 files changed, 13 insertions, 13 deletions
diff --git a/cpp/015jump b/cpp/015jump
index 99b333dd..26861166 100644
--- a/cpp/015jump
+++ b/cpp/015jump
@@ -16,9 +16,9 @@ recipe main [
   jump 1:offset
   1:integer <- copy 1:literal
 ]
-+run: instruction 0
++run: instruction main/0
 +run: ingredient 0 is 1
--run: instruction 1
+-run: instruction main/1
 -mem: storing in location 1
 
 :(scenario "jump_backward")
@@ -27,9 +27,9 @@ recipe main [
   jump 1:offset  //    | 1 +-+
   jump -2:offset //  2 +-->+ |
 ]                //       3 \/
-+run: instruction 0
-+run: instruction 2
-+run: instruction 1
++run: instruction main/0
++run: instruction main/2
++run: instruction main/1
 
 :(before "End Globals")
 const int JUMP_IF = 11;
@@ -56,10 +56,10 @@ recipe main [
   jump-if 999:literal 1:offset
   1:integer <- copy 1:literal
 ]
-+run: instruction 0
++run: instruction main/0
 +run: ingredient 1 is 1
 +run: jumping to instruction 2
--run: instruction 1
+-run: instruction main/1
 -mem: storing in location 1
 
 :(scenario "jump_if_fallthrough")
@@ -67,9 +67,9 @@ recipe main [
   jump-if 0:literal 1:offset
   123:integer <- copy 1:literal
 ]
-+run: instruction 0
++run: instruction main/0
 +run: jump-if fell through
-+run: instruction 1
++run: instruction main/1
 +mem: storing in location 123
 
 :(before "End Globals")
@@ -97,10 +97,10 @@ recipe main [
   jump-unless 0:literal 1:offset
   1:integer <- copy 1:literal
 ]
-+run: instruction 0
++run: instruction main/0
 +run: ingredient 1 is 1
 +run: jumping to instruction 2
--run: instruction 1
+-run: instruction main/1
 -mem: storing in location 1
 
 :(scenario "jump_unless_fallthrough")
@@ -108,8 +108,8 @@ recipe main [
   jump-unless 999:literal 1:offset
   123:integer <- copy 1:literal
 ]
-+run: instruction 0
++run: instruction main/0
 +run: ingredient 0 is 999
 +run: jump-unless fell through
-+run: instruction 1
++run: instruction main/1
 +mem: storing in location 123