ฟังก์ชัน interrupt ในภาษาซี

หวัดดีครับ ผมต้องการเขียนโปรแกรมการนับเวลาในโปรแกรมย่อย ในขณะที่โปรแกรมหลัก (main()) ยังทำงานต่อไปตามปกติตามลำดับคำสั่งที่เขียนเอาไว้ เมื่อโปรแกรมย่อยนับเวลาครบ ก็จะหยุดการทำงาน และจะทำงานอีกครั้งเมื่อมีการร้องขอ
ผมได้โค้ดมาจากหนังสือการเขียนโปรแกรมเล่มหนึ่งเมื่อลองคอมไพล์โดยใช้ คอมไพล์เลอร์ borland 5.5 ปรากฎว่าติด error
รบกวนช่วยดูโค้ดให้หน่อยครับว่าต้องแก้ไขอย่างไรบ้าง
//code program
#include <stdio.h>
#include <dos.h>

/* This program use Timer interrupt 0x1c */
#define  TCK 0x1c

/* Prototype declaration */
void interrupt MyIntFunction(void);  /* New Interrupt Service Routine */
/* Pointer-to-(Interrupt)function declaration */
void interrupt (*OldIntFunction)(void);  /* Old Interrupt Service Routine */

volatile int count = 0;

void main (void)
{
  printf("Now ,set interrupt vector\n");
  OldIntFunction = getvect(TCK);   /* Transfer interrupt vector to
                    OldIntFunction */
  setvect(TCK,MyIntFunction);      /* Redirection interrupt vector
                    to MyIntFunction */
  while(count<36) ;  /* Loop until count = 36 */

  setvect(TCK,OldIntFunction);     /* Restore old interrupt function */
  printf("Now ,restore old interrupt\n");
}

void interrupt MyIntFunction(void)
{
   count++;

   OldIntFunction();   /* Call old ISR */
}

//error message from complier borland 5.5
---------- Borland C++ ----------
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland

8: Size of 'interrupt' is unknown or zero
17: Undefined symbol 'OldIntFunction' in function main
19: Undefined symbol 'MyIntFunction' in function main
19: Call to function 'setvect' with no prototype in function main
27: Size of 'interrupt' is unknown or zero
27: Declaration syntax error
คำตอบที่ได้รับเลือกจากเจ้าของกระทู้
ความคิดเห็นที่ 6
จากที่อ่านมาเหมือนต้องการสิ่งที่เรียกว่า Thread
บน Win32APIs มีไว้ให้แล้ว
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx

เข้าไปดูที่เค้าคุยกันมีตัวอย่าง คล้ายๆ กับที่ จขกท อาจต้องการ
นำไปดัดแปลงดูก็จะได้ใกล้เคียง
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่