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

Different scopes for addresses and hex values #10

Open
Underrout opened this issue Sep 5, 2020 · 8 comments
Open

Different scopes for addresses and hex values #10

Underrout opened this issue Sep 5, 2020 · 8 comments

Comments

@Underrout
Copy link
Contributor

Are there any plans for differentiating between addresses ($80) and literal hex values (#$80) when it comes to their usage with opcodes? I know this is probably sort of difficult since in LDA $80 $80 would be an address but in db $80 or if !def == $80 it is actually just a hex value. I just personally find it a lot easier to understand code at a glance when the $80 in LDA $80 and the #$80 in LDA #$80 are highlighted in different colors and would love this feature if it's at all feasible.

@TheLX5
Copy link
Owner

TheLX5 commented Sep 5, 2020

Sounds like something that could be implemented. I'll run some tests to determine if it's actually possible to do and post the results here.

@Underrout
Copy link
Contributor Author

Thanks, it's worth noting that defines complicate this further since !def = $80 could be a literal or an address and it seems fairly impossible to figure out which it is without leaving the syntactic layer.

@TheLX5
Copy link
Owner

TheLX5 commented Sep 5, 2020

Yeah, I thought about it and it's hard, if not impossible, to determine with regex alone, not to mention that TextMate only works per line and matching several lines is pretty much a guaranteed headache.

I think I'll just detect if they're after an operator or asar directive to treat them as values. That should cover most cases.

@Underrout
Copy link
Contributor Author

Yeah I think that's probably the most reasonable solution.

@TheLX5
Copy link
Owner

TheLX5 commented Sep 5, 2020

Good enough, I guess.

I'll push the changes once I'm done with other minor stuff that popped up with other changes I made.

@Underrout
Copy link
Contributor Author

Ty ty, looks nice!

@TheLX5
Copy link
Owner

TheLX5 commented Sep 6, 2020

Addressed in 2c3370e

I will leave the issue open until the proper release of version 0.0.2 in case there's something wrong with the implementation of this feature.

@TheLX5
Copy link
Owner

TheLX5 commented Jun 25, 2021

Doesn't seem to be broken.... but SPC700 and GSU mnemonics might not work fine due to how the initial implementation works and looks like it'd be too annoying to add.

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

No branches or pull requests

2 participants