Преглед изворни кода

Fixes a bug where the HALT instruction decrements PC instead of setting it to -1

Shuning Bian пре 2 месеци
родитељ
комит
7f209d681e
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      vm.py

+ 1 - 1
vm.py

@@ -98,7 +98,7 @@ def main():
 
         if inst.op == Instruction.OP_HALT:
             halted = True
-            pc -= 1
+            pc = -1
 
         if inst.op == Instruction.OP_STATE:
             pc += 1