C language program which uses the timer overflow interrupt

#include "hc12.h"

main()
{
    DDRA = 0xff;        /* Make Port A output */
    TSCR = 0x80;        /* Turn on timer */
    TMSK2 = 0x84;       /* Enable timer overflow interrupt, set prescaler */
    TFLG2 = 0x80;       /* Clear timer interrupt flag */
    enable();           /* Enable interrupts (clear I bit) */
    while (1);          /* Do nothing */
}

@interrupt void toi_isr(void)
{
    PORTA = PORTA + 1;  /* Increment Port A */
    TFLG2 = 0x80;       /* Clear timer interrupt flag */
}