Maybe fix branching / jmp?
authorAlyssa Rosenzweig <alyssa@backtick.town>
Thu, 23 Jun 2016 19:10:06 +0000 (12:10 -0700)
committerAlyssa Rosenzweig <alyssa@backtick.town>
Thu, 23 Jun 2016 19:10:06 +0000 (12:10 -0700)
src/CPU/build-cpu.js

index 6569df6..0746740 100644 (file)
@@ -113,10 +113,11 @@ var sources = table.map(function(x, i) {
             instruction.push("set flagC to <" + operand + " > 255 or " + operand + " < 0>");
         }
 
-        instruction = instruction.concat([
-            'say "' + x.assembler + '" for 2 secs',
-            'change PC by ' + x.size
-        ]);
+        instruction = instruction.push('say "' + x.assembler + '" for 2 secs');
+
+        if(instruction.name != "JMP") {
+            instruction.push("change PC by " + x.size);
+        }
 
         return instruction.join("\n");
     } else {
This page took 0.033819 seconds and 4 git commands to generate.