LED EQU 30H
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV LED,#0FEH
MOV R2,#1
LOOP:
MOV A,LED
MOV P1,A
LCALL DELAY
PUSH 02H
SHAN:
MOV P1,#0FFH
LCALL DELAY
MOV P1,A
LCALL DELAY
DJNZ R2,SHAN
POP 02H
INC R2
CLR C
RLC A
MOV LED,A
JNZ LOOP
SJMP $
DELAY:
MOV R3,#250
DLY:
MOV R4,#250
DJNZ R4,$
DJNZ R3,DLY
RET
END