init
; PortX 0,1 encoder bemenet
movwf alt
movlw B'00000011'
andwf alt, f
.
.
.
.
start
.
call encoder_olvasas
.
movfw count  ; count tartalmát írjuk ki az LCD-re
call LCD
goto start
.
.
encoder_olvasas
movfw encoder_port  ;Port olvasás
movwf uj            ;Porttartalom beírása új-ba
movlw B'00000011'
andwf uj,f
movfw uj
movwf temp
movfw regi
xorwf temp,w
btfsc STATUS,Z
goto vege 
bcf regi,1
clrc 
rlf regi,f 
movfw uj
xorwf regi,f
btfsc STATUS,Z
goto sz_le
decf regi,f
btfsc STATUS,Z
goto sz_le
sz_fel
incf count,f
goto iras
sz_le
decf count,f
iras
movfw uj
movwf regi
vege
return
.
.
.
