'for buttons
loop:
if portb.0=0 then goto b1
if portb.1=0 then goto b2
if portb.2=0 then goto b3
if portb.3=0 then goto b4
if portb.4=0 then goto b5
if portb.5=0 then goto b6
if portb.6=0 then goto b7
if portb.7=0 then goto b8
goto loop

'for actions
b1:
high portd.0
gosub bekle
goto loop

b2:
high portd.1
gosub bekle
goto loop

b3:
high portd.2
gosub bekle
goto loop

b4:
high portd.3
gosub bekle
goto loop

b5:
high portd.4
gosub bekle
goto loop

b6:
high portd.5
gosub bekle
goto loop

b7:
high portd.6
gosub bekle
goto loop

b8:
high portd.7
gosub bekle
goto loop

bekle:
pause 1000
RETURN

end