Conditional compiling problem
An assembler for the legendary 6502 processor and it's derivatives
Brought to you by:
soci
I have this piece of code:
+ .word (+), 10 ;pointer, line number
.null INPUT, '"DENSITY FOR TRACKS >35";H:',PRINT
+ .word (+), 15 ;pointer, line number
.null FOR,"T",EQUALS,"1",TO,"41:T$",EQUALS,RIGHTS,"(",STRS,"(T",PLUS,"100),2)"
.if DC==0
+ .word (+), 20 ;pointer, line number
.null POKE, format("%d,", XX),ASC,"(",LEFTS,'(T$,1))'
+ .word (+), 25 ;pointer, line number
.null POKE, format("%d,", XX+1),ASC,"(",RIGHTS,'(T$,1))'
.endif
+ .word (+), 30 ;pointer, line number
.null SYS, format("%4d", UPLOAD),":",REM," UPLOAD"
+ .word (+), 35 ;pointer, line number
At the top, for debugging I have DC=0 or DC=1
if I put DC=0 and compile, everything is fine.
But if I put DC=1 it says:
znibp11.s:12:16: error: not defined anonsymbol '+'
+ .word (+), 15 ;pointer, line number
^
Not really a bug as it was documented since 2017 (and works like this since 2010):
https://tass64.sourceforge.net/#symbols-anonymous
and once more
https://tass64.sourceforge.net/#conditional-assembly
I've considered briefly to change this but then realized it'd just make anonymous label use even more dangerous than already when combined with conditional assembly.
Instead just move the anonymous labels so that the conditionally compiled part has only self contained references:
It's do the same.