$regfile = "m16def.dat"
$crystal = 4000000
Config Porta = Input
Config Portc = Output
'-------------------
Do
If Pina.0 = 1 Then
Portc.0 = 1
Portc.1 = 0
Portc.2 = 0
Else
'----------------------
If Pina.1 = 1 And Pina.0 = 0 Then
Portc.0 = 0
Portc.1 = 1
Portc.2 = 0
Else
'----------------------
If Pina.2 = 1 And Pina.1 = 0 And Pina.0 = 0 Then
Portc.0 = 0
Portc.1 = 0
Portc.2 = 1
Else
Portc.0 = 0
Portc.1 = 0
Portc.2 = 0
End If
End If
End If
Loop
End                                                         'end program