Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Led Trái Tim

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

org 000H

Main:
CALL CT1
CALL CT3
CALL CT2

JMP Main
;=======================================
CT1: ;Sang Vong;
MOV P0, #00H
MOV P1, #00H
MOV P2, #00H
MOV P3, #00H
MOV A, #00H
L1: SETB C
RLC A
MOV P0, A
CALL Delay
CJNE A, #0FFH, L1
MOV A, #00H
L2: SETB C
RLC A
MOV P1, A
CALL Delay
CJNE A, #0FFH, L2
MOV A, #00H
L3: SETB C
RLC A
MOV P2, A
CALL Delay
CJNE A, #0FFH, L3
MOV A, #00H
L4: SETB C
RLC A
MOV P3, A
CALL Delay
CJNE A, #0FFH, L4
MOV A, #00H
ret
CT2:
mov A, #0feH

mov p0, #00H ; on


mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
mov p0, #00H ; on
mov p1, #00H ; on
mov p2, #00H ; on
mov p3, #00H ; on
call Delay
mov p0, #0ffH ;off
mov p1, #0ffH ;off
mov p2, #0ffH ;off
mov p3, #0ffH ;off
call Delay
ret
CT3:
mov A, #0feH
Lap:
mov p0, #00H ; on
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
mov p0, #00H
Lap1:
mov p1, #00H ; on
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
mov p0, #00H
Lap2:
mov p2, #00H ; on
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
mov p0, #00H
Lap3:
mov p3, #00H ; on
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
call Delay
jmp CT2
ret
;==============DELAY==============
Delay: MOV R1, #200
Loop1: MOV R0, #200
Loop2: NOP
NOP
DJNZ R0, Loop2
DJNZ R1, Loop1
ret
end

You might also like