ORG 0000H LJMP MAIN ORG 000BH LJMP TNO ORG 0030H MAIN: MOV R2,#00H MOV R3,#00H MOV R4,#00H MOV R5,#00H MOV R6,#00H MOV R7,#00H
MOV TMOD,#02H MOV TL0,#06H MOV TH0,#06H SETB EA SETB ET0 SETB TR0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;开中断; KK: LCALL LOOP LCALL SPD LCALL DSP SJMP KK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;调用 SPD:MOV A,R2 MOV DPTR,#TAB MOVC A,@A+DPTR MOV 30H,A
MOV A,R3 MOVC A,@A+DPTR MOV 31H,A
MOV A,R4 MOVC A,@A+DPTR MOV 32H,A
MOV A,R5 MOVC A,@A+DPTR MOV 33H,A
MOV A,R6 MOVC A,@A+DPTR MOV 34H,A
MOV A,R7 MOVC A,@A+DPTR MOV 35H,A
RET TAB:DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
;;;;;;;;;;;;;;;;;;;;;;; DSP: MOV R0,#22H MOV R1,#21H MOV A,30H MOVX @R0,A MOV A,#01H MOVX @R1,A MOV A,#00H MOVX @R1,A
MOV A,31H MOVX @R0,A MOV A,#02H MOVX @R1,A MOV A,#00H MOVX @R1,A
MOV A,32H MOVX @R0,A MOV A,#04H MOVX @R1,A MOV A,#00H MOVX @R1,A
MOV A,33H MOVX @R0,A MOV A,#08H MOVX @R1,A MOV A,#00H MOVX @R1,A
MOV A,34H MOVX @R0,A MOV A,#10H MOVX @R1,A MOV A,#00H MOVX @R1,A
MOV A,35H MOVX @R0,A MOV A,#20H MOVX @R1,A MOV A,#00H MOVX @R1,A
RET ;;;;;;;;;;;;;;;;;;; LOOP:SETB RS0 CJNE R6,#200,LOOP1 MOV R6,#00H INC R7 CJNE R7,#0AH,LOOP1 MOV R7,#00H CLR RS0 INC R2 CJNE R2,#0AH,LOOP1 MOV R2,#00H INC R3 CJNE R3,#06H,LOOP1 MOV R3,#00H INC R4 CJNE R4,#0AH,LOOP1 MOV R4,#00H INC R5 CJNE R5,#06H,LOOP1 MOV R5,#00H INC R6 CJNE R6,#04H,LOOP1 MOV R6,#00H INC R7 CJNE R7,#02H,LOOP1 LOOP1: RET TNO:INC R6 RETI END
|