'--pamiec.bas--Raczej-inteligentny-program--(; 'by Kamil Nowinski 'enjoy! '-------------------------------------------------------------- $regfile = "m8def.dat" $crystal = 1000000 Config Portd = Output Portd = &B00000000 Config Portb = Input Portb = &B00000000 Sw_a Alias Portb.0 Sw_b Alias Portb.1 Sw_c Alias Portb.2 Sw_d Alias Portb.3 Zatwierdz Alias Portb.4 Restart Alias Portb.5 Dioda Alias Portd.0 Dim Pamiec As Byte Pamiec = &B00000000 Dim Pamiec_a As Byte Pamiec_a = &B00000000 Do If Sw_a = 1 Then Pamiec = &B00000001 End If If Sw_b = 1 Then Pamiec = Pamiec + &B00000010 End If If Sw_c = 1 Then Pamiec = Pamiec + &B00000100 End If If Sw_d = 1 Then Pamiec = Pamiec + &B00001000 End If If Restart = 1 Then Pamiec_a = &B00000000 Pamiec = &B00000000 End If If Zatwierdz = 1 Then Gosub Pisz End If Loop End Pisz: Do If Sw_a = 1 Then Pamiec_a = Pamiec_a + &B00000001 End If If Sw_b = 1 Then Pamiec_a = Pamiec_a + &B00000010 End If If Sw_c = 1 Then Pamiec_a = Pamiec_a + &B00000100 End If If Sw_d = 1 Then Pamiec_a = Pamiec_a + &B00001000 End If If Zatwierdz = 1 Then Gosub Sprawdzaj End If Loop End Sprawdzaj: Do If Pamiec = Pamiec_a Then Dioda = 1 Wait 2 End If If Restart = 1 Then Pamiec_a = &B00000000 Pamiec = &B00000000 End If If Restart = 1 Then Return Loop End