home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT37.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-14  |  689 b   |  33 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat37.c                                              */
  3. /*------------------------------------------------------------------*/
  4. #include <stdio.h>
  5. #include <dos.h>
  6. #include <conio.h>
  7.  
  8. #define INTERRUPT 0x1c
  9.  
  10.  
  11. void (__interrupt __far *pre_handler)();
  12.  
  13. int counter=0;
  14.  
  15. void interrupt handler(void)
  16. {
  17.    _disable();
  18.    counter++;
  19.    _enable();
  20.    pre_handler();
  21. }
  22.  
  23. void main()
  24. {
  25.    pre_handler = _dos_getvect(INTERRUPT);
  26.    _dos_setvect(INTERRUPT, handler);
  27.    while (counter < 100)
  28.       printf("counter ñº¡╚¼░  %d\n",counter);
  29.    _dos_setvect(INTERRUPT, pre_handler);
  30. }
  31.  
  32.  
  33.