功 能: 設定中斷矢量入口
用 法: void setvect(int intr_num, void interrupt(*isr)());
程式例:
/***NOTE: This is an interrupt service routine. You can NOT compile this program with Test Stack Overflow turned on and get an executable file which will operate correctly. */
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#define INTR 0X1C /* The clock tick interrupt */
void interrupt ( *oldhandler)(void);
int count=0;
void interrupt handler(void)
{
/* increase the global counter */
count++;
/* call the old routine */
oldhandler();
}
int main(void)
{
/* save the old interrupt vector */
oldhandler = getvect(INTR);
/* install the new interrupt handler */
setvect(INTR, handler);
/* loop until the counter exceeds 20 */
while (count < 20)
printf("count is %d\n",count);
/* reset the old interrupt handler */
setvect(INTR, oldhandler);
return 0;
}
相關詞條
-
setvect
setvect(in in in
-
setvect()
setvect(in in in
-
enable
*/setvect(INTR, handler);/* loop until... */setvect(INTR, oldhandler);return 0;}系統...
詞典解釋 函式名 系統命令 程式語言 電氣方面 -
disabled
interrupt handler */setvect(INTR, handler... interrupt handler */setvect(INTR...
基本信息 發音 例句 釋義 同義詞 -
getvect
*/ setvect(5,get_out); /* do nothing... */ setvect(5,oldfunc); puts("...
-
getvect()
interrupt handler */ setvect(5,get... interrupt routine */ setvect(5,oldfunc...
-
C語言庫函式(E類字母)
*/ setvect(INTR, handler); /* loop... the old interrupt handler */ setvect...
-
C語言庫函式(E類字母)
handler */setvect(INTR, handler... interrupt handler */setvect(INTR...
函式名: ecvt 函式名: ellipse 函式名: enable 函式名: eof -
C語言函式
分類函式所在函式館為【 ctype.h】int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z')返...
分類函式 數學函式 目錄函式 進程函式 診斷函式