ORG 0000H AJMP MAIN ORG 0030H MAIN: MOV 30H,#0 MOV 31H,#0 MOV 32H,#0 MOV 33H,#0 MOV 34H,#0 ACALL DISP ABC: MOV A,31H CJNE A,#2,A1 MOV A,32H CJNE A,#4,A1 AJMP MAIN A1: INC 34H ACALL DELAY ACALL DISP MOV A,34H CJNE A,#9,ABC INC 33H MOV 34H,#0 MOV A,33H CJNE A,#6,ABC INC 32H MOV 33H,#0 MOV 34H,#0 ACALL DELAY ACALL DISP MOV A,32H CJNE A,#10,ABC INC 31H MOV 34H,#0 MOV 32H,#0 MOV 33H,#0 ACALL DELAY ACALL DISP MOV A,32H CJNE A,#10,ABC AJMP MAIN DISP: MOV R0,#30H MOV 41H,#5 M1: MOV DPTR,#TAB MOV A,@R0 MOVC A,@A+DPTR MOV 40H,#8 M0: RLC A MOV P2.7,C CLR P2.6 SETB P2.6 DJNZ 40H,M0 INC R0 DJNZ 41H,M1 RET DELAY: MOV R0,#15 ;为了实验方便调快了速度,实际使用时把这段替换成1s的延时程序就行 DEL2: MOV R1,#10 DEL1: MOV R2,#7DH DEL0: NOP NOP DJNZ R2,DEL0 DJNZ R1,DEL1 DJNZ R0,DEL2 RET TAB: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,67H END
本文版权归逸云蓝天所有,转载请注明出处并添加本文链接。