Effect2:
mov r1,#5
start2:
mov a,#0FFh
port0:
rlc a
lcall sdelay
mov P0,a
cjne a,#00h,port0
mov a,#0FFh
port1:
rlc a
lcall sdelay
mov P1,a
cjne a,#00h,port1
mov a,#0FFh
port2:
rlc a
lcall sdelay
mov P2,a
cjne a,#00h,port2
mov a,#0FFh
port3:
rlc a
lcall sdelay
mov P3,a
cjne a,#00h,port3
lcall sdelay
lcall off ;turn off
djnz r1,start2
ret
off:
mov a,#0FFh ;turn all led off
mov P0,a
mov P1,a
mov P2,a
mov P3,a
ret
sdelay: ;short delay subroutine
mov r7,#150
L1: mov r6,#100
L2: mov r5,#2
L3: djnz r5,$
djnz r6,L2
djnz r7,L1
ret