Atmega8 V-Usb TIMSK0 compile error

Hello!

I have tried the USBKeyboard example from the v-usb library (Google Code Archive - Long-term storage for Google Code Project Hosting.) on an Atmega8 with a 16mhz crystal

#include "UsbKeyboard.h"

#define BUTTON_PIN 12

// If the timer isr is corrected
// to not take so long change this to 0.
#define BYPASS_TIMER_ISR 1

void setup() {
  pinMode(BUTTON_PIN, INPUT);
  digitalWrite(BUTTON_PIN, HIGH);
  
#if BYPASS_TIMER_ISR
  // disable timer 0 overflow interrupt (used for millis)
  TIMSK0&=!(1<<TOIE0); // ++
#endif
}

#if BYPASS_TIMER_ISR
void delayMs(unsigned int ms) {
   /*
  */ 
  for (int i = 0; i < ms; i++) {
    delayMicroseconds(1000);
  }
}
#endif

void loop() {
  
  UsbKeyboard.update();

  digitalWrite(13, !digitalRead(13));

  if (digitalRead(BUTTON_PIN) == 0) {
    
    //UsbKeyboard.sendKeyStroke(KEY_B, MOD_GUI_LEFT);
    
    UsbKeyboard.sendKeyStroke(KEY_H);
    UsbKeyboard.sendKeyStroke(KEY_E);
    UsbKeyboard.sendKeyStroke(KEY_L);
    UsbKeyboard.sendKeyStroke(KEY_L);
    UsbKeyboard.sendKeyStroke(KEY_O);

    UsbKeyboard.sendKeyStroke(KEY_SPACE);

    UsbKeyboard.sendKeyStroke(KEY_W);
    UsbKeyboard.sendKeyStroke(KEY_O);
    UsbKeyboard.sendKeyStroke(KEY_R);
    UsbKeyboard.sendKeyStroke(KEY_L);
    UsbKeyboard.sendKeyStroke(KEY_D);
    //UsbKeyboard.sendKeyStroke(KEY_B, MOD_GUI_LEFT);

    UsbKeyboard.sendKeyStroke(KEY_ENTER);
#if BYPASS_TIMER_ISR  // check if timer isr fixed.
    delayMs(20);
#else
    delay(20);
#endif
    
   }

}

but when I compile, i get this error:
UsbKeyboardDemo1.cpp:19:3: error: ‘TIMSK0’ was not declared in this scope

When I compile it for the Arduino Uno it does work. It does the same with other sketches i have tried where 'TIMSK0' is used.
I wonder if i have to change something that is different on the atmega8 timer.

I would be glad if somebody could help me

Code probably wasn't designed to run on an ATmega8. An ATmega8 has only one Timer/Counter Interrupt Mask Register (defined as TIMSK not TIMSK0). A UNO uses an ATmega328 which has 3 interrupt mask registers (TIMSK0, TIMSK1 and TIMSK2).

Thanks. But do I also have to change the 'TOIE0' expression?? Because when i change TIMSK0 to TIMSK theres no more compile error but it still does not work.

You can check the Atmega8 datasheet here

The supported names & instructions are at the end, check to see what the '8 has.

By names, I meant Registers.