I have a program which works fine in small memory model. The program is growing beyond the 2K boundary and I want to switch to the Large model. When I switch to large model, the program stops working. I also tried it with a working code which is less than 2K. The only thing I do is set the memory model to large 64K code. Am I supposed to do anyting else? Thanks. -sam
I forgot to mention that it works with the epm900 emulator, but once I burn a part (philips lpc932) using the mcb900, the part does not work. Thanks -sam
You don't need to change the memory model as all this affects is the default memory space used for variables. Generally speaking you should always use the small model. You do need to change the 'code ROM size', however. I suspect the reason your code no longer works is because you have changed the memory model and your variables are now being located in non-existent external RAM.
if you are using the eval version, you may get in trouble since the eval is limited in code size and location. Also using the LARGE model with a derivatives as small as the LPC does not make sense, why are you even attempting it? Erik
My code is larger than 2K. It is going to be close to 4K. The eval is supposed to be good up to 4K. What are my options? Thanks.
Thanks Steffen, I will try this. I thought that if the code is larger than 2K, I can not use small model.
Or leave the model as small an break it up into 2 or more C modules.
"Or leave the model as small an break it up into 2 or more C modules." How would that help?
It is many modules, however, the modules have to call each other and can not cross the 2K boundary as steffan is pointing out.
can not cross the 2K boundary Never heard of that one, I have modules that are >8k. Are you using assembler and AJMP?. Erik
My programs are in C. I thought that if one is using small memory model, the entire code has to fit within a 2K code segment. This is so that the jump instructions can use 16 bit instructions. Once the code gets larger than 2K, the linker starts giving errors.
"I thought..." Never mind what you thought - look it up in the Manual and be certain! Note that there are both Code and Data size options to consider. Code Size - SMALL, COMPACT, LARGE, D512K, D16M: http://www.keil.com/support/man/docs/c51/c51_rom.htm Data Size = Memory Model - Small, Compact, Large: http://www.keil.com/support/man/docs/c51/c51_small.htm http://www.keil.com/support/man/docs/c51/c51_compact.htm http://www.keil.com/support/man/docs/c51/c51_large.htm
Problem solved. My bad, confusing memory model with code size. Thanks Andrew, I realy appreciate your help. -saied
My bad, confusing memory model with code size. that, still, does not make sense. How can a 8k LPC932 be "LARGE" Erik
"How can a 8k LPC932 be 'LARGE'" It may not be LARGE, but it is bigger than SMALL and may have functions too big for COMPACT... http://www.keil.com/support/man/docs/c51/c51_rom.htm