MOV P0,#0CBH ;显示分十位
CALL ENABLE
CALL WRITE2
MOV A,B
ADD A,#30H
MOV P0,#0CCH ;显示分个位
CALL ENABLE
CALL WRITE2
MOV A,#3AH
MOV P0,#0CDH ;显示冒号
CALL ENABLE
CALL WRITE2
MOV A,SEC
毕业论文http://www.751com.cn/
ADD A,#30H
MOV P0,#0CEH ;显示秒十位
CALL ENABLE
CALL WRITE2
MOV A,B
ADD A,#30H
MOV P0,#0CFH ;显示秒个位
CALL ENABLE
CALL WRITE2
MOV P0,#0C0H ;设光标地址
CALL ENABLE
MOV DPTR,#TABLE2;写数据
CALL WRITE1
RET
;*********************************************写指令
ENABLE: CLR RS
CLR RW
CLR E
LCALL DELAY
SETB E
RET
;**********************************************写数据
WRITE1: MOV R1,#00H
A1: MOV A,R1
MOVC A,@A+DPTR
CALL WRITE2
INC R1
CJNE A,#0FEH,A1 ;未到本文源自辣文论文网字符串末尾继续
RET
WRITE2: MOV P0,A
SETB RS
CLR RW
CLR E
CALL DELAY
SETB E
RET
;**********************************************
DELAY: MOV R4,#05
D1: MOV R5,#0FFH
DJNZ R5,$
DJNZ R4,D1
RET
;----------------------------------------------
TAB: db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h
db 80h,90h,88h,83h,0c6h,0a1h,86h,8eh
HERE',0FEH
TABLE2: DB 'DFF WB ',0FEH
TABLE4: DB 'CAU',0FEH
TABLE3: DB 30H,31H,32H,33h
DB 34H,35H,36H,37H
DB 38h,39H,41H,42H
DB 43H,44H,45H,46H
;--------------------------------------------------------------------
;播放歌曲程序
;--------------------------------------------------------------------
MAIN0: MOV TMOD,#11H
MOV IE,#8aH
;MOV TH1, #3cH
;MOV TL1, #0b0H
lcall ks
jnz TTM12
MOV 40H,#00H
;---------------------------------------------------------
NEXT20: MOV A,40H
MOV DPH,52H
MOV DPL,53H
MOVC A,@A+DPTR
MOV R2,A
JZ STOP
ANL A,#0FH
MOV R1,A
MOV A,R2
SWAP A
ANL A,#0FH
JNZ SING
CLR TR0
JMP W1
;----------------------------------------------------------
SING: DEC A
MOV 22H,A
RL A
MOV DPTR,#TABLE00
MOVC A,@A+DPTR
MOV TH0,A
MOV 21H,A
MOV A,22H
RL A
INC A
MOVC A,@A+DPTR
MOV TL0,A
MOV 20H,A
SETB TR0