I defined a array like this: uchar *tuning_order[160]={}; or const uchar *tuning_order[160]={}; but Keil said: error C249: 'DATA': SEGMENT TOO LARGE I do not konw why?I use the AT89S51.
tuning_order[160]={}; or const uchar *tuning_order[160]={}; but Keil said: error C249: 'DATA': SEGMENT TOO LARGE time for some "bible study", the '51 is not a PC here are the links to "the bible" Chapter 1 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf chapter 2 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf chapter 3 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf Erik
uchar *tuning_order[160]={}? that would be 160 char pointers stored in the default memory space (256 bytes of RAM) uchar tuning_order[160]= {}; would be an an array. uchar code tuning_order[160]= {}; would be an an array in ROM. If you really want uchar *tuning_order[160]={} then you need code two times 1. to tell the compiler where to put the pointers. And, one to tell the compiler what kind of memeroy the pointers are pointing to. Read this part of the manual carefully. It will save much memory space.
You need to read the section of the C51 Manual that describes the language extensions added by Keil to support the 8051's various memory areas: http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm If you don't already understand the various memory areas in the 8051 architecture, you will also need to read the "bible" documents cited by Erik.
Thank you.I will read the "bible" documents carefully. I just want to put my array in ROM. I defined a array two different ways. 1. code uchar *tuning_order[160]={}; 2. uchar code *tuning_order[160]={}; First one compled successful. But the second one was the same problem(Keil said: error C249: 'DATA': SEGMENT TOO LARGE) I do not know what is the differences between the two ways.
I do not know what is the differences between the two ways. The manual clearly states which to use. I know it is a bother to read it, but, unfortunately, that is the name of the game. Erik
"I know it is a bother to read it, but, unfortunately, that is the name of the game." The relevant part of the Manual is: http://www.keil.com/support/man/docs/c51/c51_le_memspecificptrs.htm (You will need to have read the previous section that I mentioned, too). "I will read the 'bible' documents carefully." In order to understand why Keil has "Memory-Specific Pointers" and special keywords to specify the memory areas for variables, you will probably need to read the so-called 'bible' documents first. The memory areas are described right at the start of Chapter 1 You would probably also benefit from this tutorial: http://www.8052.com/tut8051.phtml (again, the memory areas are described in Chapter 1)