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

Decoder Documentation #31

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Decoder Documentation #31

wants to merge 7 commits into from

Conversation

mmsc2
Copy link
Contributor

@mmsc2 mmsc2 commented Jul 26, 2023

No description provided.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@jrchatruc
Copy link
Member

jrchatruc commented Jul 27, 2023

Give an example of an actual simple cairo assembly instruction and how it encodes to bytecode, something like ap++. You can take one from the Cairo paper, pages 27/28. This will then lead you to talk about instruction execution and how it works in detail, which you can document on your execution PR

Copy link
Member

@jrchatruc jrchatruc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of comments

README.md Outdated
};
```
to extract the dst_reg flag we can define a mask 'DST_REG_MASK' with value 0x0001 and and a padding 'DST_REG_OFF' with value 0 because it is the less significant bit, then we can perform the operation
'(((encoded_instr) >> 48) & DST_REG_MASK) >> DST_REG_OFF' to obtain the dst_reg flag. We shifted 48 bits first because there is where the flags start.
Copy link
Member

@jrchatruc jrchatruc Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not rendering well because you are using ' to enclose it instead of `. Consider changing it or just moving to a code block with using ```

The same goes for a bunch of code and instructions mentioned shown above

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

5 participants