We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f16199d + 3ab3b32 commit fc6f7b3Copy full SHA for fc6f7b3
1 file changed
src/tiny8/cpu.py
@@ -353,6 +353,7 @@ def step(self) -> bool:
353
self.running = False
354
return False
355
356
+ pre_exec_pc = self.pc
357
instr, operands = self.program[self.pc]
358
359
# Build textual form of the instruction for tracing (uppercase mnemonic
@@ -396,11 +397,12 @@ def fmt_op(o):
396
397
398
# record step trace after execution (post-state)
399
self.step_count += 1
- source_line = self.pc_to_line.get(self.pc, -1)
400
+
401
+ source_line = self.pc_to_line.get(pre_exec_pc, -1)
402
self.step_trace.append(
403
{
404
"step": self.step_count,
- "pc": self.pc,
405
+ "pc": pre_exec_pc,
406
"instr": instr_text,
407
"regs": regs_snapshot,
408
"mem": mem_snapshot,
0 commit comments