8000 When studying a symbol expression use its address size if its smaller than that of the symbol by kugelfuhr · Pull Request #2729 · cc65/cc65 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

When studying a symbol expression use its address size if its smaller than that of the symbol #2729

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

kugelfuhr
Copy link
Contributor

This works around a piece of code known to be problematic. When a symbol is defined, the assembler studies it to determine its address size. This fails if the expression contains forward references in which case "absolute" is assumed. When later studying expressions containing this symbol, the code let the address size for the symbol override that of the actual expression. So if it was later found that a symbol expression evaluated to 8 bit ("zeropage"), since now all references could be resolved, the study function let the "absolute" value from the symbol override what it found out by evaluating the expression.

I've changed the code so that the override takes place only if the symbol has a smaller address size than what was found when evaluating the symbol expression. This might happen if a symbol is declared explicitly as zero page. On the other side, values are always enlarged as needed, so if studying a symbol results in a "zeropage" address size, the assembler will extend it to "absolute" whenever necessary. Which means that this change should be unproblematic.

Fixes #2208.

…mbol

expression, use the symbol address size only if it is smaller than the one
that was calculated.
@mrdudz
Copy link
Contributor
mrdudz commented Jun 23, 2025

thanks!

@mrdudz mrdudz merged commit c520455 into cc65:master Jun 23, 2025
2 checks passed
@mrdudz
Copy link
Contributor
mrdudz commented Jun 23, 2025

Mmmh did you test with that msbasic source? apparently the minimal reproducer i came up with back then still fails shrug
sorry. merging master helps >_<

@kugelfuhr kugelfuhr deleted the kugelfuhr/fix-2208 branch June 23, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Current ca65 generates different code for msbasic
2 participants
0