Таёта-минус на централку PIC.asm

 

 

LIST        P=16F628A
            INCLUDE     P16F628A.INC
            __CONFIG    _INTOSC_OSC_NOCLKOUT&_WDT_ON&_PWRTE_ON&_MCLRE_OFF&_LVP_OFF
            ERRORLEVEL  -302
            CBLOCK      20H
            TEMP
            J
            K
            ENDC
BANK0       MACRO
            BCF         STATUS,RP0
            BCF         STATUS,RP1
            ENDM
BANK1       MACRO
            BSF         STATUS,RP0
            BCF         STATUS,RP1
            ENDM
            ORG         0
            GOTO        START
START       MOVLW       7
            MOVWF       CMCON
            BANK1
            MOVLW       0
            MOVWF       TRISA
            BANK0
            MOVLW       .255
            MOVWF       PORTA
MAIN        CLRWDT
            BANK1
            BSF         TRISB,1
            BSF         TRISB,0
            BCF         TRISB,2
            BCF         TRISB,3
            BANK0
            BCF         PORTB,2
            BSF         PORTB,3
CHECK1      CLRWDT
            BTFSC       PORTB,0
            GOTO        MAIN
            CALL        DELAY3SEC
            BTFSC       PORTB,0
            GOTO        CHECK1
            CLRWDT
            BANK1
            BCF         TRISB,1
            BANK0
            BCF         PORTB,1
            BSF         PORTB,2
            BCF         PORTB,3
CHECK       CLRWDT
            BTFSS       PORTB,0
            GOTO        CHECK
            CALL        DELAY
            CALL        DELAY
            CALL        DELAY
            BTFSS       PORTB,0
            GOTO        CHECK
            GOTO        MAIN
            
            
            
DELAY       MOVLW       .255
            MOVWF       J
JLOOP       MOVLW       .255
            MOVWF       K
KLOOP       CLRWDT
            DECFSZ      K,F
            GOTO        KLOOP
            CLRWDT
            DECFSZ      J,F
            GOTO        JLOOP
            RETURN
DELAY3SEC   MOVLW       .15
            MOVWF       TEMP
TLOOP       CLRWDT
            CALL        DELAY
            DECFSZ      TEMP,F
            GOTO        TLOOP
            RETURN
            END