Thay vì mình viết như trên,mình viết zj thầy co chấp nhận không anh?
;=====================
org 0h
main:
Clr p1.1
acall delay1s
acall delay1s
setb p1.1
acall delay1s
jmp main
;----------
mov r0,#20
;----------------------------------------- delay50ms-----------------------------------------------
delay50ms: Mov th0,#3ch
mov tl0,#0afh
setb tr0
jnb tf0,$
clr tr0
clr tf0
ret
;------------------------------------------------------------------------------------------------------------
;------------------------------------------delay 1s---------------------------------------------------
delay1s:
Call delay50ms
djnz r0,delay1s
ret
;-----------------------------------
end
;=====================
org 0h
main:
Clr p1.1
acall delay1s
acall delay1s
setb p1.1
acall delay1s
jmp main
;----------
mov r0,#20
;----------------------------------------- delay50ms-----------------------------------------------
delay50ms: Mov th0,#3ch
mov tl0,#0afh
setb tr0
jnb tf0,$
clr tr0
clr tf0
ret
;------------------------------------------------------------------------------------------------------------
;------------------------------------------delay 1s---------------------------------------------------
delay1s:
Call delay50ms
djnz r0,delay1s
ret
;-----------------------------------
end