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

Arithmetic and constant-chains #3

Open
fwsGonzo opened this issue Sep 19, 2021 · 0 comments
Open

Arithmetic and constant-chains #3

fwsGonzo opened this issue Sep 19, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@fwsGonzo
Copy link
Owner

It should be possible to calculate values from constants and dependent symbols automatically. We also need to support parenthesis and various bit-operations. It's a rather big feature, but necessary for any serious work.

Step 1: Parse tokens. Any parenthesis is treated as a calculation that could be optimized leaving only constants and labels.

OK: (label + 0x44)
Wrong. label + 0x44

The tokenizer is not smart enough for the second one yet.

Step 2: Any constant used that contains symbols should be automatically solved by scheduling it for when the symbol value is revealed.

Step 3: When calling the scheduled ops, the constant will be resolved and written into the binary from a lambda that has all the necessary context.

This method avoids re-parsing the assembly, but perhaps it's better to rethink the strategy.

@fwsGonzo fwsGonzo added the enhancement New feature or request label Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant