在对以下程序编译时报错
报错内容为overwriting previous address contents (0004)
list p=16f877
#include "p16f877a.inc"
__config b'0x3b31
cunt equ 30h;ccp中断计数暂存
cunt_pro equ 31h;用于计算中间寄存器
cunt_back equ 32h
temp_cunt equ 33h;用于显示代码暂存
cunt_time equ 34h;2s延时计数器
ge equ 35h;个位
shi equ 36h;十位
bai equ 37h;百位
mpy_h equ 38h;乘积高8位
mpy_l equ 39h;乘积低8位
time_cunt equ 4ah;时间寄存器
flg equ 4bh;标志寄存器(bit0为2s时间到,bit1表示ccp1中断,bit3表示允许tmr1中断)
temp equ 4ch;中间寄存器
status_temp equ 4dh;状态位暂存
w_temp equ 4eh;w暂存
pcl_temp equ 4fh;pcl暂存
cunt_deg equ 50h
org 000h
movlw 0ah
movwf cunt_time
movlw 01dh
movwf cunt_deg
goto main
org 004h
goto int
;----中断地址分配----------------
main
call io_reset;io初始化
call int_reset;中断初始化
open_check
btfss portc,4
goto open_check
call delay750us
btfss portc,4
goto open_check
banksel pie1
bsf pie1,2;开ccp中断
banksel portc
loop_next
btfss portc,5
goto loop_dsp
clrf portd
call sc
call delay750us
btfss portc,5
goto loop_dsp
goto pro_2s
;----------主程序--------
int
btfss pir1,2;ccp是否中断
goto int_next
bcf pir1,2;清标记
call zh
goto int_next
;-------ccp部分----------
int_next
btfss flg,3;是否允许tmr1中断
goto int_tm1if
btfss pir1,0
goto int_tm1if
bcf pir1,0;请标记
call time
goto int_ret
int_tm1if
bcf pir1,0;清定时器1中断标记
goto int_ret
int_ret
retfie
;----------中断服务------------
pro_2s
banksel pie1
bcf pie1,2;关ccp中断
banksel tmr1l
movf cunt,0
movwf cunt_pro;把cunt(ccp中断次数计数器)值送往cunt_pro计数器
clrf cunt;清ccp中断计数器
clrf ge
clrf shi
clrf bai
bsf flg,3 ;开定时器软件中断标志
banksel pie1
bsf pie1,2;开ccp中断
bsf pie1,0;开定时器1中断
banksel t1con
bsf t1con,0;开定时器1
bcf flg,0 ;清时2s间到标记
bsf portd,4
call sc
s2_check
btfss flg,0
goto s2_check
banksel pie1
bcf pie1,2
bcf pie1,0
banksel pir1
goto loop_dsp
bsf portd,6
call sc
call mpy
call dev
goto loop_dsp
mpy
movf cunt,0
movwf cunt_back
mpy_loop
addwf cunt,0
btfss status,0
goto mpy_np
incf mpy_h
mpy_np
decfsz cunt_deg
goto mpy_loop
goto mpy_end
mpy_end
movwf mpy_l
return
;-----------cunt*30-------------
dev
clrf ge
clrf shi
clrf bai
movf cunt_pro,0
subwf mpy_l,1
btfsc status,0
goto dev_call
btfss flg,4
goto dev_nx
goto dev_return
dev_nx
decf mpy_h,1
btfsc status,2
goto dev_call
bsf flg,4
dev_call
call zh
goto dev
dev_return
return
;-------------除法程序------------
loop_dsp
movf ge,0
movwf temp_cunt
call table
movwf portb
call sc_ge
movf shi,0
movwf temp_cunt
call table
movwf portb
call sc_shi
movf bai,0
movwf temp_cunt
call table
movwf portb
call sc_bai
goto loop_next
;-----------动态显示----------------
io_reset
banksel trisc
movlw 0ffh
movwf trisc
movlw 00h
movwf trise
movwf trisd
movwf trisb
banksel portc
clrf portc
clrf portd
clrf portb
clrf porte
clrf ge
clrf shi
clrf bai
clrf flg
clrf time_cunt
call sc
return
;-----------io初始化---------------
int_reset
banksel intcon
movlw b'开总中断
movwf intcon
banksel pie1
movlw b'
movwf pie1;只允许tmr1,ccp未开中断
banksel pir1
movlw b'
movwf t1con;分频比1:8,不同步,关tmr1
movlw b'
movwf ccp1con
clrf pir1;清第二中断标志
clrf tmr1l
clrf tmr1h
return
;----------中断初始化--------------
zh
movlw 0ah
movwf temp
incf cunt,1;ccp中断计数器加1
incf ge,1 ;个位加1
movf temp,0
subwf ge,0
btfss status,2
goto zh_return
incf shi,1
clrf ge
movf temp,0
subwf shi,0
btfss status,2
goto zh_return
incf bai,1
clrf shi
movf temp,0
subwf bai,0
btfss status,2
goto zh_return
clrf ge
clrf shi
clrf bai
zh_return
return
;---------------计算转速-------------
time
decfsz cunt_time
goto int_ret
bsf flg,0;2s标志位置位
movlw 0ah
movwf cunt_time
return
;---------------2s定时-------------------
delay1ms: movlw 09fh
movwf 20h
lp01: movlw 0ffh
movwf 21h
lp11: movlw 02ch
movwf 22h
lp21: decfsz 22h
goto lp21
decfsz 21h
goto lp11
decfsz 20h
goto lp01
return
;----------1ms延时程序---------------
delay750us:
movlw 0ffh
movwf 26h
loop750
nop
nop
nop
nop
decfsz 26h,1
goto loop750
return
;----------750us延时程序----------------
delayn
nop
nop
nop
nop
nop
return
sc
movlw 06h
movwf porte
call delay750us
clrf porte
return
;--------374锁存程序--------------------
sc_ge
movlw 01h
movwf portd
movlw 06h
movwf porte
call delayn
clrf porte
return
;-------动态个位显示锁存----------------
sc_shi
movlw 02h
movwf portd
movlw 06h
movwf porte
call delayn
clrf porte
return
;-------动态十位显示锁存----------------
sc_bai
movlw 04h
movwf portd
movlw 06h
movwf porte
call delayn
clrf porte
return
;-------动态百位显示锁存----------------
table
movf temp_cunt,0
addwf pcl,1
retlw 0d7h
retlw 012h
retlw 0cbh
retlw 05bh
retlw 01eh
retlw 05dh
retlw 0ddh
retlw 013h
retlw 0dfh
retlw 05fh
;-----------显示解码程序-----------------
end