;Compiliert mit PIC-BASIC-1.3 am 15.9.02 um 15:38:09 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 0
MOVWF HWERT1
MOVLW 150
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 24
BTFSC 11,1
CALL INT°
MOVLW 0
MOVWF HWERT1
MOVLW 150
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 23
BTFSC 11,1
CALL INT°
MOVLW 6
MOVWF FSR
MOVLW 1
CALL LO°
BTFSC 11,1
CALL INT°
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
SNL19°:
MOVF HWERT2,W
CALL SNT19°
MOVWF HWERT1
INCF HWERT1,W
BTFSC STATUS,2
GOTO SNE19°
INCF HWERT2,W
MOVWF HWERT2
CALL SNT19°
MOVWF LWERT1
CALL SND°
INCF HWERT2,F
GOTO SNL19°
SNT19°:
ADDWF PCOUNT,F
RETLW 11
RETLW 218
RETLW 1
RETLW 224
RETLW 255
SNE19°:
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°
DO25°:
BTFSC 11,1
CALL INT°
INCF 24,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 180
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,4
GOTO DO25°
Y25°:
BTFSC 11,1
CALL INT°
DO32°:
BTFSC 11,1
CALL INT°
DECF 23,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
COMF 23,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 110
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,5
GOTO DO32°
Y32°:
BTFSC 11,1
CALL INT°
DO40°:
BTFSC 11,1
CALL INT°
DECF 24,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 120
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,5
GOTO DO40°
Y40°:
BTFSC 11,1
CALL INT°
DO47°:
BTFSC 11,1
CALL INT°
INCF 23,F
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
COMF 23,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
BTFSC 11,1
CALL INT°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
BTFSC 11,1
CALL INT°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 190
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,4
GOTO DO47°
Y47°:
BTFSC 11,1
CALL INT°
GOTO NAPREJ
INT°:
BCF 11,1
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
MOVLW 100
MOVWF LWERT2
CLRF LWERT1
CALL BEEP°
MOVF 24,W
MOVWF LWERT1
CLRF HWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 140
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSC LTMP,1
GOTO MINUS
MOVF 24,W
MOVWF LWERT1
CLRF HWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 140
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSC LTMP,2
GOTO PLUS
MINUS:
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
MOVLW 231
MOVWF LWERT1
MOVLW 226
MOVWF HWERT1
CALL SND°
DO67°:
DECF 24,F
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 140
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,5
GOTO DO67°
Y67°:
PLUS:
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
MOVLW 218
MOVWF LWERT1
MOVLW 226
MOVWF HWERT1
CALL SND°
DO75°:
INCF 24,F
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 140
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,4
GOTO DO75°
Y75°:
VRTI:
MOVLW 0
MOVWF HWERT1
MOVLW 0
MOVWF LWERT1
MOVF LWERT1,W
MOVWF 25
DO85°:
INCF 25,F
DO89°:
DECF 23,F
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
MOVLW 255
MOVWF HWERT1
COMF 23,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 110
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,5
GOTO DO89°
Y89°:
DO96°:
INCF 24,F
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 150
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,4
GOTO DO96°
Y96°:
DO102°:
INCF 23,F
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
MOVLW 255
MOVWF HWERT1
COMF 23,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 2
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 23,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 190
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,4
GOTO DO102°
Y102°:
DO109°:
DECF 24,F
MOVLW 255
MOVWF HWERT1
COMF 24,W
MOVWF LWERT1
MOVLW 6
MOVWF FSR
MOVLW 4
CALL PULSO°
MOVLW 255
MOVWF HWERT1
MOVLW 241
MOVWF LWERT1
CALL PAUSE°
CLRF HWERT1
MOVF 24,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 140
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,5
GOTO DO109°
Y109°:
CLRF HWERT1
MOVF 25,W
MOVWF LWERT1
MOVLW 0
MOVWF HWERT2
MOVLW 2
MOVWF LWERT2
CALL IFT°
MOVWF LTMP
BTFSS LTMP,4
GOTO DO85°
Y85°:
MOVLW 6
MOVWF FSR
MOVLW 8
MOVWF LTMP
CALL OUT°
MOVLW 100
MOVWF LWERT2
CLRF LWERT1
CALL BEEP°
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 576 Byte im Programmspeicher.

Die deklarierten Variablen belegen folgende Register:
K = R23
N = R24
X = R25