我是菜农啊。请大哥们帮忙解答,谢谢
本段程序是用51单片机编写的,用于接收红外编码信号; 分析一下这段程序,
; 引导码: 9ms+4.5ms时长
; 请问:定时器T0中断时间大约是多少?
; COUNT0应该有一个清0的动作,要放在程序的哪个部位?
; 以上两个问题的答案(并说出理由)请用邮件回复ly33052@
org 0000h
LJMP RESET
;
MOV TL0,#81H ;ORG 0003H
SETB TR0
LJMP INT0SAV
;
LJMP T0SAV ;ORG 000BH
;********redline receive********
INT0SAV:PUSH ACC ; IO口中断
PUSH PSW
CLR EX0
MOV A,CBYTE0
JNZ INT0S2
CLR A
MOV COUNT0,A
MOV CERROR,A
MOV CBIT,A
MOV BITBUF,A
CLR CONFIRM
INT0S1: POP PSW
POP ACC
RETI
INT0S2: SETB CONFIRM
SJMP INT0S1
T0SAV: PUSH ACC ; 定时中断
push 00h
PUSH PSW
INC COUNT0
MOV A,CBYTE0
JNZ DATAC1
MOV A,COUNT0
CLR C
SUBB A,#32
jnc bootc1
JNB P3.2,DATAC5
INC CERROR
SJMP BOOTC4
BOOTC1: MOV A,COUNT0
SUBB A,#35
clr ex0
JC DATAC6
JB P3.2,BOOTC2
INC CERROR
BOOTC4: MOV A,CERROR
clr c
SUBB A,#4
JNC BOOTC3
BOOTC2: MOV A,COUNT0
SUBB A,#49
JC DATAC6
INC CBYTE0
BOOTC3: CLR TR0
SJMP DATAC5
DATAC1: jnb confirm,datac1a
clr confirm
jb P3.2,datac1a
ljmp redprc
datac1a:MOV A,COUNT0
CLR C
SUBB A,#3
JNC DATAC2
JNB P3.2,DATAC6
INC CERROR
SJMP DATAC6
DATAC2: JB P3.2,DATAC4
INC CERROR
DATAC3: MOV A,CERROR
CLR C
SUBB A,#3
JC DATAC4
DATAC8: CLR TR0
CLR EX0
SETB NEWKEY
JB RED2,DATAC9
SETB REERR1
SETB BELLFLG1
SJMP DATAC6
DATAC9: SETB REERR2
SETB BELLFLG2
SJMP DATAC6
DATAC4: MOV A,COUNT0
cjne a,#0ah,datac7
sjmp datac8
DATAC7: CLR C
SUBB A,#06
JC DATAC5
SETB HILEV
DATAC5: SETB EX0
DATAC6: POP PSW
pop 00h
POP ACC
RETI
redprc: