Jump to content
IGNORED

Label mismatch...WTF??


Nukey Shay

Recommended Posts

Here's a puzzler:

 

I'm getting errors with the following...

 

PP1:
;       STX    Waste                      ;3
;       STX    Temp                       ;3
;       LDX    #$00                       ;2
;       BEQ    PP2                        ;2
;       STX    Temp                       ;3
;       LDX    #$01                       ;2

PP2:
;       CMP    $CB,x                      ;4
;       BCC    PP3                        ;2
;       STA    $CB,x                      ;4
;       LDA    #$00                       ;2
;       STA    $CD,x                      ;4
;       STA    $CF,x                      ;4

PP3:
;       LDX    Temp                       ;2
;       STX    Waste                      ;3
;       JMP    PP1done                    ;3

PP1done:

 

Notice that all of the tags are in place. This will compile fine, but as soon as I uncomment ANY lines between (even the LDA #$00 which references no tags), Dasm reports label mismatch errors for all of them. I thought it was because I was using an older version of Dasm, so I updated...and the current version does the same thing :?

 

What's the cause?

 

 

Source file:

sid.zip

Link to comment
Share on other sites

Tried using more passes (I assume that the default is 3)...but it still does it. The referenced tags show up as being 1 byte less than the phantom ones it's seeing :?

 

Never had a problem with Dasm before. Is there some kind of upper limit to the number of tags that a file can use?

Link to comment
Share on other sites

Here's the file I tried compiling...and the error it shows:

 

DASM V2.20.10, Macro Assembler (C)1988-2004

sid.asm (1869): error: Label mismatch...

--> PP2 dd0d                  

sid.asm (1876): error: Label mismatch...

--> PP3 dd19                  

sid.asm (1880): error: Label mismatch...

--> PP1done dd21                  

Unrecoverable error(s) in pass, aborting assembly!

Complete.

sid.zip

Link to comment
Share on other sites

Hi there!

 

Amazing... it works for me:

DASM V2.20.04, Macro Assembler (C)1988-2003



START OF PASS: 1

Including file "sid.s"



----------------------------------------------------------------------

SEGMENT NAME                 INIT PC  INIT RPC FINAL PC FINAL RPC

INITIAL CODE SEGMENT         1000                            1000                           

----------------------------------------------------------------------

400 references to unknown symbols.

689 events requiring another assembler pass.

- Expression in mnemonic not resolved.

- Expression in a DC not resolved.

- Label defined after it has been referenced (forward reference).





START OF PASS: 2

Including file "sid.s"

sid.s (1869): error: Label mismatch...

--> PP2 dd0d                  

sid.s (1876): error: Label mismatch...

--> PP3 dd19                  

sid.s (1880): error: Label mismatch...

--> PP1done dd21                  



----------------------------------------------------------------------

SEGMENT NAME                 INIT PC  INIT RPC FINAL PC FINAL RPC

INITIAL CODE SEGMENT         1000                            1000                           

----------------------------------------------------------------------

0 references to unknown symbols.

3 events requiring another assembler pass.

- Label value is different from that of the previous pass (phase error).





START OF PASS: 3

Including file "sid.s"



----------------------------------------------------------------------

SEGMENT NAME                 INIT PC  INIT RPC FINAL PC FINAL RPC

INITIAL CODE SEGMENT         1000                            1000                           

----------------------------------------------------------------------

0 references to unknown symbols.

0 events requiring another assembler pass.

 

Here's my Textpad configuration string for DASM:

dasm $FileName -f3 -o$BaseName.bin -ltext.txt -v3

 

Greetings,

Manuel

Link to comment
Share on other sites

I've seen this error a few times... in my case it meant I ran out of rom space. The code that exists at the labels in question gets placed at the same address as a later org statement. And you can't have two sets of code in the same place, right?

 

Looking at your code, I see you have an org statement right after the last label. Changing it to a higher address will probably fix things, if you can do that.

 

I have not idea how Cybergoth got it to assemble the way it was though... :ponder:

Link to comment
Share on other sites

No effect. The assembly has plenty of romspace in front and behind the ORG...it's only there so I could keep the error confined to a specific address region.

 

 

Still drawing a blank :(

 

 

BTW the number of tags doesn't really figure either, since Dasm can handle larger files than 8k with way more tags than this one has. I'm about ready to try splitting the file into seperate 4k halves and try compiling that way :sad:

Link to comment
Share on other sites

Ok, this time I'm actually going to help instead of making groundless assumptions... :roll:

 

I got it to assemble in 3 passes in DASM 2.20.07, with the same messages Cybergoth got. Maybe some bug got introduced in 2.20.10...?

 

Anyway, you have Waste = $2E defined all the way at the end of the file... It looks like DASM doesn't see this on the first pass and tries to fill in the code using a 2-byte address, so the labels get offset by the extra byte. DASM /should/ recognize the zero-page address on later passes, but doesn't for some reason...

 

So you could try moving the Waste definition to the top of the file. When I did that it assembled fine in 2 passes.

Link to comment
Share on other sites

That was it all right :) It was reading STX Waste as using absolute addressing the first pass. So the second pass generated the error once it had been changed to zero page addressing (and all those tags were suddenly in the wrong spots) :P

 

Much thanks for the info!

 

 

Funny that I never ran into this problem before :lol:

Link to comment
Share on other sites

Writing out data always leads me to want to write out only four bits instead of eight at a time, so it's more readable, or so I don't have to use filler space (and thus ROM) to keep it in line. Something like .nibble as opposed to .byte, basically. But I can just imagine the horrible offset that would occur should someone make the entire ROM offset by a half-byte, so I normally just pack it in using the .byte directive. My latest revision of code didn't need it anyway, since the data is now stored in three bytes per row.

Link to comment
Share on other sites

  • 9 years later...

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