chinh? lại giúp em cái! ^_^ sao nó cứ chạy hoài àh! giúp em chỉnh cho nó chạy 1 lần giúp em
org 0000h
saochoi: mov p0,#0ffh
mov p1,#0ffh
mov p2,#0ffh
mov p3,#0ffh
mov r3,1
setb c
lap9: mov a,p0
rlc a
mov p0,a
MOV A,P2
RRC A
MOV P2,A
MOV A,P3
RRC A
MOV P3,A
MOV A,P1
RRC A
MOV P1,A
lcall delay2
dec r3
cjne r3,#0,tieptuc
jmp saochoi
tieptuc: mov a,r3
mov b,#2
div ab
mov a,b
cjne a,#0,nhan
setb c
jmp LAP9
nhan: clr c
jmp LAP9
delay2: mov r5,#255
lap99: mov r6,#255
djnz r6,$
djnz r5,lap99
ret
end
org 0000h
saochoi: mov p0,#0ffh
mov p1,#0ffh
mov p2,#0ffh
mov p3,#0ffh
mov r3,1
setb c
lap9: mov a,p0
rlc a
mov p0,a
MOV A,P2
RRC A
MOV P2,A
MOV A,P3
RRC A
MOV P3,A
MOV A,P1
RRC A
MOV P1,A
lcall delay2
dec r3
cjne r3,#0,tieptuc
jmp saochoi
tieptuc: mov a,r3
mov b,#2
div ab
mov a,b
cjne a,#0,nhan
setb c
jmp LAP9
nhan: clr c
jmp LAP9
delay2: mov r5,#255
lap99: mov r6,#255
djnz r6,$
djnz r5,lap99
ret
end
Comment