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

Forward references never allowed in expressions #28

Open
Ro5bert opened this issue Jan 5, 2021 · 2 comments
Open

Forward references never allowed in expressions #28

Ro5bert opened this issue Jan 5, 2021 · 2 comments

Comments

@Ro5bert
Copy link
Owner

Ro5bert commented Jan 5, 2021

Forward references should be allowed in expressions

  • as an argument to a mnemonic or macro, and
  • as an argument to any directive except conditionals, .byte, .csegsize, and .org (since these directives effect the IP).

Currently they are never allowed in expressions; for example, the following fails:

.device atmega2560 ; Arbitrary
.equ myequ=mylab
mylab: mov r1, r2
@Nevada317
Copy link

In fact, i think those were allowed back in 1.3.0. Need to check, but looks like they were ruined with ifdef refactor.
I will try to reproduce in older avra soon

@Ro5bert
Copy link
Owner Author

Ro5bert commented Jan 7, 2021

@Nevada317 Actually I realized they do work as arguments to mnemonics, if that's what you mean. It's just as arguments to directives that they don't work, because we try to evaluate expressions on directives in pass 1, even if we don't need to.

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