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.
Incorrect - read the C51 documentation again, carefully.
xdata is simply memory that is addressed using the MOVX instruction - it is irrelevant whether that memory is physically "internal" or "external" to the chip itself. It's a matter of addressing - not physical location.
You also need to carefully study the processor's datasheet to see where the on-chip XDATA memory appears in the XDATA address space, and any other limitations on its use...