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

Update ISA spec #106

Open
thealmarty opened this issue Jan 25, 2024 · 4 comments
Open

Update ISA spec #106

thealmarty opened this issue Jan 25, 2024 · 4 comments

Comments

@thealmarty
Copy link
Collaborator

thealmarty commented Jan 25, 2024

Our ISA spec is getting out of date as we actively develop. We should update it. E.g.,

  • Add READ_ADVICE:
    Operands: a
    Description: Read the content of the advice tape and write the next 4 byte values to those beginning at offset a.

  • Add WRITE:
    Operands: b(fp)
    Description: Follow the pointer stored at offset b from the current frame pointer and write the next 4 byte values to the output chip.

  • Remove `ISH{L,R}

  • Add DIVI

  • Add immediate versions of bitwise operations and, or, xor

  • Add NE:
    Operands: a, b(fp), c(fp)
    Description: If [b] != [c] then set a to 1. Otherwise, set a to 0.

  • Add MULHU:
    Operands: a, b(fp), c(fp)
    Description: Multiply [b] by [c] then set a to the top part of the result.

  • Add LOADFP(to be implemented):
    Operands: a, b(fp)
    Description: Stores the current value of fp plus the immediate operand b into the register numbered a. The operand c is always set to 0 (it is unused), while the operands d and e are always set to 1 (indicating that b and c are immediate operands).

  • Add ILT

@morganthomas
Copy link
Collaborator

@maxgillett is making a start on this. That said, I would caution us against premature documentation. Most of these opcodes are experimental and it's not clear that they will be included in a release. We can avoid unnecessary documentation effort and producing docs that will be quickly out of date by waiting until APIs stabilize before we document them.

@thealmarty
Copy link
Collaborator Author

Awesome start with #60, thanks! Yes we can fill out the doc more later but I'd like to keep track of it as we go as well.

@thealmarty
Copy link
Collaborator Author

As per #113 the spec for READ_ADVICE has been updated to:

Operands: a
Description: Read the content of the advice tape and write the next byte to the low byte of the word beginning at offset a. If the end of the advice tape is reached, write 0xFFFFFFFF instead.

@thealmarty
Copy link
Collaborator Author

As per #108 LOADFP is implemented.but not tested.

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

2 participants