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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/21/06 21:49
Read: times


 
#128386 - Know no nice solution
Responding to: ???'s previous message
Jan,

I understand what you're asking but know no proper and nice solution. It's kind of what another of our developers created for the stack in idata memory space when he introduced the option --pack-iram (default by now). You want the largest available chunk of unused space and as long as only one object is asking for it it should be possible.

You have one piece of luck: if you do not place segments in xdata yourself the linker will just start filling from the bottom up. I do not know from the top of my head which segment is placed last but it's always the same one. If Frieder says XISEG, that's probably the one. The symbols created for the segments are used during startup for clearing and initializing (e.g. see crtxinit.asm). Unfortunately there is no symbol created by the linker for the end of xdata.

Frieders snippet is a good way to get the value IMHO. Maybe you can even optimize it by letting the assembler/linker do the addition. OTOH the optimization might also fail with cryptic error messages. as8051 is not the best assembler but it's what we use. Try it and you'll know. I recommend to make the return type void xdata * , assign it to a properly typed pointer and use it as such.

Maarten

List of 37 messages in thread
TopicAuthorDate
(SDCC): How to point to end of used memory?            01/01/70 00:00      
   Make a dummy variable ???            01/01/70 00:00      
      A Better Idea            01/01/70 00:00      
         Good Point            01/01/70 00:00      
            A good point indeed...            01/01/70 00:00      
   SDCC options            01/01/70 00:00      
      this is still my fixation to asm....            01/01/70 00:00      
         Try this snippet?            01/01/70 00:00      
            Thanks!            01/01/70 00:00      
            Another bad idea?            01/01/70 00:00      
               it seems that this is hardwired in SDCC...            01/01/70 00:00      
                  More guessing            01/01/70 00:00      
               like that snippet?            01/01/70 00:00      
                  Yes!            01/01/70 00:00      
                  nice...            01/01/70 00:00      
   you do not want a 'heap' in '51 C, however            01/01/70 00:00      
      passing a #define to assembler within SDCC            01/01/70 00:00      
         NO, no, no            01/01/70 00:00      
            inline assembly versus separate assembly file            01/01/70 00:00      
               separate file is nicer            01/01/70 00:00      
                  good place to start, bad place to stay            01/01/70 00:00      
               that's the crux            01/01/70 00:00      
      Build-time scripts            01/01/70 00:00      
   the question of matter            01/01/70 00:00      
      have as much memory as possible            01/01/70 00:00      
         be sure or not to be?            01/01/70 00:00      
            easy            01/01/70 00:00      
               I'd disagree on this one...            01/01/70 00:00      
         well, you have to mix to get that            01/01/70 00:00      
            Did I miss something?            01/01/70 00:00      
               I thought I posted this            01/01/70 00:00      
                  Thanks            01/01/70 00:00      
            Do you think I would ask answerable questions? :-)            01/01/70 00:00      
               The Right Group?            01/01/70 00:00      
         Know no nice solution            01/01/70 00:00      
            thanks            01/01/70 00:00      
   Maybe compiler/linker settins help?            01/01/70 00:00      

Back to Subject List