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 13:18
Read: times


 
#128350 - like that snippet?
Responding to: ???'s previous message
> It looks from your snippet like the linker does output symbols for the beginning and end of each segment.

No only beginning and length of each segment.

> So, the next question is: can you create your own segments

You can. Although currently not without falling back to inline assembly. Feature request #1600296 which was filed very shortly before your post is related.

-dummy.c-------8<--------------------
void dummy_eo_xdata(void) __naked
{
  __asm
        .area XSEG_DUMMY    (XDATA)
        _eo_xdata::        ; nothing alloc'd!
  __endasm;
}


-main.c-------8<----------------------
extern unsigned char xdata eo_xdata; /* or void or an array[0] */

unsigned char xdata another_var[0x234];

void main (void)
{
   volatile unsigned int t = (unsigned int)&eo_xdata;
}

then on the command line:
sdcc -c dummy.c
sdcc -c main.c
sdcc main.rel dummy.rel

gives (file main.rst) :

                         128 ;       main.c:6: volatile unsigned int t = (unsigned int)&eo_xdata;
                         129 ;       genCast
0062 75 08 34            130         mov     _main_t_1_1,#_eo_xdata
0065 75 09 02            131         mov     (_main_t_1_1 + 1),#(_eo_xdata >> 8)


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