经过试验的!
ORG 4000H
AJMP START
ORG 401BH
AJMP INQP
ORG 4100H
START:MOV TMOD,#10H
MOV SCON,#50H
MOV PCON,#00H
MOV TH1,#0FFH
MOV TL1,#0F9H
SETB TR1
SETB ET1
SETB EA
MOV R0,#30H
SE1:JBC RI,SE2
AJMP SE1
SE2:MOV A,SBUF
MOV P1,A
INC A
MOV SBUF,A
SE3:JBC TI,SE4
AJMP SE3
SE4:LJMP SE1
INQP:MOV TH1,#0FFH
MOV TL1,#0F9H
RETI
END
ORG 4000H
AJMP START
ORG 401BH
AJMP INQP
ORG 4100H
START:MOV TMOD,#10H
MOV SCON,#50H
MOV PCON,#00H
MOV TH1,#0FFH
MOV TL1,#0F9H
MOV R1,#10H
SETB TR1
SETB EA
SETB ET1
MOV R3,#00H
SE1:MOV A,R3
MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV SBUF,A
SE2:JBC TI,SE3
AJMP SE2
SE3:JBC RI,SE4
AJMP SE3
SE4:MOV A,SBUF
MOV P1,A
ACALL DIS
INC R3
DJNZ R1,SE1
AJMP $
TAB:DB 3FH,0FDH,0FBH,0F7H,0FFH,0DFH,0BFH,7FH
DB 7EH,7DH,7BH,77H,6FH,5FH,3FH,35H
INQP:MOV TH1,#0FFH
MOV TL1,#0F9H
RETI
DIS:MOV R4,#05H
L1:MOV R5,#0C8H
L2:MOV R6,#0FFH
L3:DJNZ R6,L3
DJNZ R5,L2
DJNZ R4,L1
RET
END
文章评论(0条评论)
登录后参与讨论