D0 BIT P2.0 D1 BIT P2.1 D2 BIT P2.2 D3 BIT P2.3 D4 BIT P2.5 ORG 0000H SJMP START ORG 0040H START:MOV SP,#60H MOV R0,#00H MOV R1,#20 MOV DPTR,#TABLE SETB D4 MOV A,R0 MOVC A,@A+DPTR //1 MOV P0,A CLR D0 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //2 MOV P0,A SETB D0 CLR D1 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //3 MOV P0,A SETB D1 CLR D2 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //4 MOV P0,A SETB D2 CLR D3 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //5 MOV P0,A SETB D3 CLR D0 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //6 MOV P0,A SETB D0 CLR D1 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //7 MOV P0,A SETB D1 CLR D2 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //8 MOV P0,A SETB D2 CLR D3 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //9 MOV P0,A SETB D3 CLR D0 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //10 MOV P0,A SETB D0 CLR D1 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //11 MOV P0,A SETB D1 CLR D2 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //12 MOV P0,A SETB D2 CLR D3 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //13 MOV P0,A SETB D3 CLR D0 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //14 MOV P0,A SETB D0 CLR D1 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //15 MOV P0,A SETB D1 CLR D2 LCALL DELAY MOV R1,#20 INC R0 MOV A,R0 MOVC A,@A+DPTR //16 MOV P0,A SETB D2 CLR D3 LCALL DELAY SETB D3 LJMP START DELAY:MOV R7,#200 DEL1:MOV R6,#125 DEL2:DJNZ R6,DEL2 DJNZ R7,DEL1 DJNZ R1,DELAY RET
TABLE:DB 0C0H,0F9H,0A4H,0B0H DB 99H,92H,82H,0F8H DB 80H,90H,88H,83H DB 0C6H,0A1H,86H,8EH END
上一篇:可以调整时间的电子时钟-C语言
下一篇:基于51单片机的频率计程序
推荐阅读最新更新时间:2024-03-16 13:08