ORG 0000H
LJMP START
ORG 000BH
LJMP Timer0Interrupt
START:
MOV SP,#60H
LCALL InitTimer0
LOOP:
;add your code here!
LJMP LOOP
InitTimer0:
MOV TMOD,#00H
MOV TH0,#1CH
MOV TL0,#18H
SETB EA
SETB ET0
SETB TR0
RET
Timer0Interrupt:
PUSH DPH
PUSH DPL
PUSH ACC
MOV TH0,#1CH
MOV TL0,#18H
setb rs0
setb rs1
;========================
cpl p1.0
inc r6
cjne r6,#250,T0_EXIT
cpl p1.1
mov r6,#0
;========================
T0_EXIT:
POP ACC
POP DPL
POP DPH
RETI
END