status equ 0x03
portc equ 0x07
trisc equ 0x87
delay_1 equ 0x20
delay_2 equ 0x21
__CONFIG 3F39
#include <p16f877a.inc>
start clrwdt
call sys_init
loop3 call rotate_left
call rotate_right
goto loop3
rotate_left movlw b'00000001'
movwf portc
loop rlf portc
call delay
btfss portc,7
goto loop
return
rotate_right
loop1 rrf portc
call delay
btfss portc,0
goto loop1
return
delay movlw .255
movwf delay_1
s2 decfsz delay_1
goto s1
return
s1 movlw .200
movwf delay_2
s3 decfsz delay_2
goto s3
goto s2
sys_init bsf status,5
clrf trisc
bcf status,5
clrf portc
return
end