Skip to content

Conversation

@iten-alg
Copy link
Owner

Addresses the bytecblock portions of issue 4034 where the assembler has bad interactions with the byte pseudo-ops.

Remain to be addressed in later updates tonight: intcblock side of things, disassembler, and what to do if exactly one const block manually created but unclear whether block will be made before or after pseudo-ops

@iten-alg iten-alg requested a review from jannotti May 24, 2022 18:48
ops = testProg(t, "intcblock 0x01 0x02; int 0x02", AssemblerMaxVersion)
expected = []byte{byte(AssemblerMaxVersion), 0x20, 0x02, 0x01, 0x02, 0x23}
require.Equal(t, expected, ops.Program)
// Previous int pseudo-ops should be pushints
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably have a tough time really knowing what's "previous" here, right? In this example it's correct, but with branching, you could have some code that appears before other code, but runs later.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I agree, but it's also pretty nonsensical to only have a single intcblock but then also not put it at the beginning (except for some potential dynamic cost saving I suppose). I'm happy to change it to just if you manually put in a const block, the pseudo-ops all go to pushint/pushbytes, but this means that people who want to manually set up const blocks now also have to manually index them.

Another option could be to require the const block setups to be the first ops or else the pseudo-ops just go to pushint/pushbytes

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.

3 participants