<meta name="keywords" content="必胜时时彩开户,keywords" /> 7s数码管电子钟汇编法式模范 联系我们

7s数码管电子钟汇编法式模范模范

                                          ONE EQU 30H
 TWO EQU 31H
 THR EQU 32H
 FOU EQU 33H

 ORG 0000H 
 LJMP START
 ORG 000BH
 LJMP INT_T0


  START: SETB ET0
     SETB EA

 MOV TMOD,#01H
 MOV TH0,#3CH
 MOV TL0,#0B0H;50ms初值
 SETB TR0

 MOV R5,#00H
 MOV DPTR,#TAB

 LOOP:   CLR P1.0
         SETB P1.3
 MOV A,ONE
 MOVC A,@A+DPTR
 MOV P2,A
 LJMP DY

 CLR P1.3
 SETB P1.2
 MOV A,TWO
 MOVC A,@A+DPTR
 MOV P2,A
 LJMP DY

CLR P1.2
SETB P1.1
MOV A,THR
MOVC A,@A+DPTR
MOV P2,A
LJMP DY

CLR P1.1
SETB P1.0
MOV A,FOU
MOVC A,@A+DPTR
MOV P2,A
LJMP DY
LJMP LOOP

DY:  MOV R3,#200
D1:  MOV R4,#100
    DJNZ R4,$
DJNZ R3,D1
RET
 
 INT_T0:MOV TH0,#3CH
MOV TL0,#0B0H
INC R5
CJNE R5,#20,EXIT
MOV R5,#00H
INC ONE
MOV A,ONE
CJNE A,#10,EXIT
MOV ONE,#00H
INC TWO
MOV A,TWO
CJNE A,#6,EXIT
MOV TWO,#00H
INC THR
MOV A,THR
CJNE A,#10,EXIT
MOV THR,#00H
INC FOU
MOV A,FOU 
CJNE A,#3,EXIT
MOV FOU,#00H

EXIT:RETI


 TAB:   DB 01H,4FH,12H,06H,4CH
        DB 24H,20H,0FH,00H,04H
        END