gorgh Posted August 15, 2019 Share Posted August 15, 2019 Hi folks, I've got a question. As I understand setting "opt f+h-" in mads assembler makes binary file without headers (orgs). Is this right? My next question is how to prevent different "orgs" set to the same value to be overridden by each other? thanks Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted August 15, 2019 Share Posted August 15, 2019 MADS tend to take care of that for you as it tends to force you to work in continually ascending order. This can become a bit of a pain when you are using multiple banks and want to include blocks that you want relocate to RAM. A way around that though is to compile those first to individual binary files and then 'ins' those in a final source that builds the rom file. Quote Link to comment Share on other sites More sharing options...
gorgh Posted August 15, 2019 Author Share Posted August 15, 2019 but how do I know in which bank my code will be put? if "orgs" are ignored it means that all the code and data is put one after another... at least I understand it that way, I'm really confused when it comes to this topic Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted August 15, 2019 Share Posted August 15, 2019 MADS team will be better place to guide as most things I try tend to be a fudge as I'm more familiar doing carts with CC65. The issue arise from wanting to compile multiple blocks to the same area, but MADS will error for different reasons depending on which way you try to get around it. An example would be an XEGS cart where there is a fixed 8K bank at $A000 and a selectable 8K bank at $8000. Maybe take a look at how phaeron approaches it in the Altirra Extended Basic sources on this thread. If your dependencies are such, you can build a section and export it's labels & addresses mads my_data.asm -l:my_data.lst -o:my_data.bin -c -hm:my_data.inc You can then include just the 'inc' file with the next section's sources to resolve those labels and do this across a number of individual blocks. Then the final source then brings this all together in one binary: mads -l:final.lst -final.lbl -o:final.rom my_rom.asm e.g. with my_rom.asm being along the lines of: OPT h - OPT f + ORG 0 ins "my_data.bin" ORG $2000 ins "my_code_1.bin" ORG $4000 ins "my_code_2.bin" ORG $6000 ins "my_music.bin" remembering that the final block will contain your Cart Vectors, e.g. ORG $BFF9 CartInit: RTS .WORD CartRun .BYTE 0 ; .BYTE 4 ; .WORD CartInit Quote Link to comment Share on other sites More sharing options...
gorgh Posted August 15, 2019 Author Share Posted August 15, 2019 thanks for your insight, I've heard there's some kind of "segmentation" in MADS... Quote Link to comment Share on other sites More sharing options...
+JAC! Posted August 15, 2019 Share Posted August 15, 2019 >My next question is how to prevent different "orgs" set to the same value to be overridden by each other? I assume you refer to banked cartridge type (otherwise you don#t have that case). Before the ORG of new 8/16k you have to disable the FILL mode again with "OPT F-". 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.