TMPL EQU 29H
TMPH EQU 28H
FLAG1 EQU 38H
DATAIN BIT P3.7
ORG 00H
LJMP MAIN1
ORG 03H
LJMP ZINT0
ORG 13H
LJMP ZINT1
ORG 30H
MAIN1: SETB IT0
SETB EA
SETB EX0
SETB IT1
SETB EX1
SETB P3.6
SETB P3.2
MOV 74H,#0
MOV 75H,#0
MOV 76H,#9
MOV 77H,#0
MAIN: LCALL GET_TEMPER
LCALL CVTTMP
LCALL DISP1
AJMP MAIN
INIT_1820: SETB DATAIN
NOP
CLR DATAIN
MOV R1,#3
TSR1: MOV R0,#107
DJNZ R0,$
DJNZ R1,TSR1
SETB DATAIN
NOP
NOP
NOP
MOV R0,#25H
TSR2: JNB DATAIN,TSR3
DJNZ R0,TSR2
CLR FLAG1
SJMP TSR7
TSR3: SETB FLAG1
CLR P1.7
MOV R0,#117
TSR6: DJNZ R0,$
TSR7: SETB DATAIN
RET
GET_TEMPER: SETB DATAIN
LCALL INIT_1820
JB FLAG1,TSS2
NOP
RET
TSS2: MOV A,#0CCH
LCALL WRITE_1820
MOV A,#44H
LCALL WRITE_1820
ACALL DISP1
LCALL INIT_1820
MOV A,#0CCH
LCALL WRITE_1820
MOV A,#0BEH
LCALL WRITE_1820
LCALL READ_1820
RET
WRITE_1820: MOV R2,#8
CLR C
WR1: CLR DATAIN
MOV R3,#6
DJNZ R3,$
RRC A
MOV DATAIN,C
MOV R3,#23
DJNZ R3,$
SETB DATAIN
NOP
DJNZ R2,WR1
SETB DATAIN
RET
READ_1820: MOV R4,#2
MOV R1,#29H
RE00: MOV R2,#8
RE01: CLR C
SETB DATAIN
NOP
NOP
CLR DATAIN
NOP
NOP
NOP
SETB DATAIN
MOV R3,#9
RE10: DJNZ R3,RE10
MOV C,DATAIN
MOV R3,#23
RE20: DJNZ R3,RE20
RRC A
DJNZ R2,RE01
MOV @R1,A
DEC R1
DJNZ R4,RE00
RET
CVTTMP: MOV A,TMPH
ANL A,#80H
JZ TMPC1
CLR C
MOV A,TMPL
CPL A
ADD A,#1
MOV TMPL,A
MOV A,TMPH
CPL A
ADDC A,#0
MOV TMPH,A
MOV 73H,#0BH
SJMP TMPC11
TMPC1: MOV 73H,#0AH
TMPC11: MOV A,TMPL
ANL A,#0FH
MOV DPTR,#TMPTAB
MOVC A,@A+DPTR
MOV 70H,A
MOV A,TMPL
ANL A,#0F0H
SWAP A
MOV TMPL,A
MOV A,TMPH
ANL A,#0FH
SWAP A
ORL A,TMPL
H2BCD: MOV B,#100
DIV AB
JZ B2BCD1
MOV 73H,A
B2BCD1: MOV A,#10
XCH A,B
DIV AB
MOV 72H,A
MOV 71H,B
TMPC12: NOP
DISBCD: MOV A,73H
ANL A,#0FH
CJNE A,#1,DISBCD0
SJMP DISBCD1
DISBCD0: MOV A,72H
ANL A,#0FH
JNZ DISBCD1
MOV A,73H
MOV 72H,A
MOV 73H,#0AH
DISBCD1: RET
TMPTAB: DB 0,1,1,2,3,3,4,4,5,6,6,7,8,8,9,9
DISP1: MOV R1,#70H
MOV R0,#74H
MOV R5,#0FEH
PLAY: MOV P1,#0FFH
MOV A,R5
MOV P2,A
MOV A,@R1
MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P1,A
MOV A,@R0
MOVC A,@A+DPTR
MOV P0,A
MOV A,R5
JB ACC.1,LOOP1
CLR P1.7
CLR P0.7
LOOP1: LCALL DL1MS
INC R1
INC R0
MOV A,R5
JNB ACC.3,ENDOUT
RL A
MOV R5,A
MOV A,73H
CJNE A,#1,DD2
SJMP LEDH
DD2: MOV A,72H
CJNE A,#0AH,DD3
MOV 72H,#0
DD3: MOV A,76H
CJNE A,72H,DDH
SJMP DDL
DDH: JNC PLAY1
SJMP LEDH
DDL: MOV A,75H
CJNE A,71H,DDL1
SJMP LEDH
DDL1: JNC PLAY1
LEDH: CLR P3.6
SJMP PLAY
PLAY1: SETB P3.6
SJMP PLAY
ENDOUT: MOV P1,#0FFH
MOV P2,#0FFH
RET
TAB: DB 0C0H,0F9H,0A4H,0B0H,99H
DB 92H,82H,0F8H,80H,90H,0FFH,0BFH
DL1MS: MOV R6,#50
DL1: MOV R7,#100
DJNZ R7,$
DJNZ R6,DL1
RET
ZINT0: PUSH ACC
INC 75H
MOV A,75H
CJNE A,#10,ZINT01
MOV 75H,#0
ZINT01: POP ACC
RETI
ZINT1: PUSH ACC
INC 76H
MOV A,76H
CJNE A,#10,ZINT11
MOV 76H,#0
ZINT11: POP ACC
RETI
ZZZ1: MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P0,A
RETI
END
这是电路图 解释下这个汇编的大概意思 就行,