$regfile = "at26def.dat" $crystal = 1000000 Config Porta = Output Dim N As Byte Declare Sub Routine(byval N As Byte) For N = 1 To 8 Call Routine(n) Waitms 500 Porta = 0 Waitms 500 Next N Porta = 0 End Sub Routine(byval N As Byte) N = 2 ^ N Porta = N - 1 End Sub