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....
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/uv4/uv4_dg_adslst.htm
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.
but there is no longer any corresponding introductory guide for the C51 tools.
the "getting started guide" was an excellent way to get all the basics down.
so the only way now will be to read rhe manual 47 times.
most documentation have the 'feature' that when you read page 38 you suddenly understand what was on page 5 (of course arbitrary page numbers).
experience (at least mine) show that on second read you get something you did not get the on the first, on the third read ........