CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

compiler operation across ROM pages

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jack11
Guest







compiler operation across ROM pages
PostPosted: Tue Apr 06, 2004 8:44 am     Reply with quote

Is there a method to force the compiler to use all (or most) of a ROM segment? Using 16f877 with PCM 3.169. After compiling, the resulting code has large gaps of unused memory. It appears that the compiler fills a ROM segment to some point and then abandons it and moves to the next ROM segment. I'd like to use the ROM more efficiently.

Any Thoughts

Thanks
Ttelmah
Guest







Re: compiler operation across ROM pages
PostPosted: Tue Apr 06, 2004 10:12 am     Reply with quote

jack11 wrote:
Is there a method to force the compiler to use all (or most) of a ROM segment? Using 16f877 with PCM 3.169. After compiling, the resulting code has large gaps of unused memory. It appears that the compiler fills a ROM segment to some point and then abandons it and moves to the next ROM segment. I'd like to use the ROM more efficiently.

Any Thoughts

Thanks

The answer, is to keep functions small.
Basically, if all the functions in the code are very small, the waste on a page will be tiny. However if when fitting things in, the next function is larger than the remaining space in a page, the compier will immediately jump to the next page to put it into. Then even if the following functions are small again, it'll only go back to the earlier page, if it finds something too large to fit in the new page, and either has to re-organise, and start looking for holes elsewhere.
If you have several smaller functions, that are declared after the first one that jumps into the second page, try declaring them in front of this function instead. This may delay the selection of the second page.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group