mirror of
https://github.com/lloeki/python-dcpu_16.git
synced 2025-12-06 01:44:40 +01:00
guard against SET PC, [SP++], and SET PC, [--SP]
This commit is contained in:
parent
d638ebe7ea
commit
a714a9d71a
1 changed files with 3 additions and 1 deletions
|
|
@ -415,8 +415,10 @@ class CPU(object):
|
|||
def run(c):
|
||||
"""step until PC is constant"""
|
||||
last_pc = 0xFFFF
|
||||
while c.pc != last_pc:
|
||||
last_sp = 0xFFFF
|
||||
while c.pc != last_pc or c.sp != last_sp:
|
||||
last_pc = c.pc
|
||||
last_sp = c.sp
|
||||
c.step()
|
||||
log("Infinite loop")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue