Menampilkan Lampu Berkedip Secara Berurutan

Program ini diperintahkan untuk menampilkan lampu LED berkedip-kedip secara bergantian dan teratur


Start:  MOV P0,#11111111b
  Call Delay 
  MOV P0,#01111111b
  Call Delay 
  MOV P0,#00111111b
  Call Delay 
  MOV P0,#00011111b
  Call Delay 
  MOV P0,#00001111b
  Call Delay 
  MOV P0,#00000111b
  Call Delay 
  MOV P0,#00000011b
  Call Delay 
  MOV P0,#00000001b
  Call Delay 
  MOV P0,#00000000b
  Call Delay 
   Sjmp start
   Delay: MOV R1,#253
   Del1: MOV R2,#255
   Del2:  djnz R2,del2
          djnz R1,del1
  ret
end

Posting Komentar