Explorar el Código

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

Shuning Bian hace 2 meses
padre
commit
7f209d681e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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