Advertisement
kabulaewis

paket 3

Feb 17th, 2016
3,661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $regfile = "reg51.dat"
  2. $crystal = 12000000
  3.  
  4. Declare Sub Tombol1
  5. Declare Sub Tombol2
  6. Declare Sub Tombol3
  7.  
  8. Sub Tombol1:
  9. If P1.0 = 0 Then Goto Nyala1
  10. If P1.1 = 0 Then Goto Nyala2
  11. If P1.2 = 0 Then Goto Mati
  12. End Sub
  13.  
  14. Sub Tombol2:
  15. If P1.0 = 0 Then Goto Nyala1
  16. If P1.1 = 0 Then Goto Nyala3
  17. If P1.2 = 0 Then Goto Mati
  18. End Sub
  19.  
  20. Sub Tombol3:
  21. If P1.0 = 0 Then Goto Nyala4
  22. If P1.1 = 0 Then Goto Nyala2
  23. If P1.2 = 0 Then Goto Mati
  24. End Sub
  25.  
  26. Main:
  27. Call Tombol1
  28. Goto Main
  29.  
  30. Nyala1:
  31. P0 = &B00000001
  32. Call Tombol2
  33. Goto Nyala1:
  34.  
  35. Nyala2:
  36. P0 = &B00000010
  37. Call Tombol3
  38. Goto Nyala2
  39.  
  40. Nyala3:
  41. P0 = &B00000011
  42. Call Tombol2
  43. Goto Nyala3
  44.  
  45. Nyala4:
  46. P0 = &B00000011
  47. Call Tombol3
  48. Goto Nyala4
  49.  
  50. Mati:
  51. P0 = &B00000000
  52. Call Tombol1
  53. Goto Mati
  54.  
  55. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement