The thing is, it worked perfectly from a Pascal compiled source. But from C, I get this error:

16 bit MS-DOS Subsystem (DIALOG)
C:\TIMER\timer.exe
The NTVDM CPU has encountered an illegal instruction.
CS:0008 IP:08f1 OP:0f 00 74 01 c3 Choose 'Close' to terminate the application.
----------------

Surely if one is allowed to do IRQ programming in Pascal and XP allows it executed 100%, then it should also work under C too.

Am just looking for oldskool experienced C IRQ programmers who is familiar with this timer code.