KK1 BIT P1.0 KK2 BIT P1.1 KK3 BIT P1.2 KK4 BIT P1.3 SD EQU 30H HUAY EQU 31H ORG 0000H AJMP MAIN ORG 001BH ;T1ÖD¶Ïèë¿úμØÖ· AJMP CT00 ORG 0030H MAIN: MOV TMOD,#10H ;éèÖÃT11¤×÷Ä£ê½oí1¤×÷·½ê½ MOV TH1,#4CH ;¶¨ê±Æ÷¸33õÖμ MOV TL1,#0B0H MOV IE,#88H ;ÔêDíT1ÖD¶Ïoí′ò¿aÖD¶Ï SETB TR1 ;Æô¶ˉT1¶¨ê±Æ÷¿aê¼¼Æê± MOV SD,#00H MOV HUAY,#00H MOV R2,#00 ;R2¸33õÖμ MOV R3,#20 ;R3¸33õÖμ MOV R4,#16 SJMP $ ;μè′y¶¨ê±ê±¼äμ½ CT00: JB KK1,LP ACALL DEL JB KK1,LP INC SD ACALL XIAN ACALL XIAN1 LP: ACALL SUDU1 JNB KK1,$ JB KK3,LP7 ACALL DEL JB KK3,LP7 INC HUAY ACALL XIAN ACALL XIAN1 LP7: ACALL HUAYA1 JNB KK3,$ JB KK2,LP22 ACALL DEL JB KK2,LP22 DEC SD ACALL XIAN ACALL XIAN1 LP22: ACALL SUDU2 JNB KK2,$ JB KK4,LP23 ACALL DEL JB KK4,LP23 DEC HUAY ACALL XIAN ACALL XIAN1 LP23: ACALL HUAYA2 JNB KK4,$ DJNZ R3,EXT MOV A,R2 MOVC A,@A+DPTR MOV P2,A CLR A INC R2 MOV A,R2 MOVC A,@A+DPTR MOV P0,A CLR A INC R2 MOV R3,#20 DJNZ R4,EXT MOV R2,#00 MOV R4,#16 EXT: RETI HUAYA1: MOV A,HUAY CJNE A,#00,LP8 MOV DPTR,#TAB1 ;±í¸ñμØÖ·¸3¸øÖ¸Õë LP8: CJNE A,#01,LP9 MOV DPTR,#TAB2 LP9: CJNE A,#02,LP10 MOV DPTR,#TAB3 LP10: CJNE A,#03,LP11 MOV DPTR,#TAB4 LP11: CJNE A,#04,LP12 MOV DPTR,#TAB5 LP12: CJNE A,#05,LP13 MOV DPTR,#TAB6 LP13: CJNE A,#06,LP14 MOV DPTR,#TAB7 LP14: CJNE A,#07,LP15 MOV DPTR,#TAB8 LP15: CJNE A,#08,LP16 MOV DPTR,#TAB9 LP16: CJNE A,#09,LP17 MOV DPTR,#TAB10 LP17: CJNE A,#10,LP18 MOV DPTR,#TAB11 LP18: CJNE A,#11,LP19 MOV DPTR,#TAB12 LP19: CJNE A,#12,LP20 MOV DPTR,#TAB13 LP20: CJNE A,#13,LP21 MOV DPTR,#TAB14 LP21: CJNE A,#14,LP50 MOV HUAY,#00 MOV DPTR,#TAB14 LP50: RET HUAYA2: MOV A,HUAY CJNE A,#13,LP31 MOV DPTR,#TAB14 ;±í¸ñμØÖ·¸3¸øÖ¸Õë LP31: CJNE A,#12,LP32 MOV DPTR,#TAB13 LP32: CJNE A,#11,LP33 MOV DPTR,#TAB12 LP33: CJNE A,#10,LP34 MOV DPTR,#TAB11 LP34: CJNE A,#09,LP35 MOV DPTR,#TAB10 LP35: CJNE A,#08,LP36 MOV DPTR,#TAB9 LP36: CJNE A,#07,LP37 MOV DPTR,#TAB8 LP37: CJNE A,#06,LP38 MOV DPTR,#TAB7 LP38: CJNE A,#05,LP39 MOV DPTR,#TAB6 LP39: CJNE A,#04,LP40 MOV DPTR,#TAB5 LP40: CJNE A,#03,LP41 MOV DPTR,#TAB4 LP41: CJNE A,#02,LP42 MOV DPTR,#TAB3 LP42: CJNE A,#01,LP43 MOV DPTR,#TAB2 LP43: CJNE A,#00,LP44 MOV DPTR,#TAB1 LP44: CJNE A,#0FFH,LP49 MOV HUAY,#13 MOV DPTR,#TAB1 LP49: RET SUDU1: MOV A,SD CJNE A,#00,LP1 MOV TH1,#4CH MOV TL1,#0B0H LP1: CJNE A,#01,LP2 MOV TH1,#9EH ;¶¨ê±Æ÷ÖØD¸3Öμ MOV TL1,#58H LP2: CJNE A,#02,LP3 MOV TH1,#0CFH MOV TL1,#2CH LP3: CJNE A,#03,LP4 MOV TH1,#0E2H MOV TL1,#0B4H LP4: CJNE A,#04,LP5 MOV TH1,#0F2H MOV TL1,#54H LP5: CJNE A,#05,LP6 MOV TH1,#0FAH MOV TL1,#24H LP6: CJNE A,#06,LP47 MOV SD,#00 MOV TH1,#0FAH MOV TL1,#24H LP47: RET SUDU2: MOV A,SD CJNE A,#05,LP25 MOV TH1,#0FAH MOV TL1,#024H LP25: CJNE A,#04,LP26 MOV TH1,#0F2H ;¶¨ê±Æ÷ÖØD¸3Öμ MOV TL1,#54H LP26: CJNE A,#03,LP27 MOV TH1,#0E2H MOV TL1,#0B4H LP27: CJNE A,#02,LP28 MOV TH1,#0CFH MOV TL1,#2CH LP28: CJNE A,#01,LP29 MOV TH1,#9EH MOV TL1,#58H LP29: CJNE A,#00,LP30 MOV TH1,#3CH MOV TL1,#0B0H LP30: CJNE A,#0FFH,LP46 MOV SD,#00H MOV TH1,#3CH MOV TL1,#0B0H LP46: RET XIAN: MOV A,SD MOV DPTR,#TAB15 MOVC A,@A+DPTR MOV SBUF,A JNB TI,$ CLR TI ACALL DEL RET XIAN1: MOV A,HUAY MOV DPTR,#TAB15 MOVC A,@A+DPTR MOV SBUF,A JNB TI,$ CLR TI ACALL DEL RET DEL: MOV R7,#04H DL1: MOV R6,#26H DL0: MOV R5,#82H DJNZ R5,$ DJNZ R6,DL0 DJNZ R7,DL1 RET TAB1: DB 0FEH,0FFH,0FDH,0FFH DB 0FBH,0FFH,0F7H,0FFH ;á÷Ë®μÆÏòóò±í DB 0EFH,0FFH,0DFH,0FFH DB 0BFH,0FFH,7FH,0FFH DB 0FFH,0FEH,0FFH,0FDH DB 0FFH,0FBH,0FFH,0F7H DB 0FFH,0EFH,0FFH,0DFH DB 0FFH,0BFH,0FFH,7FH TAB2: DB 0FFH,7FH,0FFH,0BFH DB 0FFH,0DFH,0FFH,0EFH ;á÷Ë®μÆÏò×ó±í DB 0FFH,0F7H,0FFH,0FBH DB 0FFH,0FDH,0FFH,0FEH DB 7FH,0FFH,0BFH,0FFH DB 0DFH,0FFH,0EFH,0FFH DB 0F7H,0FFH,0FBH,0FFH DB 0FDH,0FFH,0FEH,0FFH TAB3: DB 0FEH,0FFH,0FBH,0FFH DB 0EFH,0FFH,0BFH,0FFH ;¼ä¸ôá÷Ë®μÆÏòóò±í DB 0FFH,0FEH,0FFH,0FBH DB 0FFH,0EFH,0FFH,0BFH TAB4: DB 0FFH,7FH,0FFH,0BFH DB 0FFH,0F7H,0FFH,0FBH ;¼ä¸ôá÷Ë®μÆÏò×ó±í DB 7FH,0FFH,0BFH,0FFH DB 0F7H,0FFH,0FBH,0FFH TAB5: DB 0FEH,7FH,0FDH,0BFH DB 0FBH,0DFH,0F7H,0EFH ;»¨Ñù±íò»£¬ÏòÖD¾Û£ DB 0EFH,0F7H,0DFH,0FBH DB 0BFH,0FDH,7FH,0FEH TAB6: DB 7FH,0FEH,0BFH,0FDH DB 0DFH,0FBH,0EFH,0F7H ;»¨Ñù±í¶t£¬Ïòía颿a DB 0F7H,0EFH,0FBH,0DFH DB 0FDH,0BFH,0FEH,7FH TAB7: DB 0FEH,0FEH,0FDH,0FDH DB 0FBH,0FBH,0F7H,0F7H ;»¨Ñù±íèy£¬í¬ê±Ïòóòíƽø DB 0EFH,0EFH,0DFH,0DFH DB 0BFH,0BFH,7FH,7FH TAB8: DB 7FH,7FH,0BFH,0BFH DB 0DFH,0DFH,0EFH,0EFH ;»¨Ñù±íËÄ£¬í¬ê±Ïò×óíƽø DB 0F7H,0F7H,0FBH,0FBH DB 0FDH,0FDH,0FEH,0FEH TAB9: DB 55H,55H,0AAH,0AAH DB 55H,55H,0AAH,0AAH ;»¨Ñù±íÎ壬½»ìæéá DB 55H,55H,0AAH,0AAH DB 55H,55H,0AAH,0AAH TAB10: DB 00H,00H,0FFH,0FFH DB 00H,00H,0FFH,0FFH DB 00H,00H,0FFH,0FFH DB 00H,00H,0FFH,0FFH TAB11: DB 0CCH,0CCH,33H,33H DB 0CCH,0CCH,33H,33H DB 0CCH,0CCH,33H,33H DB 0CCH,0CCH,33H,33H TAB12: DB 66H,66H,99H,99H DB 66H,66H,99H,99H DB 66H,66H,99H,99H DB 66H,66H,99H,99H TAB13: DB 0FH,0FH,0F0H,0F0H DB 0FH,0FH,0F0H,0F0H DB 0FH,0FH,0F0H,0F0H DB 0FH,0FH,0F0H,0F0H TAB14: DB 00H,00H,0FFH,0FFH DB 00H,00H,0FFH,0FFH DB 00H,00H,0FFH,0FFH DB 00H,00H,0FFH,0FFH TAB15: DB 03H,9FH,25H,0DH,99H DB 49H,41H, 1FH,01H,09H END |