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

Refactor reference table with expandable info #40

Closed
assimovt opened this issue Nov 1, 2021 · 3 comments
Closed

Refactor reference table with expandable info #40

assimovt opened this issue Nov 1, 2021 · 3 comments
Assignees
Labels
improvement Improvement
Milestone

Comments

@assimovt
Copy link
Contributor

assimovt commented Nov 1, 2021

  • Move notes & fork into doc
  • Per opcode Markdown template doc
  • Expandable rows
  • Cross link from the About page
@assimovt assimovt self-assigned this Nov 1, 2021
@assimovt assimovt added the improvement Improvement label Nov 1, 2021
@assimovt assimovt added this to the Beta milestone Nov 1, 2021
@assimovt
Copy link
Contributor Author

assimovt commented Nov 2, 2021

@peroket could you please drop a sample MD file here for any OPCODE you like with information you would like to see, including h1-h2, code, links, and any other formatting you will find useful. I will then use this as a template for this feature. We will ofc need such pages afterward for each opcode. Thanks 👍🏽

@peroket
Copy link
Member

peroket commented Nov 2, 2021

Here is an example of what I have in mind. Note that that structure may be a bit flexible, because some instructions will have no error cases or stack input sections, and others may have other sections like stack output and "fun fact", for example RETURNDATASIZE may be used to push a 0 on the stack a bit more cheaply in some conditions. Does that help? Stuff can be adapted to suit you better as well, for example the title may be level 2 or less if it renders better.
(instruction here is JUMPI by the way)

| Appeared in fork | Group |
|------------------|-------|
| Frontier | Stack Memory Storage and Flow Operations |

# Notes
The program counter (PC) is a byte index (starting from 0) in the deployed code. It indicates which instruction will be executed next. When an [ADD](link_to_instruction) is executed, for example, the PC is incremented by 1, since the instruction is 1 byte. The [PUSH](link_to_group) instructions are bigger than one byte, and so will increment the counter accordingly.

The **JUMPI** instruction may alter the program counter, thus breaking the linear path of the execution to another point in the deployed code. It is used to implement functionalities like loops and conditions.

# Stack input
0. `Counter`: byte index in the deployed code where execution will continue from. Must be a [JUMPDEST](link_to_instruction) instruction.
1. `Boolean`: the program counter will be altered with the new value only if this value is different from 0. Otherwise, the program counter is simply incremented and the next instruction will be executed.

# Error cases
- Not enough values on the stack, see [here](link_to_future_page_to_explain).
- `Counter` index is not a [JUMPDEST](link_to_instruction): the execution is stopped. //TODO more details.

@assimovt
Copy link
Contributor Author

assimovt commented Nov 2, 2021

👍 this is a good start. I will work on it then and send you a branch for review.

assimovt pushed a commit that referenced this issue Nov 2, 2021
- Convert opcodes.json reference doc to use hex
- Use `next-mdx-remote` and `gray-matter to power markdown with meta
- Define markdown doc specific UI components (h1, h2, h3, ul, ol, li, p)
- Add a sample 00.mdx doc
- Refactor reference table by separating column data and doc rows

Closes #40
assimovt pushed a commit that referenced this issue Nov 5, 2021
- Convert opcodes.json reference doc to use hex
- Use `next-mdx-remote` and `gray-matter to power markdown with meta
- Define markdown doc specific UI components (h1, h2, h3, ul, ol, li, p)
- Add a sample 00.mdx doc
- Refactor reference table by separating column data and doc rows

Closes #40
assimovt pushed a commit that referenced this issue Nov 5, 2021
- Convert opcodes.json reference doc to use hex
- Use `next-mdx-remote` and `gray-matter to power markdown with meta
- Define markdown doc specific UI components (h1, h2, h3, ul, ol, li, p)
- Add a sample 00.mdx doc
- Refactor reference table by separating column data and doc rows

Closes #40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement
Projects
None yet
Development

No branches or pull requests

2 participants