;*****************HTTP://CHIPKOOL.TK****************** ;*******************CHIPKOOL_ONLINE************************* ORG 00 MAIN: KEY: JNB P3.0,KEYOK;IF P3.0=0 THEN KEYOK CALL DELAY;CHONG DOI PHIM JMP KEY KEYOK: CALL HIENTHI INC R0;TANG BIEN DEM JMP MAIN HIENTHI: MOV A,R0 MOV DPTR,#MALED MOVC A,@A+DPTR CALL NAPA SETB P2.2 CLR P2.2 CALL DELAY RET NAPA: MOV R6,#8 NAP: RLC A JC NAP1 JNC NAP0 NAP1: SETB P2.0 SETB P2.1 CLR P2.1 JMP TT NAP0: CLR P2.0 SETB P2.1 CLR P2.1 TT: DJNZ R6,NAP RET DELAY: MOV R1,#255 TRE: MOV R2,#255 DJNZ R2,$ DJNZ R1,TRE RET ORG 500 MALED:DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H END