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

Take advantage of the new Executor::step API in cambridge-asm #1

Open
SaadiSave opened this issue Jun 7, 2022 · 1 comment
Open

Comments

@SaadiSave
Copy link
Owner

  • Make UI to monitor register and memory contents throughout execution
  • Add buttons for stepwise execution and pausing
@SaadiSave
Copy link
Owner Author

SaadiSave commented Jun 7, 2022

Add two functions: parse and step
For step, the Executor is not wasm-bindgen compatible, so use once_cell to initialise during parse and then step through it during execution.

The step function should return the Context at every step, so serialize it to JsValue using serde-wasm-bindgen and return. Then, define a Context type in typescript, like this:

type MemEntry = {
    literal: number,
    address: number | undefined
}

type Memory = Map<number, MemEntry>

type Context = {
    cmp: boolean,
    mar: number,
    acc: number,
    ix: number,
    flowOverrideReg: boolean,
    mem: Memory,
    ret: number,
    gprs: number[],
    end: boolean,
}

And cast like this:

let ctx = step() as Context

*To allow serialization, add a conditional derive of Serialize on Context in cambridge-asm

@SaadiSave SaadiSave changed the title Take advantage of the new step API for Executors in cambridge-asm Take advantage of the new Executor::step API in cambridge-asm Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant