Code: org 0 ; Starting from 0 code memory location mov p1, #00 ; All LEDs OFF by default mov tmod, #20h ; Timer 1 mode 2, 8 bit auto relaod for serial communication mov th1, #-3 ; Set the baud rate mov scon, #50h ; configure the UART, mode selection, 8 bit data, one stop bit, no parity, and receiver is enabled setb tr1 ; start timer 1 wait:jnb ri, wait ; receiver interrupt, wait until unles a character from PC is received mov a, sbuf ; once character is received by SBUF register it will be shifted to Register A mov p1, a ; send the received code to port 1 (LEDs) clr ri ; RI receive interrupt which is raised(HIGH) is now cleared so that new data will be sjmp wait end