+Propane13 Posted December 27, 2022 Share Posted December 27, 2022 Hi folks, For any project I've ever worked on (which at this point is 1-2 decades ago), I used DASM and had one giant assembly source file that would eventually be compiled into a binary. As I'm now much older and realize I can't really read and understand any of my former code too well, I was curious what strategies I could use in the future to possibly segment sections of code into different files, and then somehow use some definitions to stitch things together in a smart way. To make the discussion easier, let's make these 2 assumptions: We can ignore any page boundary issues for now We can ignore bank-switching-- let's just say for this example, it's a 4K contiguous game I could easily see logical section-breaks for my code: MainLoop GameLogic1 Kernel1 MusicLoop MusicData Housekeeping But, it's tricky and I think I'm missing a concept somewhere. Let's take the Music Stuff as an example. If it is accessed via a "JSR PlayMusic" command from the MainLoop, then MainLoop needs to be aware of the PlayMusic's defined address. Similarly, MusicLoop requires access to Lookup tables in MusicData, so it must be aware of those addresses as well. I can clump MusicData and MusicLoop together, but then with that philosophy, I'm just going to end up right back at a monolith file. It feels like I need to somehow divide my compile phase and create a separate link phase, but I'm not sure how to do that. What have others done that has been successful? Quote Link to comment Share on other sites More sharing options...
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.