We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hai, what are the ways to reduse code.
See "Getting the Least Out of Your C Compiler" Class #508, Embedded Systems Conference San Francisco 2001 Jakob Engblom, IAR Systems user.it.uu.se/.../engblom-esc-sf-2001.pdf
And, of course, read your compiler Manual for specific advice.
For optimum code, you will also need to understand the underlying processor architecture - see the ARM Manuals http://www.arm.com
and remember: "Optimum" means different things in different contexts; eg, one application might require minimum code size (possibly at the cost of execution speed); another application might require maximum execution speed (possibly at the cost of code size); another might be concerned with minimum data size, etc, etc,...
i am facing a problem regarding code size. I am using the ARM RealView Development Tool together with Keil µVision working on STR912FW42 Microcontroller. i have follows according to manual instructions like use thum mode, increase optimization level etc. my code size is gradually increases even though it is a small program. when i deleting some variables from the code, size will reduses. all variables are stored in RAM, i think it should not effect the code size. but why it behaves like that. pleasse help me how to reduse the code size.
"my code size is gradually increases"
Of course, as you write more code the code size will obviously increase!
"even though it is a small program"
That's a prety meaningless statement! What do you mean by "small"?
Are you using lots of large libraries - like printf and/or floating point?
"when i deleting some variables from the code, size will reduses. all variables are stored in RAM, i think it should not effect the code size. but why it behaves like that."
Well, if you don't have the variables, you presumably also remove any code that would use them - and that will obviously reduce the code size!
Were the variables initialised? That takes code.
"pleasse help me how to reduse the code size."
Have you read the article yet?
user.it.uu.se/.../engblom-esc-sf-2001.pdf
Note : The size shown by the uV compiler during compilation at bottom (Specifically if you are using the limited free version !) in output window includes all the ROM code + ZIdata + RW data . So even the RAM is included in this size.
If using the free version the limited 16K include all type of data
Suvidh
hi, Andy Neil and Suvidh, Thanks for u'r reply. regards raj.