[C] 取得中断向量入口 →→→→→进入此内容的聊天室

来自 , 2019-06-26, 写在 C, 查看 114 次.
URL http://www.code666.cn/view/2b8eba3c
  1. #include <stdio.h>
  2. #include <dos.h>
  3.  
  4. void interrupt get_out(); /* interrupt prototype */
  5.  
  6. void interrupt (*oldfunc)(); /* interrupt function pointer */
  7. int looping = 1;
  8.  
  9. int main(void)
  10. {
  11.   puts("Press <Shift><Prt Sc> to terminate");
  12.  
  13.   /* save the old interrupt */
  14.   oldfunc  = getvect(5);
  15.  
  16.    /* install interrupt handler */
  17.   setvect(5,get_out);
  18.  
  19.    /* do nothing */
  20.   while (looping);
  21.  
  22.    /* restore to original interrupt routine */
  23.    setvect(5,oldfunc);
  24.  
  25.   puts("Success");
  26.   return 0;
  27. }
  28. void interrupt get_out()
  29. {
  30.   looping = 0; /* change global variable to get out of loop */
  31. }
  32.  

回复 "取得中断向量入口"

这儿你可以回复上面这条便签

captcha