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:20
Read: times


 
#128351 - you do not want a 'heap' in '51 C, however
Responding to: ???'s previous message
An another question from the naive C-novice: I'd like to use the rest of unused XRAM as a "heap".
You do not want a 'heap' in '51 C, This is something that, while it may be great on a PC, should be avoided in the '51.
However I have a case where it is to "get as much for this buffer as possible, whatever that is" and (You will love this) I handle that by having all XDATA in an assembler module referred to by C externs. This gives me the ability to have:
StartOfRemainingSpace: ds 0 ; buffer from here to xdata end

another advantage of the "XDATA in asm" is that I can have some buffers often viewed in the emulator on 'easy' boundaries.

This was not originally designed for the above porposes, but the SILabs chips, when you use external XDATA will, in my configuration, run fatser when using internal XDATA and I had to relocate stuff so the fast stuff used the internal XDATA.
YES, before anyone object, I know of the _AT_ command, but 211 _AT_ statements just to avoid having XDATA in an assembler module is ridiculous.

This works GREAT with Keil where you can use C style .h files in assembler allowing you to have
#define RALPH_SIZE
in a .h module
and, in your assembler XDATA you can include the .h and have
RALPH: ds RALPH_SIZE

I do not know to which extent other toolsets support this.

Erik



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