org 0030h
loop: mov p1,#0ffh
clr p1.7
call delay_1s
setb p1.7
clr p1.6
call delay_1s
setb p1.6
clr p1.5
call delay_1s
setb p1.5
clr p1.4
call delay_1s
setb p1.4
clr p1.3
call delay_1s
setb p1.3
clr p1.2
call delay_1s
setb p1.2
clr p1.1
call delay_1s
setb p1.1
clr p1.0
call delay_1s
setb p1.0
clr p1.0
call delay_1s
LJPM LOOP
delay_1s:
mov r1,#20
loop1: mov r3,#200
loop2: mov r4,#255
loop3: djnz r3,loop3
djnz r2,loop2
djnz r1,loop1
ret
end
loop: mov p1,#0ffh
clr p1.7
call delay_1s
setb p1.7
clr p1.6
call delay_1s
setb p1.6
clr p1.5
call delay_1s
setb p1.5
clr p1.4
call delay_1s
setb p1.4
clr p1.3
call delay_1s
setb p1.3
clr p1.2
call delay_1s
setb p1.2
clr p1.1
call delay_1s
setb p1.1
clr p1.0
call delay_1s
setb p1.0
clr p1.0
call delay_1s
LJPM LOOP
delay_1s:
mov r1,#20
loop1: mov r3,#200
loop2: mov r4,#255
loop3: djnz r3,loop3
djnz r2,loop2
djnz r1,loop1
ret
end
Comment