I have 14 bytes & needs to shift them Left or Right when I want.But the New_Data must feed into the last feed.
Is there any compact way of writing this than below?
Is there any compact way of writing this than below?
Code:
cblock 20h
Led1,Led2,Led3,Led4,Led5,Led6,Led7,Led8,Led9,Led10,Led11,Led12,Led13,Led14
endc
Left_Shift_14X movlw Led2 ;2nd Led
movwf FSR
movlw .13
movwf Temp
Left_Shift_14X_Loop movf INDF,W
decf FSR,F
movwf INDF
incf FSR,F
incf FSR,F
decfsz Temp,F
goto Left_Shift_14X_Loop
movf New_Data,W
movwf Led14
return
Right_Shift_14X movlw Led13 ;13th Led
movwf FSR
movlw .13
movwf Temp
Right_Shift_14X_Loop movf INDF,W
incf FSR,F
movwf INDF
decf FSR,F
decf FSR,F
decfsz Temp,F
goto Right_Shift_14X_Loop
movf New_Data,W
movwf Led1
return