ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV R2,#3
MOV A,#0FEH
LOOP:
MOV P1,A
LCALL DELAY
RL A
DJNZ R2,LOOP
MOV P1,#0FFH
SJMP $
DELAY:
MOV R3,#10
DLY1:
MOV R4,#100
DLY2:
MOV R5,#250
DJNZ R5,$
DJNZ R4,DLY2
DJNZ R3,DLY1
RET
END
想要定时,先要说清楚,你用的晶振频率是多少。