Serial Communication 8051
Assume that I'm receiving information through Rx pin continuously. What if I want to transmit information? How can I interrupt receiving while transmitting data because I don't want the data that I put in SBUF register to be replaced by the incoming data.


I understand your confusion. The explanation is quite an elegant design...

From outside the device, we treat the SBUF register as being a single "thing", used for Tx when we write to it, and used for Rx when we read from it. This makes sense, since we don't need to do the opposite (i.e. we don't need to read what we just sent to be transmitted).

However, inside the device, the Tx register and the Rx register are physically different components. That fact is what allows you to transmit while also receiving, without overwriting what is being received.

Long, long ago I remember reading the datasheet on one UART or another, which explained this. I'm not sure I could find it again, but if I do find it (or something similar) I'll add it to the answer.



Update:

From Atmel 8051 Microcontrollers Hardware Manual:


  The serial port receive and transmit registers are both accessed at Special Function Register SBUF. Writing to SBUF loads the transmit register, and reading SBUF accesses a physically second receive register.


[my emphasis in the above quotation]

From the same document, here is a block diagram of the 8051 UART. I have outlined the two places where they show "SBUF" in red, along with text showing which is the physical Tx SBUF register, and which is the physical Rx SBUF register: