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

Feature to step back one instruction, and execute all instructions #16

Open
roerohan opened this issue Sep 24, 2020 · 1 comment
Open
Labels
enhancement New feature or request hacktoberfest Hacktoberfest 2020

Comments

@roerohan
Copy link
Owner

roerohan commented Sep 24, 2020

Feature to step back one instruction, and execute all instructions

The bot can only execute instructions one by one currently. Features to execute all instructions at once, and step back an instruction to see the state would be useful for debugging!

Step back

  • A possible solution for this would be storing all the states in a redux slice and reinitializing registers and memory according to it's previous state.

Execute all

  • Right now, instructions are executed with the help of the stepClick function below, which is triggered by clicking the next step button on the UI.
  • For executing all instructions, a possible solution would be to call emulator.cpu.step() repeatedly until the last instruction is reached.

const stepClick = () => {
loadCode();
emulator.cpu.step();
dispatch(updateRegisters(emulator.getRegisters()));

@roerohan roerohan added enhancement New feature or request hacktoberfest Hacktoberfest 2020 labels Sep 24, 2020
@roerohan roerohan pinned this issue Sep 24, 2020
@namsnath
Copy link
Contributor

namsnath commented Oct 2, 2020

#47 Adds these features.
Currently, there is a bug while running code from a stepped-back position.
Steps to reproduce are mentioned in the PR.

roerohan added a commit that referenced this issue Oct 4, 2020
fix: register related bug from #16 and #47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Hacktoberfest 2020
Projects
None yet
Development

No branches or pull requests

2 participants