Nukey Shay Posted November 29, 2004 Share Posted November 29, 2004 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 Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted November 29, 2004 Share Posted November 29, 2004 Hi there! I'm getting errors with the following... But it still compiles without errors, or? It just seems to require an additional assembler pass. Greetings, Manuel Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 The posted file WILL compile fine. The question is that as soon as any of those lines are put back, it generates label mismatch errors (but I don't know why). The code sample above exists at $DD00...and none of those tags are used any other place in the program. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 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? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 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 Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted November 30, 2004 Share Posted November 30, 2004 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 Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 5 passes and it still fails for me. Trying higher numbers... Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 NINE passes and it still fails It must be some other problem...it shouldn't need more than 3 (as you posted). command line used: dasm sid.asm -f3 -p9 -osid.bin Quote Link to comment Share on other sites More sharing options...
Aaron Posted November 30, 2004 Share Posted November 30, 2004 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... Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 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 Quote Link to comment Share on other sites More sharing options...
CPUWIZ Posted November 30, 2004 Share Posted November 30, 2004 You could always bitch at Andrew, isn't he maintaining DASM? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 Maybe it's karma catching up to me for all those games I hacked? Makes a nice little puzzle tho, I guess. I am relieved to see that I'm not the only one getting the error. I figured it might be madness setting in a bit early until I read that. Quote Link to comment Share on other sites More sharing options...
Aaron Posted November 30, 2004 Share Posted November 30, 2004 Ok, this time I'm actually going to help instead of making groundless assumptions... 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. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 30, 2004 Author Share Posted November 30, 2004 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) Much thanks for the info! Funny that I never ran into this problem before Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted December 1, 2004 Share Posted December 1, 2004 You could always bitch at Andrew, isn't he maintaining DASM? Bitch bitch bitch, all you guys ever do is bitch! Quote Link to comment Share on other sites More sharing options...
~llama Posted December 6, 2004 Share Posted December 6, 2004 Bitch bitch bitch, all you guys ever do is bitch! Hehehe except us Channel F guys Quote Link to comment Share on other sites More sharing options...
Blackbird Posted December 6, 2004 Share Posted December 6, 2004 Actually, I've been tempted to ask if Davie could throw in a command which allows you to write out half-bytes in data... but I worked by way around it, for now... Quote Link to comment Share on other sites More sharing options...
Tom Posted December 6, 2004 Share Posted December 6, 2004 Actually, I've been tempted to ask if Davie could throw in a command which allows you to write out half-bytes in data... could you explain that some more ? Quote Link to comment Share on other sites More sharing options...
Blackbird Posted December 7, 2004 Share Posted December 7, 2004 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. Quote Link to comment Share on other sites More sharing options...
Tom Posted December 7, 2004 Share Posted December 7, 2004 horrible is the right word indeed Quote Link to comment Share on other sites More sharing options...
Akteon Posted December 2, 2014 Share Posted December 2, 2014 I just encountered this error and found out that the file causing the error was encoded in UTF-8. When I removed the byte order mark, EF BB BF, from the beginning of the file, the error disappeared. 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.