Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/12/07 05:42
Read: times


 
#148086 - I would fall back to assy here
Responding to: ???'s previous message
Unfortunately the linker has a bad habit of relocating code (this was a joke ... hopefully) and therefore there is no explicit guarantee that objects residing in the same segment always go to predefined places. It all depends....

However, the linker usually does not rearrange objects inside a given segment after these have first loaded. They usually stay in their original load order.

This means that the strings who were destined to code memory appear in the final relocated code in the same order as they were loaded.

So, create a C module with this string or whatever and then put it as the first object to be linked. There will ofcourse be POR and other initialization code before it but if the compiler and linker work as those normally do the string should be the first one in the loooong list of other strings in the code memory.

That all is true only if the complier either behaves as they usually do or if there is a way to control this (and You know what You are doing). For example in some compilers it is possible to rename segments and then give the linker the place for that segment.

But please, think this over: It just is not worth the hassle which You could VERY easily bypass just by a few, lousy assembler lines. IMHO it is way easier to learn THAT much of assembler than go through all this segmentation stuff...

List of 11 messages in thread
TopicAuthorDate
How to initialize Absolute variables in code mem?            01/01/70 00:00      
   The answer is here            01/01/70 00:00      
      Answer explained:            01/01/70 00:00      
         this is something Keil should implement            01/01/70 00:00      
            why do you need this?            01/01/70 00:00      
               Example            01/01/70 00:00      
                  OK, I accept            01/01/70 00:00      
   Why?            01/01/70 00:00      
   I would fall back to assy here            01/01/70 00:00      
      Not exactly true            01/01/70 00:00      
         Linker segments            01/01/70 00:00      

Back to Subject List