;Compiliert mit PIC-BASIC-1.3 am 4.8.99 um 16:50:16 Uhr

; Oszillatorfrequenz = 4000kHz

errorlevel 0, -224
List P=16F84, R=DEC, N=999
__CONFIG B'11111111110001' ;CP, /PWRTE, WDTE, FOSC1, FOSC0

INDAD = 0
PCOUNT = 2
STATUS = 3
FSR = 4
PA = 5
PB = 6
PCH = 10
LTMP = 12
HTMP = 13
LWERT1 = 14
HWERT1 = 15
LWERT2 = 16
HWERT2 = 17
LWERT3 = 18
HWERT3 = 19
COUNT = 20

ORG 0

CLRF 5
CLRF 6
MOVLW B'10111111' ;Interupt bei fallender Flanke
OPTION
BSF 11,4 ;Wecken ermöglichen

ORG 5

MOVLW 6
MOVWF FSR
MOVLW 2
CALL LO°
BTFSC 11,1
CALL INT°
MOVLW 6
MOVWF FSR
MOVLW 4
CALL LO°
BTFSC 11,1
CALL INT°
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
CLRF HWERT2
MOVLW 0
MOVWF PCH
SNL17°:
MOVF HWERT2,W
CALL SNT17°
MOVWF HWERT1
INCF HWERT1,W
BTFSC STATUS,2
GOTO SNE17°
INCF HWERT2,W
MOVWF HWERT2
CALL SNT17°
MOVWF LWERT1
CALL SND°
INCF HWERT2,F
GOTO SNL17°
SNT17°:
ADDWF PCOUNT,F
RETLW 164
RETLW 218
RETLW 195
RETLW 224
RETLW 255
SNE17°:
BTFSC 11,1
CALL INT°
MOVLW 252
MOVWF HWERT1
MOVLW 24
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
MOVLW 100
MOVWF LWERT2
CLRF LWERT1
CALL BEEP°
NAPREJ:
BTFSC 11,1
CALL INT°
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 24
BTFSC 11,1
CALL INT°
DO25°:
BTFSC 11,1
CALL INT°
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
BTFSC 11,1
CALL INT°
DO28°:
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
INCF 23,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 25
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO28°
Y28°:
BTFSC 11,1
CALL INT°
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
BTFSC 11,1
CALL INT°
DO37°:
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
INCF 23,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 25
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO37°
Y37°:
BTFSC 11,1
CALL INT°
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
BTFSC 11,1
CALL INT°
DO46°:
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
INCF 23,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 25
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO46°
Y46°:
BTFSC 11,1
CALL INT°
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
BTFSC 11,1
CALL INT°
DO55°:
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
INCF 23,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 25
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO55°
Y55°:
BTFSC 11,1
CALL INT°
INCF 24,F
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 10
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO25°
Y25°:
BTFSC 11,1
CALL INT°
GOTO NAPREJ
INT°:
BCF 11,1
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
CLRF HWERT2
MOVLW 1
MOVWF PCH
SNL69°:
MOVF HWERT2,W
CALL SNT69°
MOVWF HWERT1
INCF HWERT1,W
BTFSC STATUS,2
GOTO SNE69°
INCF HWERT2,W
MOVWF HWERT2
CALL SNT69°
MOVWF LWERT1
CALL SND°
INCF HWERT2,F
GOTO SNL69°
SNT69°:
ADDWF PCOUNT,F
RETLW 195
RETLW 218
RETLW 226
RETLW 224
RETLW 255
SNE69°:
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
MOVLW 100
MOVWF LWERT2
CLRF LWERT1
CALL BEEP°
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 24
DO73°:
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
DO76°:
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
INCF 23,F
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 15
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO76°
Y76°:
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
DO84°:
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
INCF 23,F
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 15
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO84°
Y84°:
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
DO92°:
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
INCF 23,F
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 15
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO92°
Y92°:
MOVLW 0
MOVWF HWERT1
MOVLW 1
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
DO100°:
MOVLW 255
MOVWF HWERT1
MOVLW 136
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 76
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
INCF 23,F
MOVLW 255
MOVWF HWERT1
MOVLW 246
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 15
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO100°
Y100°:
INCF 24,F
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 3
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,0
GOTO DO73°
Y73°:
BTFSC 11,1
GOTO INT°
RETURN


;-------------------

LO°:
XORLW 255
ANDWF INDAD,F
BSF FSR,7
ANDWF INDAD,F
BCF FSR,7
RETURN

OUT°:
XORLW 255
BSF FSR,7
ANDWF INDAD,F
BCF FSR,7
RETURN

PULSO°:
MOVWF LTMP
XORWF INDAD,F
PO1°:
GOTO PO2°
PO2°:
GOTO PO3°
PO3°:
NOP
INCF LWERT1,F
BTFSC STATUS,2
INCFSZ HWERT1,F
GOTO PO1°
MOVF LTMP,W
XORWF INDAD,F
RETURN

PAUSE°:
MOVLW 248
MOVWF LTMP
P2°:
NOP
DECFSZ LTMP,F
GOTO P2°
GOTO P3°
P3°:
INCF LWERT1,F
BTFSC STATUS,2
INCFSZ HWERT1,F
GOTO PAUSE°
RETURN

IFT°:
CLRF LTMP
MOVF LWERT2,W
SUBWF LWERT1,W
BTFSC STATUS,2
BSF LTMP,0
MOVF HWERT2,W
BTFSC STATUS,0
GOTO IF1°
INCF HWERT2,W
BTFSC STATUS,2
RETLW B'00101100'
IF1°:
SUBWF HWERT1,W
BTFSS STATUS,0
RETLW B'00101100'
BTFSS LTMP,0
RETLW B'00011010'
BTFSS STATUS,2
RETLW B'00011010'
RETLW B'00110001'

SND°:
MOVF LTMP,W
MOVWF HTMP
MOVF LWERT1,W
MOVWF LWERT2
BTFSC STATUS,2
CLRF HTMP
SNL°:
MOVF HTMP,W
INCFSZ LWERT2,F
ANDLW 0
XORWF INDAD,F
MOVF LWERT2,W
BTFSC STATUS,2
MOVF LWERT1,W
MOVWF LWERT2
INCF COUNT,F
BTFSC STATUS,2
INCFSZ HWERT1,F
GOTO SNL°
RETURN

BEE°:
DECFSZ HTMP,F
GOTO BEE°
BEEP°:
MOVF LWERT2,W
MOVWF HTMP
MOVF LTMP,W
XORWF INDAD,F
DECFSZ LWERT1,F
GOTO BEE°
RETURN

END


Der Text belegt 598 Byte im Programmspeicher.

Die deklarierten Variablen belegen folgende Register:
X = R23
Y = R24