-
Notifications
You must be signed in to change notification settings - Fork 8
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
EOF #71
Comments
|
I'm implementing an assembler and the syntax I'm using is:
The reasoning is explained in ipsilon/eof#174.
Same reasoning applies to
I think we're aligned on this principle but your example is wrong. I'd like us to have a standard assembly representation to avoid these off-by-one differences across different tools. This is what I was trying with ipsilon/eof#174 but I think a separate document for standard notation might be a better idea? What do you think? |
These collide with our push syntax. Likely yours looks like |
You are right. edited in description (previously e6 21) |
That's fine, I think the use of spacing can vary but it seems important to have numbers with a consistent meaning across tools. By the way I think your other example should also be changed to be consistent with non-exchange swaps:
|
How are you planning to represent RJUMP and RJUMPV? I think you will run into issues there because they can't be made into a single word? If you're not able to use space-separated arguments to avoid confusion with push, have you considered using delimiters In my case I'm doing:
|
(I'm guessing what you mean here) I want the code to read the same as |
The thing is that with this syntax this operation |
You're right; it is weird that SWAP3 swaps 1 and 4 while SWAP2&3 would swap 2&3. |
I think this makes a lot of sense for arrays ( |
I have verified that I'm not currently using |
I think the real problem is the official opcode name, being 2-indexed. |
If you mean the original SWAPn series of opcodes, yes, maybe SWAPn and DUPn should've been numbered to reflect the actual stack height that is affected. But at this point I expect anyone dealing with assembly to be used to this, and I think the expectation would be that arguments to EXCHANGE have the same meaning as arguments to SWAP. |
With
@frangio Would you be interested in using the |
(deleted, |
Rereading it again I think |
So I think we agree on the DUP indexing for the representation of |
Editing my previous posts now to fix the mistake makes the discussion even more confusing so I'm only going to edit the OP. I added notes to the other posts. |
It's possible based on this that you actually want the SWAP indexes though. I think you advocated the DUP indexes here:
|
Yes I do want the SWAP indices. I believe |
Goodness it's different every time I read it. |
There are two separate instances of From the spec:
If the first nibble is 0 you will be swapping the second stack element (closest one that isn't the top of the stack) with some other element (deeper in the stack). |
So we are in disagreement then. That's too bad. I think ipsilon/eof#174 is a good place to continue that discussion. |
I think we might have a disagreement about the meaning of |
Possibly not, because I would want that to also use DUP indexes, even though it has the SWAP prefix. We agree that |
EOF adds more immediates. I plan to utilize syntactic sugar for them.
My current idea for EIP-663 is like this:
DUP33
encodes ase6 20
whileDUP3
still encodes as82
SWAP17
encodes ase7 10
whileSWAP16
still encodes as9f
SWAP2&3
encodes ase8 00
(EXCHANGE 0x00
)The text was updated successfully, but these errors were encountered: