汇编语言 数字钟 在KEIL中编译时有F1的地方就出错 怎么改正
SW1 EQU P3.0SW2 EQU P3.1
SW3 EQU P3.2
SW4 EQU P3.3
BUZZER EQU P3.4
LED EQU P3.5
DIS EQU P1
MS EQU 10H
SECS EQU 11H
MINUTE EQU 12H
HOUR EQU 13H
DM EQU 14H
T_MINUTE EQU 18H
T_HOUR EQU 19H
TTAB EQU 1AH
ORG 0000H
AJMP MAIN
ORG 000BH
AJMP TOINT
MAIN: MOV SP,#64H
MOV P3,#0FFH
LCALL CLEAR
SETB EA
SETB ET0
CLR F0
MOV TMOD,#01H
MOV TL0,#0F4H
MOV TH0,#16H
MOV B,#50
MOV MS,#0
MOV SECS,#0
MOV MINUTE,#0
MOV HOUR,#12H
MOV T_MINUTE,#0
MOV T_HOUR,#6H
SETB TR0
LOOP1:SETB BUZZER
MOV R0,#MINUTE
LCALL SPLIT
LCALL DISP
MOV A,SECS
JNZ SCAN
LCALL COMP
MOV R0,#MINUTE
LCALL SPLIT
LCALL DISP
SCAN:JB SW3,LOOP1
LCALL SETI
SJMP LOOP1
SETI: LCALL CLEAR
LCALL BB
SET0:MOV R0,#MINUTE
LCALL SPLIT
LCALL DISP
JNB SW3,SET0
SETB F0
MOV TTAB,#20H
SET1:MOV R0,#T_MINUTE
LCALL SPLIT
LCALL DISP
JNB SW1,SETM
JNB SW2,SETH
JNB SW3,SAVE
JB SW4,SET1
SJMP SEXIT
SETM:MOV R0,#T_MINUTE
LCALL SPLIT
LCALL DISP
JNB SW1,SETM
MOV A,T_MINUTE
ADD A,#1
DA A
MOV T_MINUTE,A
CJNE A,#60H,SET1
MOV T_MINUTE,#0
SJMP SET1
SETH:MOV R0,#T_MINUTE
LCALL SPLIT
LCALL DISP
JNB SW2,SETH
MOV A,T_HOUR
ADD A,#1
DA A
MOV T_HOUR,A
CJNE A,#24H,SET1
MOV T_HOUR,#0
SJMP SET1
SAVE:MOV R0,#T_MINUTE
LCALL SPLIT
LCALL DISP
JNB SW3,SAVE
LCALL BB
MOV R0,TTAB
MOV @R0,T_HOUR
INC R0
MOV @R0,T_MINUTE
INC R0
MOV TTAB,R0
CJNE R0,#60H,SET1
SEXIT:LCALL BB
CLR F0
RET
BB: MOV R5,#40H
LOOP3:MOV R6,#80H
DJNZ R6,$
CPL BUZZER
DJNZ R5,LOOP3
SETB BUZZER
RET
SPLIT:MOV R1,#DM
MOV A,@R0
ANL A,#0FH
MOV @R1,A
INC R1
MOV A,@R0
ANL A,#0F0H
SWAP A
MOV @R1,A
INC R1
INC R0
MOV A,@R0
ANL A,#0FH
MOV @R1,A
INC R1
MOV A,@R0
ANL A,#0F0H
SWAP A
MOV @R1,A
RET
DISP:PUSH 00
PUSH 01
PUSH 02
PUSH 03
PUSH ACC
MOV R0,#DM
MOV R2,#0EFH
JNB F0,DISP0
DJNZ B,DISP1
CPL F1
MOV B,#50
SJMP DISP1
DISP0:CLR F1
DISP1:ORL DIS,#0F0H
MOV R3,#6
DJNZ R3,$
JB F1,HIDE
MOV A,R2
ANL A,#0F0H
ORL A,@R0
MOV DIS,A
HIDE:MOV R3,#40
DJNZ R3,$
INC R0
MOV A,R2
RL A
MOV R2,A
JB ACC.0,DISP1
DEXIT:POP ACC
POP 03
POP 02
POP 01
POP 00
RET
COMP:MOV R1,#20H
COMP1:MOV A,@R1
CJNE A,HOUR,COMP5
INC R1
MOV A,@R1
CJNE A,MINUTE,COMP6
MOV R5,#40
MOV R4,#10
MOV R6,#30
MOV R7,#40
COMP2:MOV R0,#MINUTE
LCALL SPLIT
LCALL DISP
DJNZ R6,COMP2
MOV R6,#30
CPL BUZZER
DJNZ R5,COMP2
MOV R5,#40
COMP3:MOV R0,#MINUTE
LCALL SPLIT
LCALL DISP
DJNZ R4,COMP3
MOV R4,#20
CPL BUZZER
DJNZ R7,COMP3
MOV R7,#40
COMP4:LCALL DISP
MOV A,SECS
JZ COMP4
RET
COMP5:INC R1
COMP6:INC R1
CJNE R1,#60H,COMP1
RET
CLEAR:MOV R0,#20H
MOV A,#0FFH
LOOP2:MOV @R0,A
INC R0
CJNE R0,#60H,LOOP2
RET
TOINT:PUSH ACC
MOV TL0,#0F9H
MOV TH0,#16H
JB F0,LP2
JNB SW1,VERM
JNB SW2,VERH
LP2: INC MS
MOV A,MS
CJNE A,#3,LP3
CLR LED
LP3: CJNE A,#5,TOEXIT
SETB LED
MOV MS,#0
INC SECS
MOV A,SECS
CJNE A,#60H,TOEXIT
MOV SECS,#0
MOV A,MINUTE
ADD A,#1
DA A
MOV MINUTE,A
CJNE A,#60H,TOEXIT
MOV MINUTE,#0
MOV A,HOUR
ADD A,#1
DA A
MOV HOUR,A
CJNE A,#24H,TOEXIT
MOV HOUR,#0
TOEXIT:POP ACC
RETI
VERM:MOV A,MINUTE
ADD A,#1
DA A
MOV MINUTE,A
CJNE A,#60H,VERM1
MOV MINUTE,#0
VERM1:MOV SECS,#0
POP ACC
RETI
VERH:MOV A,HOUR
ADD A,#1
DA A
MOV HOUR,A
CJNE A,#24H,VERH1
MOV HOUR,#0
VERH1:MOV SECS,#0
POP ACC
RETI
END