Pokusavao sam da predjem u bank0 pre odlaska u beskonacnu petlju, pokusavao sam da sacuvam vrednost vaznih registara i jos nekoliko stvari ali ne ide.
Evo listinga:
Code: Select all
; PROCESSOR PIC16F877
Z EQU 2
E EQU 3
RP1 EQU 6
RP0 EQU 5
RS EQU 2
TRISA EQU 5
TRISB EQU 6
PORTA EQU 5
PORTB EQU 6
STATUS EQU 3
INTCON EQU D'11'
OPTION_REG EQU 1
PCL EQU 2
CON EQU 0x20
TEMP_W EQU 0x2C
CHAR EQU 0x2D
TEMP EQU 0x2E
_CP_ON EQU H'000F'
_CP_OFF EQU H'3FFF'
_PWRTE_ON EQU H'3FF7'
_PWRTE_OFF EQU H'3FFF'
_WDT_ON EQU H'3FFF'
_WDT_OFF EQU H'3FFB'
_LP_OSC EQU H'3FFC'
_XT_OSC EQU H'3FFD'
_HS_OSC EQU H'3FFE'
_RC_OSC EQU H'3FFF'
__CONFIG _CP_OFF & _XT_OSC & _PWRTE_ON &_WDT_OFF
ORG 0X00
GOTO MAIN
ORG 0X04
GOTO PREKID
MAIN BSF STATUS,RP0
BCF STATUS,RP1
MOVLW B'00000010'
MOVWF TRISA
BCF STATUS,RP0
BCF STATUS,RP1
BSF PORTA,1
BSF STATUS,RP0
BCF STATUS,RP1
MOVLW B'00000100'
MOVWF OPTION_REG
MOVLW B'10100000'
MOVWF INTCON
CLRF CON
PETLJA GOTO PETLJA
PREKID MOVLW B'10100000'
MOVWF INTCON
INCF CON
MOVLW D'244'
SUBWF CON,W
BTFSC STATUS,Z
CALL SEK2
RETFIE
SEK2 SWAPF TRISA,F
RETURN
END
HVALA UNAPRED!