Jump to content
IGNORED

Dumb DASM Question


Karl G

Recommended Posts

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?

 

Link to comment
Share on other sites

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 by azure
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...