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 29, 2023
1 parent b710c74 commit a678fe4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py65/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,19 @@ def _run(self, stopcodes):

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

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

0 comments on commit a678fe4

Please sign in to comment.