Skip to content

Commit

Permalink
stop condition now checked on first instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
sifferman committed Jul 30, 2023
1 parent b710c74 commit 84e8729
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions py65/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,22 @@ def _run(self, stopcodes):

if not breakpoints:
while True:
mpu.step()
if mem[mpu.pc] in stopcodes:
mpu.step()
break
mpu.step()
else:
while True:
mpu.step()
pc = mpu.pc
if mem[pc] in stopcodes:
mpu.step()
break
if pc in breakpoints:
msg = "Breakpoint %d reached."
self._output(msg % self._breakpoints.index(pc))
mpu.step()
break
mpu.step()

# Switch back to the previous input mode.
console.restore_mode()
Expand Down

0 comments on commit 84e8729

Please sign in to comment.