8086.js
8086.js copied to clipboard
Feature to step back one instruction, and execute all instructions
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 thenext 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.
https://github.com/roerohan/8086.js/blob/017505bca69da4b7e803a2cd3e5353f9a14c5660/src/components/ButtonsContainer/index.jsx#L45-L48
#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.