Sorry for the newb questions, but I can't find the answers in either the UV2 or C51 manuals. 1) When UV2 gives the Program Data Size after building a project, is this JUST data (first 128 bytes), or is idata included in this total as well? I think it is all 256 bytes, but wanted to make sure. 2) If all internal data memory is exceeded, is the data simply truncated there or is it moved to xdata or something else? 3) I understand that access to xdata is slower than for internal RAM, but is it possible to put a quantification on "slower"? I realize this is likely micro dependent, but a ballpark would be fine. I'm using the T89C51CC01 from Atmel if anyone knows the exact value for that micro. Could not find this either in the CC01 manual.
"I understand that access to xdata is slower than for internal RAM, but is it possible to put a quantification on "slower"?" The problem isn't so much the sheer speed of the bus cycle as with an architectural limitation of the 8051. To access xdata, you have to load the DPTR register and use special MOVX instructions to move to or from the accumulator. Reading or writing a byte of xdata requires several instructions. And of course, you might have wanted that one-and-only DPTR for something else, which means to do the xdata access, you have to spill some register contents somewhere else. So, it's hard to pin down exactly how much slower the access will be, since it depends a lot on the code.
Absolutely - using XDATA will not just give somewhat slower memory accesses, but also significantly larger code. In a large application, I once saved several K of code space by simply moving one very frequently used variable from XDATA to DATA...