TWO EQU 31HTHR EQU 32HFOU EQU 33HORG 0000H LJMP STARTORG 000BHLJMP INT_T0START: SETB ET0SETB EAMOV TMOD,#01HMOV TH0,#3CHMOV TL0,#0B0H;50ms初值SETB TR0MOV R5,#00HMOV DPTR,#TABLOOP: CLR P1.0SETB P1.3MOV A,ONEMOVC A,@A+DPTRMOV P2,ALJMP DYCLR P1.3SETB P1.2MOV A,TWOMOVC A,@A+DPTRMOV P2,ALJMP DYCLR P1.2SETB P1.1MOV A,THRMOVC A,@A+DPTRMOV P2,ALJMP DYCLR P1.1SETB P1.0MOV A,FOUMOVC A,@A+DPTRMOV P2,ALJMP DYLJMP LOOPDY: MOV R3,#200D1: MOV R4,#100DJNZ R4,$DJNZ R3,D1RETINT_T0:MOV TH0,#3CHMOV TL0,#0B0HINC R5CJNE R5,#20,EXITMOV R5,#00HINC ONEMOV A,ONECJNE A,#10,EXITMOV ONE,#00HINC TWOMOV A,TWOCJNE A,#6,EXITMOV TWO,#00HINC THRMOV A,THRCJNE A,#10,EXITMOV THR,#00HINC FOUMOV A,FOU CJNE A,#3,EXITMOV FOU,#00HEXIT:RETITAB: DB 01H,4FH,12H,06H,4CHDB 24H,20H,0FH,00H,04HEND
評論