disable,英語單詞,也有C語言函式disable。
基本介紹
- 中文名:使失去能力
- 外文名:disable
- 音標:[dis'eibl]
- 類型:vt.
單詞
C函式
#include <stdio.h>#include <dos.h>#include <conio.h>#define INTR 0X1C /* The clock tickinterrupt */void interrupt ( *oldhandler)(void);int count=0;void interrupt handler(void){/* disable interrupts during the handling ofthe interrupt */disable();/* increase the global counter */count++;/* reenable interrupts at the end of thehandler */enable();/* 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;}