You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the interactive terminal mode, sometimes, the highlighted line does not correspond to the instruction that is ready to be executed, which may confuse the user.
Most of the time, it's right after a jmp instruction, or a BRNE, for example.
2 - Highlight at line 1 (ldi r16, 10), but the first line of the CLI output says the instruction is BRNE loop, which is at line 6.
3 - Highlight at line 3, dec r16 instruction.
... it goes on until the Z flag is set and thus, it breaks out of the loop
21 - Highlight at line 4 (brne loop), but the 1st line of the CLI output says that the instruction is JMP done.
So that's a strange behaviour. Sometimes, the highlight is on the instruction that is just about to be executed, and some other times, it's the instruction line right before this one.
Do you think it can be improved in a way or another?
The highlight mismatch happened because we looked up the source line after executing instructions. Branch/jump instructions change PC, so the highlight sometimes pointed to the wrong line.
Fix: save PC before execution and use it to look up the source line. Now the highlight always matches the instruction being executed.
Activity
sql-hkr commentedon Nov 12, 2025
Thanks for the report!
The highlight mismatch happened because we looked up the source line after executing instructions. Branch/jump instructions change PC, so the highlight sometimes pointed to the wrong line.
Fix: save PC before execution and use it to look up the source line. Now the highlight always matches the instruction being executed.
fix: terminal highlight (#30)
Merge pull request #31 from sql-hkr/fix/terminal-highlight
brunobord commentedon Nov 12, 2025
thank you for the quick fix!