Skip to content

Syntax for specifying exact bytecode offset #107

Open
@SamWilsn

Description

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

Metadata

Assignees

No one assigned

    Labels

    A-assemblerArea: assemblerC-enhanceCategory: a request for an improvementE-hardExperience: difficult, probably not for the faint of heart

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions