单片机智能温度计设计 第8页
MOV R0,#7EH
ACALL DAAD1
MOV A,R2
XRL A,#24H
JNZ RET0
ACALL CLR0
RET0:SETB TR0
POP DPL
POP DPH
POP 0E0H
POP PSW
RETI
GETNUM:
JB FLAG1,EE
MOV R1,#49H
MOV R2,#6
CO: MOV @R1,#0
INC R1
DJNZ R2,CO
SETB FLAG1
EE: AJMP DDD
DAAD1:MOV A,@R0
DEC R0
SWAP A
ORL A,@R0
ADD A,#1
DA A
MOV R2,A
ANL A,#0FH
MOV @R0,A
MOV A,R2
INC R0
ANL A,#0F0H
SWAP A
MOV @R0,A
SETB FLAG3
RET
SUB: DEC R0
DEC @R0
CJNE @R0,#0FFH,RET2
INC R0
CJNE @R0,#0,AA
DEC R0
MOV @R0,#0
RET
AA: DEC R0
MOV @R0,#9
INC R0
DEC @R0
CJNE @R0,#0FFH,RET2
MOV @R0,#0
SETB FLAG3
RET2: RET
SUB0: DEC R0
DEC @R0
CJNE @R0,#0FFH,RET2
INC R0
CJNE @R0,#0,BB
DEC R0
MOV @R0,#0
RET
BB: DEC R0
MOV @R0,#9
INC R0
DEC @R0
CJNE @R0,#0FFH,RET3
MOV @R0,#0
SETB FLAG3
RET3: RET
CLR0: CLR A
MOV @R0,A
DEC R0
MOV @R0,A
SETB FLAG3
RET
FUL0: MOV A,#6
MOV @R0,A
DEC R0
CLR A
MOV @R0,A
SETB FLAG3
RET
INI: ORL TMOD,#20H
MOV TH1,#0fdH
MOV TL1,#0fdH
MOV SCON,#50H
MOV PCON,#80H
SETB TR1
MOV A,#0CH
MOV SBUF,A
JNB TI,$
CLR TI
MOV R3,#2
REC2: MOV R2,#2
REC: MOV A,@R0
SND: MOV SBUF,A
JNB TI,$
CLR TI
DEC R0
DEC R0
DJNZ R2,REC
MOV A,#3AH
MOV SBUF,A
JNB TI,$
CLR TI
DJNZ R3,REC2
MOV R2,#2
REC1: MOV A,@R0
MOV SBUF,A
JNB TI,$
CLR TI
DEC R0
DEC R0
DJNZ R2,REC1
JB E0,REE
AJMP JJ
RET
REE: MOV SBUF,#24H
JNB TI,$
CLR TI
剩余代码请联系QQ752018766,本论文免费
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页