Posted by Jed Melendres on Thursday, July 3, 2014
; using RLF and RRF
; RRF = rotate bit to the right
; RLF = rotate bit to the left
; simulate using picsimulator ide 8xLED board
; mcu = pic16f84a
; this is a running lights
; set up pins
bsf status,5
movlw 0x00
movwf trisa
bcf status,5
movlw 0x32
movwf 0x21 ; store decimal value 50 to 0x21
;main program
main movlw 0x01
movwf porta
call delay
rlf porta,1 ; 1 is the destination register (porta)
; for the result of operation
call delay
rlf porta,1
call delay
rlf porta,1
call delay
rrf porta,1 ; move to the right
call delay
rrf porta,1
call delay
rrf porta,1
call delay
goto main
delay decfsz 0x20,1
goto delay
decfsz 0x21,1
goto delay
movlw 0x32
movwf 0x21
return
end