;四个显示字符数据表在50H—6FH单元内,字符用8*8点阵,R4(30H)用于
;控制显示静止字的时间,R5(31H)静止字显示跳转地址步距,B内放显示首址 ; ;************; ;中断入口程序; ;************; ; ORG 0000H LJMP START ORG 0003H RETI
ORG 000BH RETI ORG 0013H RETI ORG 001BH RETI ORG 0023H RETI ORG 002BH RETI ;;;;;;; CLEARMEN: MOV A,#0FFH MOV P1,A MOV P2,A MOV P3,A MOV P0,A MOV DPTR,#TAB CLR A MOV R3,A MOV R1,#50H MOV R2,#20H CLLOOP: MOVC A,@A+DPTR MOV @R1,A MOV A,R3 INC A MOV R3,A INC R1 DJNZ R2,CLLOOP RET ;;;;;;;;;; START: LCALL CLEARMEN START1: LCALL KEYWORK AJMP START1 KEYWORK: MOV P1,#0FFH JNB P1.0,KEY1 JNB P1.1,KEY2 JNB P1.2,KEY3 KEYRET: RET KEY1: LCALL DL10MS JB P1.0,KEYRET WAIT: JNB P1.0,WAIT LCALL CLEARMEN MOV 30H,#80H MOV 31H,#08H LJMP DISP1 KEY2: LCALL DL10MS JB P1.1,KEYRET WAIT1: JNB P1.1,WAIT1 LCALL CLEARMEN MOV 30H,#14H MOV 31H,#01H LJMP DISP1 KEY3: LCALL DL10MS JB P1.2,KEYRET WAIT2: JNB P1.2,WAIT2 LCALL CLEARMEN LJMP DISP2 ;;;;;;;;;; DISP1: MOV B,#50H MOV R4,30H MOV R5,31H LOOP: LCALL DISPLAY DJNZ R4,LOOP MOV R4,30H MOV A,B CJNE A,#68H,CONT AJMP DISP1 CONT: ADD A,R5 MOV B,A AJMP LOOP ;;;;;;;;;;; DISPLAY: MOV A,#0FFH MOV P0,A MOV P2,A MOV R6,#0FEH MOV R0,B MOV R7,#08H DISLOOP: MOV A,@R0 MOV P0,A MOV P2,R6 LCALL DL1MS INC R0 MOV A,R6 RL A MOV R6,A DJNZ R7,DISLOOP RET ;;;;;; DISP2: LCALL DISPP LCALL MOVH LCALL MOVH1 AJMP DISP2 ;;;;;;;; DISPP: MOV B,#50H MOV R4,#24H LCALL DISPLAY DJNZ R4,DISPP RET ;;;;;;;; MOVH: MOV R1,#20H MOV R0,#50H MOV R2,#08H MOV1: MOV A,@R0 CLR C RLC A MOV @R0,A MOV A,@R1 RRC A MOV @R1,A INC R0 DJNZ R2,MOV1 MOV R2,#08H INC R1 MOV A,R1 SUBB A,#24H JZ OUT AJMP MOV1 OUT: RET ;;;;;;;; MOVH1: MOV A,20H XCH A,23H XCH A,22H XCH A,21H MOV 20H,A MOV R1,#20H MOV R0,#50H MOV2: MOV A,@R0 RR A MOV @R0,A MOV A,@R1 CLR C RRC A MOV A,@R0 RLC A MOV @R0,A INC R0 DJNZ R2,MOV2 MOV R2,#08H INC R1 MOV A,R1 SUBB A,#24H JZ OUT AJMP MOV2 ;;;;;;;; DL1MS: MOV R3,#64H;100*(8+2)us LOOPK: LCALL KEYWORK DJNZ R3,LOOPK RET ;;;;;;;; DL512: MOV R2,#0FFH LOOP1: DJNZ R2,LOOP1 RET ;;;;;;;;;;;;; DL10MS: MOV R3,#14H LOOP2: LCALL DL512 DJNZ R3,LOOP2 RET ;;;;;;;;;;;;;;; TAB: DB 0EFH,83H,0ABH,83H,0ABH,83H,0EEH,0E0H;电 DB 0FFH,0C7H,0EFH,83H,0EFH,0EFH,0CFH,0EFH;子 DB 0B1H,0B5H,04H,0BFH,0B1H,0B5H,9BH,0A4H;设 DB 0BBH,0BBH,1BH,0A0H,0BBH,0BBH,9BH,0BBH;计 DB 00H,00H,00H,00H ;;;;;;;;;;; END
|