.include "d:\edu\edu3\m8def.inc"

.def temp = r16

.cseg
.org 0

rjmp reset
rjmp int_0

reset:
      ldi temp,low(RAMEND)
      out spl,temp
      ldi temp,high(RAMEND)
      out sph,temp

	  sei
	  ldi temp,0b01000000 ;int0
	  out gicr,temp
	  ldi temp,0b00000001 ;any logical change 
	  out mcucr,temp
	 

inf: rjmp inf

int_0:
      in temp,pind2
	  cpi temp,1
	  breq on
	  
off:
    ser temp
	out ddrb,temp
	clr temp
	out portb,temp
	reti
on:
   ser temp
   out ddrb,temp
   out portb,temp
   reti
       



	  


      

	   







