|
|
View previous topic :: View next topic |
Author |
Message |
jack11 Guest
|
compiler operation across ROM pages |
Posted: Tue Apr 06, 2004 8:44 am |
|
|
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 |
Posted: Tue Apr 06, 2004 10:12 am |
|
|
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 |
|
|
|
|
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
|