ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV A,#0FEH
MOV R2,#8
LOOP:
MOV P1,A
RL A
CLR P3.0
MOV R3,#1
LCALL DELAY
SETB P3.0
MOV R3,#9
LCALL DELAY
DJNZ R2,LOOP ;左流水
MOV R2,#8
LOOP1:
RR A
MOV P1,A
CLR P3.0
MOV R3,#1
LCALL DELAY
SETB P3.0
MOV R3,#9
LCALL DELAY
DJNZ R2,LOOP ;右流水
LJMP MAIN
DELAY:
MOV R4,#200
DLY:
MOV R5,#250
DJNZ R5,$
DJNZ R4,DLY
DJNZ R3,DELAY
RET
END
指定了时间,就应该提供晶振频率。