|
list p=16F84 status equ 03h cblock 0x0c init_porta equ b'00000000' call init int_point org 0x004 movwf w_temp btfss portb,0 retint init end
E-mail:
info@telesys.ru
#include
__CONFIG _CP_OFF & _WDT_OFF& _PWRTE_ON & _LP_OSC
trisb equ 086h
trisa equ 085h
porta equ 05h
portb equ 06h
intcon equ h'000b'
rp0 equ 5
option_reg equ h'0081'
w_temp
status_temp
endc
init_portb equ b'00000000'
init_option equ b'00000100'
init_intcon equ b'10100000'
goto $
swapf status,0
movwf status_temp
bcf intcon,2
goto on
bcf portb,0
goto retint
on
bsf portb,0
swapf status_temp,0
movwf status
swapf w_temp,1
swapf w_temp,0
retfie
bsf status,rp0
movlw init_porta
movwf trisa^80h
movlw init_portb
movwf trisb^80h
movlw init_option
movwf option_reg^80h
bcf status,rp0
movlw init_intcon
movwf intcon
clrf status
return
Ответы