Przeglądaj źródła

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

Shuning Bian 2 miesięcy temu
rodzic
commit
7f209d681e
1 zmienionych plików z 1 dodań i 1 usunięć
  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