From 84e87293d7ad2dc01b478f4bfdc661afb9211c62 Mon Sep 17 00:00:00 2001 From: Ethan Sifferman Date: Sat, 29 Jul 2023 15:38:45 -0700 Subject: [PATCH] stop condition now checked on first instruction --- py65/monitor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py65/monitor.py b/py65/monitor.py index 5726281..358a8a8 100644 --- a/py65/monitor.py +++ b/py65/monitor.py @@ -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()