I like to know how to read external memory using xdata .I've tried like this
unsigned char xdata *PORTA=0X8000; unsigned char xdata *CW=0X8003; unsigned char val2, val3; val2=0X80; CR=&val2; val3=0X50; PORTA=&val3;
You seem to be confused about the basic 'C' concepts of pointers - look up the dereference operator '*' and the address-of operator '&' in a 'C' textbook.
unsigned char xdata *PORTA=0X8000;
PORTA=&val3;