TIM EQU 30H
CNTA EQU 31H
CNTB EQU 32H
ORG 00H
LJMP START
ORG 0BH
LJMP T0X
ORG 0100H
START: MOV TIM,#00H
MOV CNTA,#00H
MOV CNTB,#00H
MOV TMOD,#01H
MOV TH0,#253
MOV TL0,#96
SETB TR0
SETB ET0
SETB EA
SJMP $
T0X: MOV TH0,#251
MOV TL0, #50
MOV A,CNTA
MOV P1,A
MOV DPTR,#DIGIT
MOV A,CNTB
MOV B,#16
MUL AB
ADD A,CNTA
MOV 33H,A
MOVC A,@A+DPTR
MOV P0,A
MOV A,33H
M0: MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P2,A
INC CNTA
MOV A,CNTA
CJNE A,#16, NEX
MOV CNTA,#00H
NEXT: INC TIM
MOV A,TIM
CJNE A,#10,NEX
MOV TIM , #00H
INC CNTB
MOV A,CNTB
CJNE A,#3,NEX
MOV CNTB,#00H
NEX: RETI
DIGIT: DB 1EH,64H,88H,10H,20H,60H,70H,78H
DB 7CH,0FEH,60H,90H,0B0H,90H,60H,40H
DB 00H,00H,00H,00H,80H,80H,40H,40H
DB 0C0H,40H,60H,90H,0B0H,90H,60H,40H
DB 00H,00H,00H,00H,00H,00H,80H,0C0H
DB 0C0H,0C0H,60H,90H,0B0H,90H,60H,40H
TAB: DB 40H,60H,60H,31H,2AH,24H,14H,14H
DB 12H,09H,04H,02H,01H,00H,00H,00H
DB 44H,66H,67H,37H,2FH,24H,12H,11H
DB 10H,08H,04H,02H,01H,00H,00H,00H
DB 40H,60H,60H,30H,28H,2FH,1FH,3FH
DB 7FH,0FFH,04H,06H,09H,11H,3EH,00H
END
|