about summary refs log tree commit diff stats
path: root/cpp/023jump
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-24 20:37:55 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-24 20:39:19 -0700
commita767dbd3338af1d3cc69e3c200341fff8e08fc4b (patch)
tree24aaf801e9e94af6718fe74499b7ec0a64ba5c58 /cpp/023jump
parentceefc4d45ced8b0913f35657d68667de884eddf9 (diff)
downloadmu-a767dbd3338af1d3cc69e3c200341fff8e08fc4b.tar.gz
1176
Diffstat (limited to 'cpp/023jump')
-rw-r--r--cpp/023jump12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/023jump b/cpp/023jump
index d4dd6094..932d0da8 100644
--- a/cpp/023jump
+++ b/cpp/023jump
@@ -7,8 +7,8 @@ Recipe_number["jump"] = JUMP;
 :(before "End Primitive Recipe Implementations")
 case JUMP: {
   trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].value;
-  pc += current_instruction().ingredients[0].value;
-  trace("run") << "jumping to instruction " << pc+1;
+  current_step_index() += current_instruction().ingredients[0].value;
+  trace("run") << "jumping to instruction " << current_step_index()+1;
   break;
 }
 
@@ -47,8 +47,8 @@ case JUMP_IF: {
     break;
   }
   trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name;
-  pc += current_instruction().ingredients[1].value;
-  trace("run") << "jumping to instruction " << pc+1;
+  current_step_index() += current_instruction().ingredients[1].value;
+  trace("run") << "jumping to instruction " << current_step_index()+1;
   break;
 }
 
@@ -87,8 +87,8 @@ case JUMP_UNLESS: {
     break;
   }
   trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name;
-  pc += current_instruction().ingredients[1].value;
-  trace("run") << "jumping to instruction " << pc+1;
+  current_step_index() += current_instruction().ingredients[1].value;
+  trace("run") << "jumping to instruction " << current_step_index()+1;
   break;
 }