Hello. my name is santosh. i need some help in selecting a compiler. i am developing an embedded application which is crossing 64KB code size and i am using AT89C51RE2 microcontroller which is having (will support) 128 Kbytes of on-chip ROM (code memory). My problem is, when i am compiling the code, target is not created i.e. hex file is not generating, becoz my compiler supports maximum 64 KBytes. So, plz suggest me a right compiler which should support uoto 128 Kbytes and also tell me how i obtain from keil.
Thanks and regards, santosh.
I have, most often seen 'application', when talking small embedded, applied to ALL the code.
Getting rid of printf() etc WILL save codespace (in 99% of cases) going 'small' WILL save codespace compared to 'large'. There are more ways than these, but the main point is: "the '51 ain't no PC"
Erik
Of course it will. But, out of a 64K application, it will not save a significant amount of code (less than 2K).
Changing from Large to Small memory model could make a significant difference - as it is liekly to affect a very large number of variable access...
It's probably not the size of printf() that is important - but if the code contains hundreds of printouts - each with 10-50 characters of text.
If I need printouts, I often use tokenized prints, and use a postprocessor that scans the data and expands it into readable messages again. This both saves code space and required bandwidth.
if (s)he is at, say 68k there are many (easy) means, if he is at 120k drastic measures will be needed (and probably not be sufficient, although I have done >50% code reductions)
"each with 10-50 characters of text."
That's where putting the constants into XDATA-mapped ROM really helps...
Yes, u all are right.
i have done these types of optimizations in my code like --- using small memory model, declaring variables with 'xdata', and most important i didn't used even a single 'printf' statement in my code.
santosh.
Declaring variables as xdata makes the code bigger.
So you want variables what are large or used at few locations to be stored in xdata, while the small and popular variables uses the best possible addressing modes.
And you want to make sure that you use bit variables when possible.
before we go on, where are you? can you fit it in 68k, in 72k in 100k ....