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
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
"LARGE" does not make sense, "ROM LARGE" might. And he does post "memory model" The 932 has about the same amount of RAM and XRAM, thus memory model LARGE does not make sense. Erik
""LARGE" does not make sense, "ROM LARGE" might. And he does post "memory model"" Yes, and then he posted: "Problem solved. My bad, confusing memory model with code size. Thanks" Please read the thread carefully from the beginning.
OH, missed that.
Sorry for all the confusion. I was setting memory model to large in order to use more than 2K of ROM. However, this affects the ram size as well and tries to use non-existent ram (external ram). So the program would work on the emulator and not when I burned a chip. I guess the emulator has the external RAM. Instead I need to set the ROM size to either compact or large and leave memory model as small. I realy appreciate everyone's help. -sam