avra icon indicating copy to clipboard operation
avra copied to clipboard

Forward references never allowed in expressions

Open Ro5bert opened this issue 4 years ago • 2 comments

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

Ro5bert avatar Jan 05 '21 00:01 Ro5bert

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

Nevada317 avatar Jan 07 '21 02:01 Nevada317

@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.

Ro5bert avatar Jan 07 '21 03:01 Ro5bert