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

Feature request: pointer differences in relocatable blocks #29

Open
davidgiven opened this issue Aug 7, 2023 · 0 comments
Open

Feature request: pointer differences in relocatable blocks #29

davidgiven opened this issue Aug 7, 2023 · 0 comments

Comments

@davidgiven
Copy link

The code I'm trying to port does this a lot:

lda #message_end - message_start
message_end:
    dta c'This is a string'
message_start:

Unfortunately doesn't work inside relocation blocks, as the pointer difference fails with a 'Address relocation overload' error. However, while computing the pointer difference between labels in different blocks is impossible, it should be possible to compute this when the labes are in the same block, i.e. in the case above (and a number of other similar cases).

Would it be possible to add support for this? It should be just a matter of suppressing the error if the labels are in the same block and the arithmetic operation is a subtraction. I'm taking a look at the relevant code but am still trying to figure out the expression parser.

Thanks!

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

1 participant