setint %00000001,%00000001
led1on:
do if pina.1 = 1 then
high c.7 goto led2on
else loop endif
led2on: pause 500
do if pina.1 = 1 then
high c.6 goto led3on
endif
if pina.0 = 1 then
low c.7 goto led1on
else loop endif
led3on: pause 500
do if pina.1 = 1 then
high c.5 goto led4on
endif
if pina.0 = 1 then
low c.6 goto led2on
else loop endif
led4on: pause 500
do if pina.1 = 1 then
high c.4 goto led5on
endif
if pina.0 = 1 then
low c.5 goto led3on
else loop endif
led5on: pause 500
do if pina.1 = 1 then
high c.3 goto led6on
endif
if pina.0 = 1 then
low c.4 goto led4on
else loop endif
led6on: pause 500
do if pina.1 = 1 then
high c.2 goto led7on
endif
if pina.0 = 1 then
low c.3 goto led5on
else loop endif
led7on: pause 500
do if pina.1 = 1 then
high c.1 goto led8on
endif
if pina.0 = 1 then
low c.2 goto led6on
else loop endif
led8on: pause 500
do if pina.1 = 1 then
high a.3 goto led9on
endif
if pina.0 = 1 then
low c.1 goto led7on
else loop endif
led9on: pause 500
do if pina.1 = 1 then
high b.7 goto led10on
endif
if pina.0 = 1 then
low a.3 goto led8on
else loop endif
led10on: pause 500
do if pina.1 = 1 then
high b.6 goto led11on
endif
if pina.0 = 1 then
low b.7 goto led9on
else loop endif
led11on: pause 500
do if pina.1 = 1 then
high b.5 goto led12on
endif
if pina.0 = 1 then
low b.6 goto led10on
else loop endif
led12on: pause 500
do if pina.1 = 1 then
high b.4 goto led13on
endif
if pina.0 = 1 then
low b.5 goto led11on
else loop endif
led13on: pause 500
do if pina.1 = 1 then
high b.3 goto led14on
endif
if pina.0 = 1 then
low b.4 goto led12on
else loop endif
led14on: pause 500
do if pina.1 = 1 then
high b.2 goto led15on
endif
if pina.0 = 1 then
low b.3 goto led13on
else loop endif
led15on: pause 500
do if pina.1 = 1 then
high b.1 goto led16on
endif
if pina.0 = 1 then
low b.2 goto led14on
else loop endif
led16on: pause 500
do if pina.1 = 1 then
high b.0 goto led16off
endif
if pina.0 = 1 then
low b.1 goto led15on
else loop endif
led16off: pause 500
do if pina.0 = 1 then
low b.0 goto led16on
endif
if pina.1 = 1 then
goto overload
else loop endif
overload: pause 500
low c.7, c.6, c.5, c.4, c.3, c.2, c.1, a.3
low b.7, b.6, b.5, b.4, b.3, b.2, b.1, b.0
overload1:
high c.4, c.3 pause 300
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2 pause 300
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1 pause 300
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3 pause 300
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0 pause 250
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1 pause 250
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2 pause 250
if pina.0 = 1 then goto overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3 pause 250
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
high c.4, c.3 pause 200
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2 pause 200
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1 pause 200
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3 pause 200
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0 pause 150
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1 pause 150
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2 pause 150
if pina.0 = 1 then overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3 pause 150
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
high c.4, c.3 pause 150
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2 pause 150
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1 pause 150
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3 pause 150
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0 pause 100
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1 pause 100
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2 pause 100
if pina.0 = 1 then goto overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3 pause 100
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
high c.4, c.3 pause 100
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2 pause 100
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1 pause 100
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3 pause 100
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0 pause 50
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1 pause 50
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2 pause 50
if pina.0 = 1 then goto overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3 pause 50
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
high c.4, c.3 pause 50
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2 pause 50
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1 pause 50
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3 pause 50
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0 pause 10
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1 pause 10
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2 pause 10
if pina.0 = 1 then goto overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3 pause 10
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
high c.4, c.3 pause 10
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2 pause 10
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1 pause 10
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3 pause 10
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0 pause 10
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1 pause 10
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2 pause 10
if pina.0 = 1 then goto overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3 pause 10
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
high c.4, c.3
if pina.0 = 1 then goto overloadoff
low c.4, c.3
if pina.0 = 1 then goto overloadoff
high c.5, c.2
if pina.0 = 1 then goto overloadoff
low c.5, c.2
if pina.0 = 1 then goto overloadoff
high c.6, c.1
if pina.0 = 1 then goto overloadoff
low c.6, c.1
if pina.0 = 1 then goto overloadoff
high c.7, a.3
if pina.0 = 1 then goto overloadoff
low c.7, a.3
if pina.0 = 1 then goto overloadoff
high b.7, b.0
if pina.0 = 1 then goto overloadoff
low b.7, b.0
if pina.0 = 1 then goto overloadoff
high b.6, b.1
if pina.0 = 1 then goto overloadoff
low b.6, b.1
if pina.0 = 1 then goto overloadoff
high b.5, b.2
if pina.0 = 1 then goto overloadoff
low b.5, b.2
if pina.0 = 1 then goto overloadoff
high b.4, b.3
if pina.0 = 1 then goto overloadoff
low b.4, b.3
if pina.0 = 1 then goto overloadoff
overloadoff: pause 500
low c.7, c.6, c.5, c.4, c.3, c.2, c.1, a.3
low b.7, b.6, b.5, b.4, b.3, b.2, b.1, b.0
high c.7, c.6, c.5, c.4, c.3, c.2, c.1, a.3
high b.7, b.6, b.5, b.4, b.3, b.2, b.1, b.0
goto led16off
interrupt:
high a.2
if pinc.0 = 1 then interrupt
setint %00000001,%00000001
low a.2
return