소스 검색

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