亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tsr.cpp

?? 多任務操作系統控制的DOS環境下的實現的C語言源程序。 利用時間片的方式
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
    {   if ((hotkey & ALT) != 0)
            hotscan += ALT_FKEY;
        else if ((hotkey & CTRL) != 0)
            hotscan += CTRL_FKEY;
        else if ((hotkey & (LSHIFT | RSHIFT)) != 0)
            hotscan += SHIFT_FKEY;
    }

    // set length of timeslice
    interval = timeslice;
    nexttick = *timer + interval;

    // perform user startup actions
    if (instance->startup () != 0)
    {   stat = STARTUP_ERR;
        return;
    }

    // do TSR setup if hotkey or timeslice specified
    if (hotkey != NONE || timeslice != 0)
    {   if (setup() == 0)
        {   stat = STACK_FAIL;
            return;
        }
    }
  
    // hook multiplex interrupt for self-identification
    oldint2F = getvect (0x2F);
    setvect (0x2F, Handler (TSRint2F));

    // terminate and stay resident (exit status = 0), memory size taken
    // from bytes 3 and 4 of arena header in paragraph preceding PSP.
    keep (0, *(unsigned far*) MK_FP(_psp-1, 3));

    // this line should never be reached
    stat = LOAD_FAIL;
}

//--------------------------------------------------------------------------
//
//      TSR::unload
//
//      Unloads a previously loaded copy of the TSR from memory.  The
//      function returns 0 if the TSR was unloaded successfully, 1 if
//      there is no previously loaded copy, and 2 if the previous copy
//      cannot be unloaded.  The TSR is invoked to unload itself using
//      the multiplex interrupt (2F).
//
int TSR::unload ()
{
    union REGS r;
    struct SREGS s;

    // call TSR to unload itself via multiplex interrupt
    r.h.ah = TSRfunction, r.h.al = 1;
    r.x.bx = FP_SEG (COPYRIGHT);
    r.x.di = FP_OFF (COPYRIGHT);
    s.es   = FP_SEG (TSRname);
    r.x.si = FP_OFF (TSRname);
    int86x (0x2F, &r, &r, &s);

    // exit if TSR is not loaded
    if (compare ((char far*) MK_FP(s.es, r.x.si), COPYRIGHT) != 0)
        return NOT_LOADED;

    // exit if TSR cannot be unloaded
    if (r.x.ax == 0)
        return UNHOOK_FAIL;

    // locate the TSR environment segment from the PSP
    const unsigned env = *(unsigned far*) MK_FP(r.x.ax, 0x2C);

    // free the TSR's memory
    s.es = r.x.ax;
    r.h.ah = 0x49;
    intdosx (&r, &r, &s);
    if (r.x.cflag != 0)
        return MEM_FROZEN;

    // free the TSR's environment
    s.es = env;
    r.h.ah = 0x49;
    intdosx (&r, &r, &s);
    if (r.x.cflag != 0)
        return ENV_FROZEN;

    // successfully unloaded
    return SUCCESS;
}

//--------------------------------------------------------------------------
//
//      TSR::request
//
//      This function is used by foreground copies of the program to
//      communicate with a resident copy.  "Fn" is the function code
//      and "p1" and "p2" are application-specific parameters to be
//      passed to the resident copy.  Their updated values are returned
//      to the caller.
//
int TSR::request (int& fn, int& p1, int& p2)
{
    union REGS r;
    struct SREGS s;

    r.h.ah = TSRfunction, r.h.al = fn | 0x80;
    r.x.bx = FP_SEG (COPYRIGHT);
    r.x.di = FP_OFF (COPYRIGHT);
    s.es   = FP_SEG (TSRname);
    r.x.si = FP_OFF (TSRname);
    r.x.cx = p1, r.x.dx = p2;
    int86x (0x2F, &r, &r, &s);

    if (compare ((char far*) MK_FP(s.es, r.x.si), COPYRIGHT) != 0)
        return NOT_LOADED;

    fn = r.x.ax, p1 = r.x.cx, p2 = r.x.dx;
    return SUCCESS;
}

//--------------------------------------------------------------------------
//
//      Unhook TSR.
//
//      This function prepares the TSR for unloading from memory.  The
//      function returns the PSP address if the TSR can be unloaded
//      successfully, and 0 otherwise (if any of the interrupt vectors
//      have been re-hooked).  The virtual function "shutdown" is also
//      called to perform any class-specific finalisation.  Interrupts
//      08, 09, 13 and 28 only need unhooking if there is a non-null
//      hotkey or timeslice.
//
static int unhook ()
{
    // exit if something has hooked the multiplex interrupt
    if (getvect (0x2F) != Handler (TSRint2F))
        return 0;

    // try to unhook wake-up interrupts if necessary
    if (hotshift != 0 || hotscan != 0 || interval != 0)
    {   if (getvect (0x08) != Handler (TSRint8)  ||
            getvect (0x09) != Handler (TSRint9)  ||
            getvect (0x13) != Handler (TSRint13) ||
            getvect (0x28) != Handler (TSRint28))
            return 0;
        setvect (0x08, oldint8);
        setvect (0x09, oldint9);
        setvect (0x13, oldint13);
        setvect (0x28, oldint28);
    }

    // unhook multiplex interrupt
    setvect (0x2F, oldint2F);

    // perform user shutdown actions
    if (instance->shutdown () != 0)
        return 0;

    // return PSP address
    return _psp;
}



//--------------------------------------------------------------------------
//
//      TSR::loaded
//
//      Returns true if a copy of the TSR is already in memory.
//
int TSR::loaded ()
{
    union REGS r;
    struct SREGS s;
    r.h.ah = TSRfunction, r.h.al = 0;
    r.x.bx = FP_SEG (COPYRIGHT);
    r.x.di = FP_OFF (COPYRIGHT);
    s.es   = FP_SEG (TSRname);
    r.x.si = FP_OFF (TSRname);
    int86x (0x2F, &r, &r, &s);
    return r.h.al == 0xFF
           && compare ((char far*) MK_FP(s.es, r.x.si), COPYRIGHT) == 0;
}

//--------------------------------------------------------------------------
//
//      Display a string using BIOS calls.
//
//      This function is used by "dos_error" below to display error
//      messages without using DOS calls.
//
static void display (int page, const char* s)
{
    union REGS r;
    while (*s != '\0')
    {   if (*s >= ' ')              // set colours for printing characters
        {   r.x.ax = 0x0920;        // display a space, using...
            r.h.bh = page;
            r.h.bl = 0x0E;          // ...yellow on black
            r.x.cx = 1;
            int86 (0x10, &r, &r);
        }
        r.h.ah = 0x0E;              // now display actual character
        r.h.al = *s++;
        r.h.bh = page;
        int86 (0x10, &r, &r);
    }
}



//--------------------------------------------------------------------------
//
//      TSR::dos_error
//
//      This function is called if an unsafe DOS call is made from the
//      main TSR function.  If it is called, it indicates a program bug.
//      This is a virtual function so that a more appropriate function
//      can be provided in classes derived from TSR.  The parameter "fn"
//      is the function code from register AH; "ce" is non-zero if a
//      critical error is being handled; "cs:ip" is the return address
//      (i.e. the address of the instruction after the illegal call).
//
void TSR::dos_error (int fn, int ce, int cs, int ip)
{
    union REGS r;
    char fmt [10];

    // get video mode
    r.h.ah = 0x0F;
    int86 (0x10, &r, &r);
    const int mode = r.h.al;

    // select text mode if in graphics mode
    const int graphics = (r.h.al > 3 && r.h.al != 7);
    if (graphics)
    {   r.x.ax = 0x0002;
        int86 (0x10, &r, &r);
    }

    // get active page
    r.h.ah = 0x0F;
    int86 (0x10, &r, &r);
    const int page = r.h.bh;

    // display error message
    display (page, "\a\r\n*** Illegal DOS call detected in TSR \"");
    display (page, TSRname);
    display (page, "\"\r\nFunction ");
    sprintf (fmt, "%02X", fn); display (page, fmt);
    display (page, " called from ");
    sprintf (fmt, "%04X:%04X", cs, ip - 2); display (page, fmt);
    if (ce != 0)
        display (page, " during critical error handling");
    display (page, ".\r\nThis call should not be used by a TSR and indicates"
                   " a bug in the program.\r\nPress any key to ignore the"
                   " call and continue... ");

    // wait for a keypress
    bioskey (0);
    display (page, "\r\n");

    // restore screen mode if it was a graphics mode
    if (graphics)
    {   r.x.ax = mode;
        int86 (0x10, &r, &r);
    }
}

//--------------------------------------------------------------------------
//
//      TSR::pause
//
//      This function generates an INT 28 (the DOS scheduler interrupt).
//      This interrupt is used to wake up TSRs, so the main TSR function
//      can call this during lengthy processing to ensure that other TSRs
//      get a chance to wake up.
//
void TSR::pause ()
{
    union REGS r;
    int86 (0x28, &r, &r);
}


 
//--------------------------------------------------------------------------
//
//      TSR::sync
//
//      This function resynchronises the timeslice interval so that the
//      next timed wakeup will happen after "interval" ticks from now.
//
void TSR::sync ()
{
    nexttick = *timer + interval;
}



//--------------------------------------------------------------------------
//
//      TSR::userbreak
//
//      This function returns the value of the flag which indicates if
//      control-break has been pressed.  It also resets the flag.
//
int TSR::userbreak ()
{
    int b = breakflag;
    breakflag = 0;
    return b;
}



//--------------------------------------------------------------------------
//
//      TSR::name
//
//      This function returns the name of the TSR instance.
//
const char* TSR::name ()
{
    return TSRname;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av电影免费观看| 国产精品视频麻豆| 亚洲欧洲三级电影| 老司机精品视频在线| 99久久久国产精品免费蜜臀| 日韩女优电影在线观看| 一片黄亚洲嫩模| 成人黄色免费短视频| 精品国产成人在线影院 | 国产欧美日产一区| 五月综合激情网| 在线免费不卡视频| 成人欧美一区二区三区在线播放| 国产一区二区三区观看| 日韩一区二区三区观看| 日韩av不卡在线观看| 欧美日韩精品一区二区三区四区 | 欧美亚洲禁片免费| 国产精品久久久久aaaa樱花| 国产成人av福利| 欧美成人女星排名| 久草精品在线观看| 精品日韩一区二区三区免费视频| 日韩专区在线视频| 777色狠狠一区二区三区| 亚洲成a人v欧美综合天堂下载| 在线视频亚洲一区| 亚洲综合免费观看高清完整版| 91免费在线视频观看| 亚洲欧美另类综合偷拍| 不卡av在线免费观看| 亚洲视频一区二区在线| 91丨porny丨国产入口| 亚洲女同ⅹxx女同tv| 91福利视频在线| 亚洲v中文字幕| 91麻豆精品国产91久久久更新时间 | 国产欧美日韩久久| 成人激情午夜影院| 亚洲欧美日韩精品久久久久| 色综合中文字幕国产 | jlzzjlzz欧美大全| 亚洲精品乱码久久久久久久久| 在线看一区二区| 日韩专区在线视频| 久久久久久综合| 国产aⅴ综合色| 亚洲乱码国产乱码精品精可以看| 在线看不卡av| 五月天激情综合网| 欧美精品一区二区三区四区| 懂色av中文一区二区三区| 中文字幕一区二区不卡| 色综合激情久久| 日韩av一区二区三区四区| 国产性天天综合网| 欧美亚洲一区二区三区四区| 日产精品久久久久久久性色| 日韩欧美中文字幕一区| 成人av一区二区三区| 偷拍与自拍一区| 国产片一区二区三区| 欧日韩精品视频| 国产精品一卡二卡| 一区二区三区免费在线观看| 日韩欧美三级在线| 91黄色免费观看| 国产精品一级二级三级| 亚洲不卡在线观看| 中文字幕成人av| 日韩一级片在线观看| 99国产精品久久久久久久久久| 婷婷国产在线综合| 国产精品素人视频| 日韩一区二区三区视频| 色婷婷综合久色| 国产成人av电影在线观看| 日韩主播视频在线| 中文字幕在线观看一区| 精品国产免费一区二区三区四区 | 欧美一卡2卡3卡4卡| 成人免费va视频| 精品一区二区综合| 亚洲一卡二卡三卡四卡无卡久久| 26uuu亚洲综合色| 欧美日韩午夜影院| 91蜜桃网址入口| 国产一区二区三区精品视频| 日韩电影在线看| 亚洲精品国产品国语在线app| 国产亚洲精品bt天堂精选| 91精品免费在线观看| 欧美视频三区在线播放| 91色乱码一区二区三区| 成人一区二区视频| 国产麻豆精品一区二区| 久久er精品视频| 奇米四色…亚洲| 日韩激情av在线| 性久久久久久久| 亚洲国产美国国产综合一区二区| 中文字幕日韩一区| 国产精品久久久久久久久免费桃花 | 久久久一区二区三区| 欧美成人a∨高清免费观看| 欧美日本一道本| 精品视频一区二区不卡| 欧美午夜不卡视频| 欧美日韩不卡一区| 91精品在线免费| 91精品国产色综合久久| 日韩一区二区不卡| 精品91自产拍在线观看一区| 欧美电影免费观看高清完整版 | 欧美日韩综合不卡| 欧美日韩国产精品自在自线| 欧美日韩综合在线| 4438成人网| 精品噜噜噜噜久久久久久久久试看| 日韩一区二区精品葵司在线 | 亚洲欧美色一区| 亚洲精品国产一区二区三区四区在线 | 91麻豆福利精品推荐| 一本色道久久综合亚洲91| 色婷婷久久久亚洲一区二区三区| 色综合久久综合中文综合网| 91久久线看在观草草青青| 欧美性受xxxx| 日韩一卡二卡三卡四卡| 国产色综合久久| 亚洲视频一区二区免费在线观看| 亚洲精品自拍动漫在线| 午夜不卡av在线| 国产在线日韩欧美| 91女神在线视频| 欧美日韩国产高清一区二区| 欧美刺激午夜性久久久久久久| 久久精品欧美日韩精品| 亚洲一区二区三区视频在线播放| 日韩精品欧美成人高清一区二区| 黄色日韩网站视频| 91麻豆蜜桃一区二区三区| 欧美猛男男办公室激情| 久久综合99re88久久爱| 一区二区三区在线观看动漫| 奇米一区二区三区| 91免费视频大全| 精品国产乱码91久久久久久网站| 亚洲欧美激情小说另类| 久久超碰97中文字幕| 色婷婷综合久久久久中文一区二区 | 亚洲精品一二三四区| 蜜桃精品视频在线| 色综合天天综合狠狠| 日韩亚洲欧美成人一区| 欧美—级在线免费片| 首页国产欧美久久| 成人免费精品视频| 日韩欧美的一区二区| 亚洲精品中文在线| 国产99精品在线观看| 91精品国产综合久久精品麻豆 | 国产精品热久久久久夜色精品三区| 一区二区三区不卡视频在线观看| 99精品视频一区二区三区| 欧美日韩高清一区二区三区| 中文字幕中文字幕一区| 免费在线看一区| 欧美视频在线一区二区三区| 欧美经典一区二区| 久久国产精品无码网站| 欧美视频自拍偷拍| 亚洲人成精品久久久久| 国产福利电影一区二区三区| 日韩午夜激情视频| 午夜不卡av在线| 在线观看av一区二区| 亚洲欧洲精品一区二区三区| 国产乱人伦偷精品视频不卡| 欧美一区日本一区韩国一区| 一区二区三区在线视频播放| 成人av网在线| 国产精品入口麻豆原神| 国产精品一区二区在线观看不卡| 欧美福利视频导航| 亚洲国产一区二区三区| 在线视频中文字幕一区二区| 亚洲欧美日韩久久精品| 91原创在线视频| 日韩一区在线播放| 99久久国产综合精品色伊| 国产精品丝袜一区| 成人黄色片在线观看| 国产精品嫩草影院com| 国产一区二区免费在线| 久久精品无码一区二区三区| 国产麻豆成人传媒免费观看| 日韩精品一区二区三区三区免费 | 夜夜爽夜夜爽精品视频| 成人自拍视频在线观看|