LIST P=PIC16F84A INCLUDE "P16F84A.INC" tm1 EQU 0CH ; tm2 EQU 0DH ; tm3 EQU 0EH ; org 0 goto start org 4 goto start org 5 start bsf STATUS,RP0 clrf TRISA clrf TRISB bsf TRISA,0 bsf TRISA,1 bcf STATUS,RP0 movlw 0x80 movwf portb main btfss porta,1 goto tsugi goto main tsugi call wait05 bcf status,C btfsc portb,7 bsf status,C rlf portb,F btfss porta,0 goto main goto tsugi ;以下0.5秒ルーチン tim05 movlw 063H movwf tm1 wait1 nop nop decfsz tm1,F goto wait1 return tim100 movlw 0c7H movwf tm2 wait2 call tim05 decfsz tm2,F goto wait2 return wait05 movlw 5 movwf tm3 wait3 call tim100 decfsz tm3,F goto wait3 return end