src/timer.c
/******************************************************************************
*  DOStimer()
*
*  The interrupt 0x1c handler.  This routine must be declared using the
*  '#pragma interrupt()' statement to ensure that all registers are preserved.
*  It is also needed to ensure the proper functioning of '_chain_intr()'.
*
*  The timer interrupt (normally) occurs 18.2 times per second.  This routine
*  waits one extra tick every 91 ticks (18.2*5).
*
*  Before this interrupt was installed, 'prev_int_1c' was set to the current
*  0x1c interrupt. 'DOStimer()' chains to this interrupt using '_chain_intr()',
*  rather than returning back to the caller.
*
*  Note that as little as possible should be done within a timer interrupt,
*  since further clock ticks are disabled until the interrupt returns.
******************************************************************************/
DOStimer()
The interrupt 0x1c handler.  This routine must be declared using the
'#pragma interrupt()' statement to ensure that all registers are preserved.
It is also needed to ensure the proper functioning of '_chain_intr()'.

The timer interrupt (normally) occurs 18.2 times per second.  This routine
waits one extra tick every 91 ticks (18.2*5).

Before this interrupt was installed, 'prev_int_1c' was set to the current
0x1c interrupt. 'DOStimer()' chains to this interrupt using '_chain_intr()',
rather than returning back to the caller.

Note that as little as possible should be done within a timer interrupt,
since further clock ticks are disabled until the interrupt returns.
DOStimer () The interrupt 0x1c handler . This routine must be declared using the ' #pragma interrupt () ' statement to ensure that all registers are preserved . It is also needed to ensure the proper functioning of ' _chain_intr () ' . The timer interrupt ( normally ) occurs 18 . 2 times per second . This routine waits one extra tick every 91 ticks ( 18 . 2 * 5 ) . Before this interrupt was installed ' prev_int_1c ' was set to the current 0x1c interrupt . ' DOStimer () ' chains to this interrupt using ' _chain_intr () ' rather than returning back to the caller . Note that as little as possible should be done within a timer interrupt since further clock ticks are disabled until the interrupt returns .
void DOStimer() {
  Irq_Stk_Check = 0;
  Irq_Stk_End = 0;
  _chain_intr(prev_int_1c); 
}
void DOStimer ( ) { Irq_Stk_Check = 0 ; Irq_Stk_End = 0 ; _chain_intr ( prev_int_1c ) ; }
DOStimer()
The interrupt 0x1c handler.
DOStimer () The interrupt 0x1c handler .
/* if (--tick_count == 0) { */ /*   _dos_setvect(0x1c, prev_int_1c);
   } else if (tick_count <= 0) { */ /* I'm dead, uninstall me */ /*   _dos_setvect(0x1c, prev_int_1c);
     tick_count = 0;
   } */ /* call previous int 1c handlr, if any*/ /* (pts to 'ret' if no prev installed)*/