LED EQU 30H
ORG 0000H
LJMP MAIN
ORG 000BH
LJMP T0ISR
ORG 0030H
MAIN:
MOV TMOD,#01H
MOV TH0,#3CH
MOV TL0,#0B0H
SETB TR0
SETB ET0
SETB EA
MOV LED,#0FEH
MOV R2,#0
CLR 00H
SJMP $
T0ISR:
CLR TR0
MOV TH0,#3CH
MOV TL0,#0B0H
SETB TR0
CPL 00H
JB 00H,T0ISR1
MOV P0,LED
MOV A,LED
RL A
INC R2
MOV A,R2
CJNE A,#4,T0ISR2
MOV R2,#0
MOV LED,#0FEH
T0ISR2:
RETI
T0ISR1:
MOV P0,#0FFH
RETI