站長資訊網
最全最豐富的資訊網站

C語言函數大全 k

函數名: kbhit
功  能: 檢查當前按下的鍵
用  法: int kbhit(void);
程序例:

#include <conio.h>

int main(void)
{
   cprintf(“Press any key to continue:”);
   while (!kbhit()) /* do nothing */ ;
   cprintf(“rnA key was pressed…rn”);
   return 0;
}
 
 
 

函數名: keep
功  能: 退出并繼續駐留
用  法: void keep(int status, int size);
程序例:

/***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.  Due to the nature of this
   function the formula used to compute
   the number of paragraphs may not
   necessarily work in all cases.  Use with
   care!  Terminate Stay Resident (TSR)
   programs are complex and no other support
   for them is provided.  Refer to the
   MS-DOS technical documentation
   for more information.  */
#include <dos.h>
/* The clock tick interrupt */
#define INTR 0x1C
/* Screen attribute (blue on grey) */
#define ATTR 0x7900

/* reduce heaplength and stacklength
to make a smaller program in memory */
extern unsigned _heaplen = 1024;
extern unsigned _stklen  = 512;

void interrupt ( *oldhandler)(void);

void interrupt handler(void)
{
   unsigned int (far *screen)[80];
   static int count;

/* For a color screen the video memory
   is at B800:0000.  For a monochrome
   system use B000:000 */
   screen = MK_FP(0xB800,0);

/* increase the counter and keep it
   within 0 to 9 */
   count++;
   count %= 10;

/* put the number on the screen */
   screen[0][79] = count + ‘0’ + ATTR;

/* call the old interrupt handler */
   oldhandler();
}

int main(void)
{

/* get the address of the current clock
   tick interrupt */
oldhandler = getvect(INTR);

/* install the new interrupt handler */
setvect(INTR, handler);

/* _psp is the starting address of the
   program in memory.  The top of the stack
   is the end of the program.  Using _SS and
   _SP together we can get the end of the
   stack.  You may want to allow a bit of
   saftey space to insure that enough room
   is being allocated ie:
   (_SS + ((_SP + safety space)/16) – _psp)
*/
keep(0, (_SS + (_SP/16) – _psp));
return 0;
}

 

贊(0)
分享到: 更多 (0)
網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
亚洲А∨精品天堂在线| 国产成人亚洲精品91专区高清| 国产精品多p对白交换绿帽| 精品久久久久久无码免费| 综合91在线精品| 亚洲第一页日韩专区| 日日夜夜精品免费视频| 国产久热精品无码激情| 蜜芽国内精品视频在线观看| 亚洲精品偷拍无码不卡av| 久久综合国产乱子伦精品免费| 久久国产乱子精品免费女| 在线观看亚洲精品国产| 久久99精品国产麻豆蜜芽| 亚洲欧洲久久久精品| 五月天婷婷精品免费视频| 在线观看日韩一区| 日韩一区二区三区四区不卡| 日韩成人无码影院| 日韩精品免费一线在线观看| 国产精品k频道在线看| 国产精品永久在线观看| 日韩成人国产精品视频| 国内精品久久久久久久久齐齐| 亚洲精品理论电影在线观看| 国产精品1024| 亚洲AV永久无码精品放毛片| 国产精品久久久久蜜芽| 中文字幕乱码亚洲精品一区| 精品乱码一卡2卡三卡4卡网| 亚洲国产精品免费观看| 国产精品玖玖玖在线观看| 99在线精品国自产拍中文字幕 | 亚洲精品私拍国产福利在线| 久久精品亚洲视频| 无码精品人妻一区二区三区中| 久久99精品一区二区三区| 亚洲精品视频在线| 久久伊人精品一区二区三区| 久久亚洲精品专区蓝色区| 国产成人精品日本亚洲专区6|