
isr0:
debouncer: jnb p3.2,debouncer
jb p3.7,ended
     MOV TMOD,#00100001B
       mov tl0,#0b0h
       mov th0,#03ch
       setb ET0
       setb TR0
	   mov 50h,#00h
	   mov 51h,#00h
	   mov 52h,#00h
	   setb it1
	   setb ex1
   clr it0
	clr ex0
	sjmp tended
ended: clr p3.7
    mov 60h, 50h
	mov 61h, 51h
	mov 62h, 52h
    clr it0
	clr ex0
tended:reti
isr1:
debouncer1: jnb p3.3,debouncer1
mov a, #00fh
 lcall n_delay
	   mov r4, 50h
	   cjne r4,#00h, get2nd
	   mov 50h, p1
	   sjmp Endpoll		  
get2nd: mov r4, 51h
      cjne r4,#00h, get3rd
	   mov 51h, p1
	   sjmp Endpoll
get3rd: mov r4, 52h
       cjne r4,#00h, Endpoll
	   mov 52h, p1
	setb p3.7
	    setb it0
	setb ex0
Endpoll:

reti
tmr0:
       mov tl0,#0B0h
       mov th0,#03Ch



xdec:   djnz counter20,EndInterrupt

       mov counter20,#40

	     mov 50h,#00h
	   mov 51h,#00h
	   mov 52h,#00h
		  clr p3.7
	    clr it1
		clr ex1
	    setb it0
		setb ex0
EndInterrupt: reti	