Hi, I have 2 questions regarding SROM that I couldn't find the answer to.
1) If the compiler adds LCALLs to c lib (?C?..) functions in the code I am copying to the ram are the c lib functions located in this segment as well and are copied to the RAM or are they still called from the flash?
2) Dows the linker know to locate global/local variables that are used from this function in a RAM area that isn't overlapping with the are I'm about to copy the code into or must I locate all variables manually in a non-oberlapping area of of the RAM?
Thank you
"It takes "hardware tricks" to make the '51 execute from RAM."
The 8051 neither knows nor cares about RAM - all it knows is its address spaces - CODE, XDATA, etc.
The LX51 Linker has several features to support various different types of memory (RAM, ROM, etc) being mapped (and, possibly, re-mapped) into the 8051's various address spaces.
This particular LX51 option (SROM) is specifically to support such tricks!
Please read the manual: http://www.keil.com/support/man/docs/lx51/lx51_ls_srom.htm
"The most obvious use for this feature is in-system Flash programming for applications where the code to re-program the Flash is actually stored in Flash. In such applications, these routines must be moved to RAM for execution so that the re-programming process does not corrupt the re-programming code"