We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using AT89C51RE2 AND KEILuvision4. I am trying to use 8k internal xram. Is their any sample code. How to use the internal XRAM of 89c51re2.
Well, it is true to say that the startup file has no effect on where variables are placed - which was the specific question that you quoted.
It does (in some ways)
If startup (or default) does not enable the internal XRAM the xdata is not cleared and initialized variables are initiaslized into thin air.
Erik
"If startup (or default) does not enable the internal XRAM the xdata is not cleared and initialized variables are initiaslized into thin air."
Yes - but that has nothing to do with the placement of the variables into XDATA in the first place.
It is the Compiler that decides (or is told) which memory space (DATA, XDATA, etc) a variable is to go into;
It is the Linker/Locator that decides (or is told) which memory address (within its memory space)to assign to a variable.
None of the above has anything to do with the startup code.
Of course, if the startup code is wrong, runtime accesses to the memory spaces and/or addresses assigned by the compiler & linker are likely to fail.