+Karl G Posted June 13, 2019 Share Posted June 13, 2019 How can I get rid of warnings about undefined symbols that are used for conditional assembly. For example, I have the following in my code: ifconst RANDOM_PLAY jsr SubGetRand else lda SWCHA endif I'll either define the RANDOM_PLAY symbol or leave it commented before that depending on the behavior I want. This works fine, but the assembler gives warnings about missing symbols. is there any way to suppress these warnings, or a better way to accomplish the above that doesn't generate the warnings? Quote Link to comment Share on other sites More sharing options...
brfennpocock Posted June 13, 2019 Share Posted June 13, 2019 Personally, I'd do something like MODE_Random_Play = 1 MODE_Not_Random = 2 .if GAME_MODE = MODE_Random_Play jsr SubGetRand .else lda SWCHA .endif disclaimer: I don't use dasm, so YMMV 1 1 Quote Link to comment Share on other sites More sharing options...
azure Posted June 14, 2019 Share Posted June 14, 2019 (edited) I use this and don't get any warnings: IFCONST AFP_TARGET IF AFP_TARGET != 1 lda #%00000010 sta VBLANK ENDIF ENDIF Then tried adding a new reference I know doesn't exist: IFCONST TEST_0987654321 ECHO "defined" ENDIF Still no warnings. Are you sure it's not caused by something else? Dasm version: DASM 2.20.11 20171206 Edited June 14, 2019 by azure 1 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 14, 2019 Share Posted June 14, 2019 The symbol list only normally shows up on a successful assemble when using the -v3 or -v4 switches. If that's the issue, just use a lower verbosity. Or maybe you mean that all of these non-problem symbols show up in the unresolved list when there's a problematic unresolved symbol that prevents assembling? In that case, you could define all of the constant options early on in your code, and just test their values instead. That way they're defined either way. RANDOM_PLAY = 0 ;bunch of code if RANDOM_PLAY == 1 jsr SubGetRand else lda SWCHA endif 1 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 14, 2019 Author Share Posted June 14, 2019 Good solutions, both. I probably don't need the verbosity that high most of the time, and I didn't think about testing for the value of the constant instead of its existence. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.