#69696 - HyperHacker - Wed Feb 01, 2006 8:48 am
I want to write a 'modular' program for DS. The idea is to be able to just load up a program into any random place in memory, and run it. This means the programs have to be relocatable, and not depend on being placed in a specific part of memory. How can I make such programs using DevkitPro?
Also is there a way to define a specific memory range for certain variables? Normally when you create variables, the compiler starts with the beginning of unused memory and puts them there. (Say your program takes up 0x02000000-0x020000FF, then if you define a byte variable it goes at 0x02000100, then a word variable will go at 0x02000102, etc.) How can I tell it to start putting them in a different part of memory? (Eg create some variables there, then add some statement that says to put the next one at 0x03000000, then 0x03000002, etc.)
Also is there a way to define a specific memory range for certain variables? Normally when you create variables, the compiler starts with the beginning of unused memory and puts them there. (Say your program takes up 0x02000000-0x020000FF, then if you define a byte variable it goes at 0x02000100, then a word variable will go at 0x02000102, etc.) How can I tell it to start putting them in a different part of memory? (Eg create some variables there, then add some statement that says to put the next one at 0x03000000, then 0x03000002, etc.)