Hey i have written a code. In that i am getting error of AUTO SEGMENT TOO LARGE....so wat does it mean.... i didnt understand meaning of term from the definition given at your site....
So pls tell me wat doess it mean... n how 2 remove this error... Pls rply soon....
"The required space for local objects exceeds the model dependent maximum"
http://www.keil.com/support/man/docs/c51/c51_c241.htm
You know what "local" objects (ie, local variables) are in the 'C' programming language, don't you? If not, that is basic 'C' textbook stuff - nothing specifically to do with Keil.
Model refers to the Memory Model - see: http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm
"The maximum segment sizes are defined as follows: SMALL 128 bytes COMPACT 256 bytes LARGE 65535 bytes" - seems clear enough to me?
Also known as "Automatic" objects.
publications.gbdirect.co.uk/.../terminology.html
publications.gbdirect.co.uk/.../declarations_and_definitions.html
hey thanks for guiding me but i am still getting same error.... i have change my function call as large....
now how to change variables i.e array, char, integers etc. to get access to large data memory....
my hex file is becoming approx. size of 7kb to 8kb....
pls help me as soon as possible....
i am using 10 to 12 arrays of 32 characters in my main program... is that be the reason for this error???
Hmmm.... you've left it over a day to come back with anything on this - so what's the rush??!
"i have change my function call as large"
The Memory Model is not a property of a function call - what do you mean by this? What, exactly, did you do?
"i am still getting same error"
Memory sizes are finite - so there will always come a point where your stuff will become "too big".
You haven't said what specific chip you are using, so nobody - apart from you - knows how much memory you have available!
"how to change variables i.e array, char, integers etc. to get access to large data memory"
Please read the manual!
"i am using 10 to 12 arrays of 32 characters in my main program... is that be the reason for this error???"
How do you expect anyone to answer that? Again, you haven't said what specific chip you are using - so nobody else knows how much memory you have available!
You can see what is using memory, and how much, by looking at the Linker Listing file - also known as the Map file.
http://www.keil.com/support/man/docs/uv4/uv4_dg_adslst.htm
hay i am using 89v51rd2...
i mean to say that i have called atleast 8 to 9 functions in my program... my program is of atm machine with i2c...
Should i upload my whole program here 4 your watch????
You mean P89v51rd2 - ie, this: http://www.keil.com/dd/chip/3711.htm ?
So you have a total of 1K of RAM - 256 bytes of DATA/IDATA, plus 768 bytes of XDATA (called "Expanded" RAM in the datasheet)
See Fig 5 on page 17 of the datasheet: http://www.keil.com/dd/docs/datashts/philips/p89v51rd2.pdf
Have you now understood what automatic variables are in the 'C' programming language?
You should, by now, have studied the stuff in the C51 manuals about memory areas - so you should be able to work out where you are exceeding the available memory.
Again, the Linker Listing file - or "Map" file - will help you here. Have you studied it?
The Compiler Listing files also summarise memory usage for each source file...
i understood abt variables od data,idata n xdata n all also i hav understood memory models...i.e large,compact n all.. i didnt got automatic variable in c...
plus u mean 2 say that i can specify my some variable as xdata 2 access extendet ram???
and this extended ram is same as na dat of 256byte ram...as i can modify data of variablee during program na???
plus i dint understand about map file...
"i didnt got automatic variable in c"
As previously noted, that is standard textbook stuff - nothing specifically to do with the 8051 or Keil. Time to go back and study your 'C' textbook...
"plus u mean 2 say that i can specify my some variable as xdata 2 access extendet ram???"
Yes - exactly as the C51 Manuals tell you!
"this extended ram is same as na dat of 256byte ram"
Please use proper words - I have no idea what you are saying there!
"i dint understand about map file"
Did you follow the links that I gave you?
http://www.keil.com/support/man/docs/bl51/bl51_ln_mapfile.htm http://www.keil.com/support/man/docs/bl51/bl51_print.htm
http://www.keil.com/support/man/docs/lx51/lx51_ln_mapfile.htm http://www.keil.com/support/man/docs/lx51/lx51_print.htm
hey i am having doubt that in xdata format i have to use indirect adressing...and in also mapping of memory we have 2 use specific range of adresses for particular data types...
But in C we are not using ANY PHYSICAL addressing...so will keil automatically converts xdata instruction as pointer???
ex. if i have written like this.. a=b;
where a=unsigned char and b=unsigned char xdata
so xdata will b automatically converted as pointer before moving content between internal ram and extended ram....
and be sure to follow the "Related Knowledgebase Articles" links at the bottom of each manual page...
The Keil-specific keyword extensions tell the compiler what machine instructions to use to access the various memory spaces - see: http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm
data d_var; // Will be accessed using direct MOV instructions idata i_var; // Will be accessed using indirect MOV instructions xdata x_var; // Will be accessed using indirect MOVX @DPTR instructions
etc...
The Memory Model defines the default memory space that will be used if you do not explicitly define a memory space: http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm
For further details of the various memory areas (or memory spaces; or address spaces) see: http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm
You should also be familiar with the so-called "bible" for the 8051 - links here: www.8052.com/.../120112
8051 Architecture Tutorials here: http://www.8052.com/tutorial
Books about programming in general, and 8051 programming in particular, here: http://www.keil.com/books/
thank u so much... i am trying 2 learn myself... if i will get any problem i will let u know....
... that you did not work (not read) through the "getting started guide" before venturing upon this.
Erik
It is not listed here:
http://www.keil.com/support/man_c51.htm
The ARM toolset has a "Primer": http://www.keil.com/support/man_arm.htm - but there is no longer any corresponding introductory guide for the C51 tools.
:-(
Is this ARM turning the screw on the 8051 tools...?
Anyhow, the "Getting Started" Guide only covered the Keil tools - it assumed that the reader was already familiar with the 8051 architecture and the 'C' programming language.