Объявлять переменные нужно в начале программы!
Code
DEFINE _OSC4_ _BUTTON_PAUSE 20
OPTION_REG.7 = 0
input PORTB.0
output PORTA.0
output PORTA.1
output PORTA.2
output PORTA.3
KN VAR PORTB.0
SV VAR PORTA.0
LED VAR PORTA.1
PRD VAR PORTA.2
SOU VAR PORTA.3
j var byte '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTCON.4 = 1
PAUSE 100
main:
enable
on interrupt goto int1
SV = 0
LED = 1
pause 50
goto main
DISABLE
int1:
SV = 1
LED = 0
pause 60000:freqout sou,300,800:pause 200:freqout sou,300,800
sou = 0
pause 6000
sv = 0
for j = 255 to 0 step -2
pwm sv,j,24
next j
INTCON.1 = 0
resume