Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endloopX jumps always jump to loopX start. Not to the value in the SA register. #44

Open
Rot127 opened this issue Jan 4, 2022 · 0 comments
Labels
wontfix This will not be worked on

Comments

@Rot127
Copy link
Member

Rot127 commented Jan 4, 2022

endloop instructions jump to the value in the SA0/SA1 register (if LC0/LC1 are greater than 0).

The values in SA0/SA1 can change during loop execution. Regardless of that, the jump targets of endloop instructions are always set to the original loop start. They will not change if the SA register is set again. This is technically incorrect.

We can't fix this because we can not emulate the code yet and it can't be detected during static analysis anyways.
So this will not be fixed but should be noted by anyone using this plugin.

This pattern often happens if multiple endloopX instructions belong to a single loopX instruction.

If you haven't done already you can check out the chapter about hardware loops in the programmers reference manual for a more in depth explanation of loop behavior.

@Rot127 Rot127 added the wontfix This will not be worked on label Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant