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

        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號
        主站蜘蛛池模板: 免费精品无码AV片在线观看| 久久精品视频网| 91麻豆精品国产| 久久久久这里只有精品| 久久r热这里有精品视频| 亚洲精品美女久久777777| 国产精品自在欧美一区 | 蜜臀AV无码国产精品色午夜麻豆 | 亚洲欧洲美洲无码精品VA| 国产三级精品三级| 97久人人做人人妻人人玩精品 | 人妻少妇偷人精品无码| 午夜亚洲av永久无码精品| 国产精品无码素人福利不卡| 久久99热国产这有精品| 2020亚洲男人天堂精品| 老司机性色福利精品视频| 亚洲日韩中文在线精品第一| 日本午夜精品理论片A级APP发布| 国产精品人人做人人爽| 四虎精品成人免费永久| 精品久久久久久综合日本| 99热亚洲色精品国产88| 无码精品人妻一区二区三区中| 欧美精品福利在线视频 | 办公室久久精品| 1区1区3区4区产品芒果精品| 国产精品视频一区国模私拍| 国产精品ⅴ无码大片在线看| 国产中老年妇女精品| 国产精品igao视频网网址| 国产精品嫩草视频永久网址| 99久久精品费精品国产一区二区| 91在线视频精品| 精品九九久久国内精品| 亚洲精品天天影视综合网| 刺激无码在线观看精品视频| 国产成人亚洲精品影院| 国产亚洲美女精品久久久| 欧美日韩成人精品久久久免费看 | 亚洲精品无码专区久久同性男|