INTSP:
MOV TMOD,#21H
MOV TH1,#0FDH
INSP5:
MOV SCON,#50H
INSP7:
MOV IE,#0B1H
MOV IP,#10H
SETB TR1
MOV 1AH,#60H
MOV 1BH,#0
MOV 1CH,#70H
MOV 1DH,#0
RET
SPSEV:
PUSH ACC
PUSH B
PUSH PSW
PUSH DPH
PUSH DPL
SETB RS1
CLR RS0
JNB TI,RCV
CLR TI
JBC 64H,SPS10
SPSV1:
MOV DPH,1CH
MOV DPL,1DH
MOVX A,@DPTR
INC DPTR
MOV 1CH,DPH
MOV 1DH,DPL
SPSV2:
CJNE A,#0AH,SPS11
SETB 64H
SPS11:
MOV C,P
MOV ACC.7,C
MOV SBUF,A
SJMP SPCOM
SPS10:
MOV 61H,#40H
SJMP SPCOM
RCV:
CLR R1
RECV:
MOV A,SBUF
JB P,X25
CLR ACC.7
SJMP X26
X25:
MOV A,#23H
X26:
MOV DPH,1AH
MOV DPL,1BH
MOVX @DPTR,A
INC DPTR
MOV 1AH,DPH
MOV 1BH,DPL
SPCOM:
POP DPL
POP DPH
POP PSW
POP B
POP ACC
RET