CALL SOUNDDELAY0 ;廷时W*3US
BCF PORTA,0
MOVFW TEMP
CALL SOUNDDELAY0
DECFSZ FRE_REPEAT,1 ;每四次减频率计数一次
GOTO REPEAT0_LP
DECFSZ FRE_COUNT,1
GOTO SOUND_LH_LP
SOUND_HL
MOVLW S_LOOP
MOVWF FRE_COUNT ;46=93-47
SOUND_HL_LP
MOVLW S_REPEAT ;同一频率重复次数送FRE_REPEAT
MOVWF FRE_REPEAT
MOVFW FRE_COUNT
SUBLW S_MAX ;最大值减计数值
MOVWF TEMP
REPEAT1_LP
MOVFW TEMP
BSF PORTA,0
CALL SOUNDDELAY0 ;廷时W*3US
BCF PORTA,0
MOVFW TEMP
CALL SOUNDDELAY0
DECFSZ FRE_REPEAT,1;四次减频率计数一次
GOTO REPEAT1_LP
DECFSZ FRE_COUNT,1
GOTO SOUND_HL_LP
SOUND_END
RETLW 0
;------------------------------
SOUNDDELAY0
MOVWF SOUNDDELAY1 ;廷时W*3US+1US
SOUNDDELAYUS_1
DECFSZ SOUNDDELAY1,1
GOTO SOUNDDELAYUS_1
RETLW 0
;------------------------
END