The processor interrupts work in AVR processors on the basis that (excluding other operations) after a given interrupt (
when operated by the processor ) the command is saved
the next one that would have been executed if the processor had not accepted the interrupt (its address in flash) and jump to one of the addresses from the very beginning of the flash. This given address is called the interrupt vector, i.e. the address at which the instruction counter jumps when the interrupt occurs. In place of this vector, enter a jump instruction to the point where the interrupt is handled.
The case is best seen at ASM. This program only supports one interrupt (TIM0_COMPA).
If you have questions, I will explain the details of this code and issues

{
remarks written in italics from a colleague of BlueDarco }
[syntax=asm]
/*
* Created: 2012-07-12 10:32:21
* Author: Piotr
*/
;dołączenie definicji procesora
.include "tn10def.inc"
;nazwa dla rejestru tymczasowego (x2)
.def temp = R17
.def temp2 = R18
;nazwa dla zmiennej licznika
.def ct = R19
;tablica przerwań (wektorów przerwań) jest umieszczona na samym początku pamięci flash (rozkazów). Zawsze pod adresem 0x0000 znajduje się wektor RESET który jest wywoływany przy starcie programu. Kolejne początkowe adresy (zgodnie z modelem procesora) zajmowane są przez wektory innych przerwań.
.org 0x0000
rjmp RESET ;RESET
reti ;INT0
reti ;PCINT0
reti ;TIM0_CAPT
reti ;TIM0_OVF
rjmp TIM0 ;TIM0_COMPA
reti ;TIM0_COMPB
reti ;ANA_COMP
reti ;WDT
reti ;VLM
reti ;ADC
;po resecie procesora
RESET:
ldi temp,low(RAMEND)
out SPL,temp
ldi temp,high(RAMEND)
out SPH,temp
;ustawiamy PB2 jako wyjście
SBI DDRB,PB2
;timer w tryb CTC, preskaler 1
ldi temp,(1