I read in the manual that the stack cannot be located off-chip in XDATA. Can someone please confirm this? I was wondering what would happen if I modify the STARTUP.A51 to place the stack pointer in XDATA (don't want to try yet!). I was using Sandeep Dutta's freeware C compiler which did allow the stack in xdata, and was wondering why Keil does not allow it. I have a large program in a FLASH chip, and very little precious iDATA space left despite my best efforts, and now the program is going off in the weeds whenever I add routines, and I am 90% sure it is a stack space problem. Speed is not an issue. Thanks!
http://www-us2.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf page 2. "stack" in XRAM can only be a synthetic stack(software implemented LIFO). Many compilers can implement such a "stack", but it does slow things down some. A well thought out design and a good compiler usually makes the stack space sufficient. The trick is to think "how often, how time critical" every time a variable is placed in a given data area. Have fun, Erik