easiest way
Code:Flag var byte wsave VAR BYTE $70 SYSTEM ; alternate save location for W enc_new VAR BYTE enc_old VAR BYTE enc_counter VAR WORD
Code:asm ;Read latest input from PORTB & put the value in _enc_new. MOVE?CB 1 ,_Flag movf PORTB,W movwf _enc_new ;Strip off all but the 2 MSBs in _enc_new. movlw B'11000000' ;Create bit mask (bits 7 & 6). andwf _enc_new,F ;Zero bits 5 thru 0. ;Determine the direction of the
Bookmarks