MAIN: ACALL CONV ACALL DIS AJMP MAIN CONV: MOV A DI_DA(DI_DA为定时1MS的计数单元) CJNE A,#64H,DONE(看时候到0.1S) MOV DI_DA,#00H MOV A,MSEC ADD A,#01H DA A MOV MSEC,A CJNE A,#0AH,DONE MOV MSEC,#00H MOV A,SEC ADD A,#01H DA A MOV SEC,A CJNE A,#0AH,DONE MOV SEC,#00H MOV A,MIN ADD A,#01H DA A MOV MIN,A CJNE A,#09H,DONE MOV MIN,#00H DONE:RET DIS:MOV A,MSEC MOV DPTR,#TAB MOVC A,@A+DPTR MOV DPTR,#42H MOVX @DPTR,A MOV DPTR,#40H MOV A,#0F7H MOVX @DPTR,A NOP NOP NOP MOV A,SEC MOVC A,@A+DPTR MOV DPTR,#42H MOVX @DPTR,A MOV DPTR,#40H MOV A,#0FBH MOVX @DPTR,A NOP NOP NOP NOP MOV A,MIN MOVC A,@A+DPTR MOV DPTR,#42H MOVX @DPTR,A MOV DPTR,#40H MOV A,#0FDH MOVX @DPTR,A NOP NOP NOP RET TAB: DB 0F0H,0F1H,0F2H,0F3H,0F4H DB 0F5H,0F6H,0F7H,0F8H,0F9H END
|