0~7通道地址:fef8h~feffh
ORG 000H
LJMP MAIN
ORG 0003H
LJMP I_INT0
ORG 000BH
LJMP I_T0
ORG 050H
MAIN: MOV SP,#60H
SETB IT1
SETB ET0 内容来自单片机之家www.dpj100.com
SETB EX1
SETB EA
MOV TMOD,#00000010B
MOV TH0,#06H
MOV TL0,#06H
MOV R4,#240
MOV R5,#250
MOV R7,#8 内容来自单片机之家www.dpj100.com
MOV R6,#50
MOV R0,#20H
SETB TR0
SJMP $
I_T0: DJNZ R4,GORET
MOV R4,#240
DJNZ R5,GORET 内容来自单片机之家www.dpj100.com
MOV R5,#250
MOV DPTR,#0FEF8H
MOVX @DPTR,A
DEC R7
GORET: RETI
I_INT0: MOVX A,@DPTR
MOV @R0,A
INC DPTR
INC R0
MOVX @DPTR,A
DJNZ R7,GORETI
MOV R7,#8
DJNZ R6,GORETI
CLR TR0
CLR EX1
GORETI:RETI