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

Syntax for specifying exact bytecode offset #107

Open
SamWilsn opened this issue Aug 3, 2022 · 0 comments
Open

Syntax for specifying exact bytecode offset #107

SamWilsn opened this issue Aug 3, 2022 · 0 comments
Labels
A-assembler Area: assembler C-enhance Category: a request for an improvement E-hard Experience: difficult, probably not for the faint of heart

Comments

@SamWilsn
Copy link
Contributor

SamWilsn commented Aug 3, 2022

The output from disease is not immediately importable into eas, which is pretty annoying. I also have a weird function selector jump table implementation that requires precisely positioning instructions. I propose the following syntax to exactly specify an instruction's offset:

        invalid

<a>     jumpdest
        pc

# Leading zeros are ignored.
<0d>    gas

# Leading and trailing whitespace inside the brackets is ignored.
< f >   caller

Gaps between instructions are filled with zeros, and instructions must still be written in increasing order. Labels refer to the next written instruction, and not the fill bytes. A label after a gap refers to the location after the last fill byte. A label before a gap without a subsequent instruction is an error.

The example above would assemble to:

fe0000000000000000005b58005a000033
@SamWilsn SamWilsn added C-enhance Category: a request for an improvement A-assembler Area: assembler E-hard Experience: difficult, probably not for the faint of heart labels Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assembler Area: assembler C-enhance Category: a request for an improvement E-hard Experience: difficult, probably not for the faint of heart
Projects
None yet
Development

No branches or pull requests

1 participant