发表于:2009-05-08 14:28:34
楼主
是关于频率测量的 ,哪位高手给我说下各个段的大概意思啊
MAIN: MOV SP,#5FH
NOP
LCALL INIT_MAIN
LCALL INIT_MAX7219
LM_M: ACALL DISP
ACALL D10MS
ACALL KEY_SCAN
AJMP LM_M
KEY_SCAN:
MOV P1,#0FFH
MOV C,KEY_1
JNC D1STIME
MOV C,KEY_2
JNC D100MSTIME
MOV C,KEY_3
JNC D10MSTIME
MOV C,KEY_4
JNC D1MSTIME
RET
……………………………………
INIT_MAIN:
MOV R1,#8
MOV R0,#30H
LP_MAIN:MOV @R0,#00H
INC R0
DJNZ R1,LP_MAIN
RET
……………………………….清零
D1STIME:
MOV M,#0
CLR F0
MOV T,#100
ACALL INIT_T
JNB F0,$
RET
D100MSTIME:
MOV M,#1
CLR F0
MOV T,#10
ACALL INIT_T
JNB F0,$
RET
D10MSTIME:
MOV M,#2
CLR F0
MOV T,#1
ACALL INIT_T
JNB F0,$
RET
D1MSTIME:
MOV M,#2
CLR F0
MOV T,#1
ACALL INIT_T
JNB F0,$
RET
INIT_T:
MOV TMOD,#15H
MOV TH1,#0B8H
MOV TL1,#03H
SETB ET1
CLR ET0
SETB EA
SETB TR0
SETB TR1
RET
_T0_: MOV TH1,#0B8H
MOV TL1,#03H
DJNZ T,_T0_NEXT
CLR TR0
CLR TR1
SETB F0
ACALL DAT_CONVERSION
MOV TH0,#00H
MOV TL0,#00H
ACALL MOVE_M
ACALL DISP
_T0_NEXT:RETI
MOVE_M: NOP
MOV A,M
CJNE A,#00H,MOVE_2
RET
MOV A,M
MOVE_2: CJNE A,#01H,MOVE_3
MOV 35H,34H
MOV 34H,#0
MOV 34H,33H
MOV 33H,#0
MOV 33H,32H
MOV 32H,#0
MOV 32H,31H
MOV 31H,#0
MOV 31H,30H
MOV 30H,0
RET
MOV A,M
MOVE_3: CJNE A,#02H,MOVE_RET
MOV 36H,34H
MOV 34H,#0
MOV 35H,33H
MOV 33H,#0
MOV 34H,32H
MOV 32H,#0
MOV 33H,31H
MOV 31H,#0
MOV 32H,30H
MOV 30H,#0