|
$NOMOD51
$INCLUDE(REG932.INC)
FE BIT SCON.7
BRGR1_DATA EQU 02H
BRGR0_DATA EQU 61H
RUNBEEP BIT 10H
LEDCON BIT P2.6
BEEP BIT P2.7
ORG 0000H
AJMP MAIN
ORG 0023H
AJMP RI_INT
ORG 006BH
AJMP TI_INT
ORG 0100H
MAIN:MOV R7,#20H
DJNZ R7,$
MOV P1M1,#00H
MOV P1M2,#00H
MOV P2M1,#0C0H
MOV P2M2,#0C0H
CLR RUNBEEP
MOV SCON,#50H
ORL PCON,#40H
MOV SSTAT,#0E0H
MOV BRGCON,#00H
MOV BRGR1,#BRGR1_DATA
MOV BRGR0,#BRGR0_DATA
MOV BRGCON,#03H
MOV IEN0,#90H
MOV IEN1,#40H
MAIN_LOOP1:JNB RUNBEEP,$
CLR RUNBEEP
CLR BEEP
MOV R7,#5
MAIN_LOOP2:MOV R6,#0
MAIN_LOOP3:MOV R5,#0
DJNZ R5,$
DJNZ R6,MAIN_LOOP3
DJNZ R7,MAIN_LOOP2
SETB BEEP
SJMP MAIN_LOOP1
RI_INT:CLR RI
JNB FE,RI_ITL1
CLR FE
SJMP RI_ITL4
RI_ITL1:MOV A,SBUF
CJNE A,#0C0H,RI_ITL2
CLR LEDCON
SJMP RI_ITL3
RI_ITL2:CJNE A,#0C1H,RI_ITL3
SETB LEDCON
RI_ITL3:MOV SBUF,#0A0H
NOP
NOP
NOP
NOP
MOV SBUF,A
CLR T1
RI_ITL4:RETI
TI_INT: SETB RUNBEEP
CLR TI
RETI
END
|
|