Just Jeff Posted January 18, 2018 Share Posted January 18, 2018 Good Morning, Does DASM ever legitimately re-arrange code? Here, GameStateLo is where things start going wrong. Does anyone know why this happens? Quote Link to comment Share on other sites More sharing options...
ZackAttack Posted January 18, 2018 Share Posted January 18, 2018 It's hard to say without the full source, but it looks like dasm is working fine. I think what you're seeing is stella loading symbols from another bank. Essentially each location may have more than one name which is dependent on the current bank and I believe stella will display them all in the debugger regardless of which bank is currently selected. 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 18, 2018 Share Posted January 18, 2018 Yep, Stella doesn't use your source code - it creates its own disassembly and uses the contents of the symbol file you created, 32KGame20180101p.sym, for the labels. If you look inside it you'll find that TitleScreenCounter and ScratchRAM have the same value of 0088. The symbol file is sorted alphabetically, so Stella most likely used the first one it found for the value in question. 1 Quote Link to comment Share on other sites More sharing options...
+stephena Posted January 18, 2018 Share Posted January 18, 2018 This will change in a future version of Stella, where we hope to have source-level debugging (so you see exactly what is in your ASM file). 2 Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted January 19, 2018 Author Share Posted January 19, 2018 Thanks.. I'm glad I asked. I was thinking it was a compile issue. Looking at GameStateHi and GameStateLow,some of values were put in with commas and the $F06E and $F072 are actually the GameStateHi and GameStateLo values again. Same issue I guess. It looks like the op codes at least still line up though though I guess you have to focus more on them when troubleshooting. Quote Link to comment Share on other sites More sharing options...
DirtyHairy Posted January 19, 2018 Share Posted January 19, 2018 Actually, I can't see any issue at all. What Stella shows you is not the source, but a formally correct disassembly. The only reason why you get symbols from your source is that Stella reads in the symbol definitions generated by DASM, but the banking messes up the mapping. The disassembly itself is fully correct. Quote Link to comment Share on other sites More sharing options...
+stephena Posted January 19, 2018 Share Posted January 19, 2018 DirtyHairy is correct in that the disassembly is fully correct. But what I was referring to is that we will eventually add source-level debugging (https://github.com/stella-emu/stella/issues/237). Basically, if we already have the source file, lst file and sym file, we may as well use that fully, and not use the built-in disassembler at all. This is what we hope to add eventually. 1 Quote Link to comment Share on other sites More sharing options...
ZackAttack Posted January 19, 2018 Share Posted January 19, 2018 DirtyHairy is correct in that the disassembly is fully correct. But what I was referring to is that we will eventually add source-level debugging (https://github.com/stella-emu/stella/issues/237). Basically, if we already have the source file, lst file and sym file, we may as well use that fully, and not use the built-in disassembler at all. This is what we hope to add eventually. Until then it would be nice if stella at least handled variables that are larger than a single byte. Rather than ram_85 it should display the closest symbol prior to that location and an offset, Game_JumpInd+1. 1 Quote Link to comment Share on other sites More sharing options...
+stephena Posted January 19, 2018 Share Posted January 19, 2018 This work is inter-related. Once we start working on one, we will fix the issues in the other. EDIT: If it is a serious problem you're seeing, create an issue for it https://github.com/stella-emu/stella. 1 Quote Link to comment Share on other sites More sharing options...
DirtyHairy Posted January 19, 2018 Share Posted January 19, 2018 This work is inter-related. Once we start working on one, we will fix the issues in the other. EDIT: If it is a serious problem you're seeing, create an issue for it https://github.com/stella-emu/stella. Or, even better, contribute and do a pull request 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.