Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $regfile = "reg51.dat"
- $crystal = 12000000
- dim puluhan as byte
- dim satuan as byte
- p0 = lookup (puluhan , angka)
- p2 = lookup (satuan , angka)
- declare SUB tombol
- sub tombol:
- if p1.0 = 0 then goto naik
- if p1.1 = 0 then goto turun
- if p1.2 = 0 then goto mati
- end sub
- main:
- call tombol
- goto main
- naik:
- p0 = lookup (puluhan , angka)
- p2 = lookup (satuan , angka)
- incr satuan
- waitms 500
- if satuan > 9 then
- satuan = 0
- incr puluhan
- waitms 500
- if puluhan > 9 then
- satuan = 0
- puluhan = 0
- endif
- endif
- call tombol
- goto naik
- turun:
- p0 = lookup (puluhan , angka)
- p2 = lookup (satuan , angka)
- decr satuan
- waitms 500
- if satuan > 10 then
- satuan = 9
- decr puluhan
- waitms 500
- if puluhan > 10 then
- satuan = 9
- puluhan = 9
- endif
- endif
- call tombol
- goto turun
- mati:
- p0 = &hc0
- p2 = &hc0
- call tombol
- goto mati
- angka:
- data &hc0 , &hf9 , &ha4 , &hb0 , &h99
- data &h92 , &h82 , &hf8 , &h80 , &h90
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement