Who can tell me the main usage of "using x" in interrupt service?
There will be no conflict since neither the array nor the index are in registers. They are outside function scope and thus have static duration. You will however need to tell the C compiler that the variables may change without notice (that is, the background function will see the values change magically after the serial ISR occurs). Use volatile for this. Be sure to type every variable with data, idata, xdata, code, etc. That way you don't get any surprises if you change memory models. Try to use the SMALL model always.
#define SER_BUF_SIZE 64 volatile char xdata s_serBuf[SER_BUF_SIZE]; volatile char data bufIdx; void main(void) { while (strchr(s_serBuf, 'E')); ... } void isrUart(void) interrupt UART_VEC using 1 { if (RI) { RI = 0; s_serBuf[serIdx] = SBUF; serIdx = (serIdx + 1) % sizeof s_serBuf; } }