ORG 0020H                     ;

START:    MOV A,#0                      ; CLEAR ACCUMULATOR.

          MOV P1,A                      ; SET P1 TO ACC VALUE IE 0. DISPLAYS 00 IN 7448 DISPLY.

          MOV DPTR,#0                   ; LOAD DATA POINTER WITH USER PROGRAM LOCATION.

          MOV SCON,#REN8U               ; 01010000 BIT-4 REC ENABLE BIT-6 8 BIT UART MODE.

          MOV TMOD,#ARTC8               ; 8 BIT AUTO RELOAD TIMER COUNTER MODE TH#1 HOLDS SET.

          MOV TH1,#BRATE                ; SET BAUD RATE OF COMMUNICATION LOAD TIMER 1 HIGH FDH.

          SETB TR1                      ; TIMER 1 RUN CONTROL ON, ON TIMER 1.

          SETB EA                       ; ENABLE ALL INTERRUPT.

          SETB ET1                      ; ENABLE T1 INTERRUPT OF TIMER 1.

LOOPS:    NOP                           ; SMALL DELAY.

          NOP                           ; SMALL DELAY.

          SJMP LOOPS                    ; LOOP HERE TILL TIMER 1 INT.

                                        ;

TIM1P:    NOP                           ; SMALL DELAY.

          JNB RI,TIM1P                  ; IF RI RECIVE INT FLAG NOT SET LOOP BACK TILL INT.

          CLR TR1                       ; IF RI SET DATA HAS BEEN RECD IN SBUF HENCE STOP TIMER.

          CLR RI                        ; ACKNOWLEDGE DATA RECEPTION BY CLR OF RI FLAG.

          MOV A,SBUF                    ; READ DATA RECD IN SBUF TO ACC.

          MOV P1,A                      ; OUTPUT IT TO P1 TO BE DISPLAYED IN HEX FORMAT 7448.

          NOP                           ; SMALL DELAY.

          NOP                           ; SMALL DELAY.

          MOVX @DPTR,A                  ; WRITE INTO DATA POINTER LOCATION IE MYPROG RECD VALUE.

          INC DPTR                      ; INC TO NEXT RAM LOCATION 0001H.....SO ON CONSEC REC.

          SETB TR1                      ; SET TIMER 1 ON.

T1RET:    RETI                          ; RETURN INT.