I use uVision2, and am moving from 87C51 to 87C51RA2 . . . going from 128B of RAM to 512B RAM. Was having trouble with lack of RAM in the C51 due to a large number of variables. From what I understand, in order to utilize some of the upper 128B of RAM it seems that I want to stay with the Small Memory Model, and explicitly define some variables (which are not in speed sensitive areas of the program) as IDATA type. True ??? If I'm on track so far, is it also true that I can only specify those variables that are indirectly addressed throughout the program? Played around with it, and if I define a variable as IDATA type, it will compile, even though that variable is directly addressed (from my understanding of direct vs. inderect addressing). So I'm not sure if the compiler is smarter than me and it WILL work, or if it is not smart enough that it checks for such things? Any suggestions as to where to get definitive info re direct vs. indirect addressing. Seems obvious at first, but on closer scrutiny, is not so clear. Haven't found a clear definition in any manuals. About 763 more questions come to mind, but will spare you for now . . . Thanks Scott Kelley
"True ???" Yes! "is it also true that I can only specify those variables that are indirectly addressed throughout the program" Don't worry about direct/indirect addressing. The compiler does all the work for you, just go ahead and declare IDATA variables and use them exactly as you would DATA variables. Bear in mind (as you have already realised) that access to them will be somewhat slower than DATA variables. Stefan
I use uVision2, and am moving from 87C51 to 87C51RA2 . . . going from 128B of RAM to 512B RAM. Do not confuse IDATA and EDATA Idata is the traditional '52 internal RAM, EDATA is "external RAM moved onto the chip" The RA2 has 256 bytes of '52 type memory, the first 128 or less being DATA, the remainder being IDATA. PLUS 256 bytes of EDATA. Was having trouble with lack of RAM in the C51 due to a large number of variables. From what I understand, in order to utilize some of the upper 128B of RAM it seems that I want to stay with the Small Memory Model, and explicitly define some variables (which are not in speed sensitive areas of the program) as IDATA type. True ??? yes If I'm on track so far, is it also true that I can only specify those variables that are indirectly addressed throughout the program? As far as C: the above should read "defined as IDATA. As far as assembler: yes. if I define a variable as IDATA type, it will compile, even though that variable is directly addressed (from my understanding of direct vs. inderect addressing anything below 128 is directly addressable regardless if how it is defined. Any suggestions as to where to get definitive info re direct vs. indirect addressing. in the <a href="" target="_blank">http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf">ch3 of the '51 "bible"</a> Erik
Refer to the following knowledgebase articles for more information: http://www.keil.com/support/docs/302.htm http://www.keil.com/support/docs/1978.htm Jon