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

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

?? tsr.cpp

?? 多任務操作系統控制的DOS環境下的實現的C語言源程序。 利用時間片的方式
?? CPP
?? 第 1 頁 / 共 3 頁
字號:


//--------------------------------------------------------------------------
//
//      Int 28 (DOS scheduler) handler.
//
//      This handler is called by DOS whenever it is idle.  It first
//      checks to see if the TSR is not already running and that there
//      is a pending activation request.  If not, it calls the old
//      handler and exits.  Otherwise it checks if DOS is in a safe
//      state and if it is activates the TSR.  Note that the INDOS
//      flag is safe if it is 1, as this means it is being called
//      from inside DOS but that no nested calls are in progress.
//
static void interrupt TSRint28 ()
{
    // chain to old handler if TSR is already running or activation not
    // requested
    if (TSRactive || (!hotkeyflag && !TSRrequest))
        _chain_intr (oldint28);

    // activate TSR if DOS is safe
    if (*indos <= 1 && *critical == 0 && diskflag == 0)
        activate ();
}

//--------------------------------------------------------------------------
//
//      Int 2F (multiplex) handler.
//
//      This function provides a means of communicating with the TSR
//      for installation testing and unloading.  AH must be the TSR
//      function code (as located by the constructor), AL must be the
//      subfunction code (00, 01, or 80 to FF), BX:DI must point to a
//      copy of the class copyright notice and ES:SI must point to a
//      copy of the TSR's name (or be a null pointer if AL = 00).  If
//      these conditions are not met, the call is passed to the original
//      handler.  Otherwise ES:SI is set to point to the copyright notice
//      (which is guaranteed not to be the same as any identifying string
//      due to its length) and a result code from the selected subfunction
//      is stored in AX.  The calls are handled as follows:
//
//      Subfunction 00 (installation check): set AX to 0xFF if ES:SI point
//          to a copy of this TSR's name (TSR is installed) or if ES:SI
//          are both zero (check if function is available for use by a
//          TSR built using this class).
//      Subfunction 01 (unload TSR): the handler attempts to unhook the
//          TSR ready to be unloaded from memory.  If this is successful,
//          AX is set to the TSR's PSP address; otherwise AX will be set
//          to zero.
//      Subfunctions 80 - FF (application-specific): CX and DX are the
//          call parameters (which might be a far pointer to a longer
//          parameter block).  They are passed as references to the
//          virtual function "respond".  The function result is returned
//          in AX; the values of CX and DX as set by "respond" will also
//          be returned to the calling program.
//
static void interrupt TSRint2F (unsigned, unsigned di, unsigned si,
                                unsigned, unsigned es, int dx,
                                int cx,   unsigned bx, unsigned ax)
{
    if ((ax >> 8) != TSRfunction
        || compare ((char far*) MK_FP(bx,di), COPYRIGHT) != 0)
        _chain_intr (oldint2F);             // this call doesn't return

    unsigned al = ax & 0xFF;                // subfunction code
    
    // installation check
    if (al == 0 && ((es == 0 && si == 0)
                    || compare ((char far*) MK_FP(es,si), TSRname) == 0))
        ax = 0xFF;

    // unload resident copy request
    else if (al == 1 && compare ((char far*) MK_FP(es,si), TSRname) == 0)
        ax = unhook ();

    // application-specific request to resident copy
    else if (al >= 0x80 && compare ((char far*) MK_FP(es,si), TSRname) == 0)
        ax = instance->respond (al & 0x7F, cx, dx);

    // interrupt not directed here, so chain to old handler
    else
        _chain_intr (oldint2F);             // this call doesn't return

    // set ES:SI to address of resident copy's copyright notice
    es = FP_SEG (COPYRIGHT);
    si = FP_OFF (COPYRIGHT);
}

//--------------------------------------------------------------------------
//
//      Activate body of TSR.
//
//      This function performs some essential housekeeping operations
//      before and after calling the main TSR function.  This involves
//      hooking interrupts 21, 23 and 24, saving the current DTA and
//      PSP addresses, switching to the user stack, setting the TSRactive
//      flag to avoid re-entrant activations, and clearing TSRrequest.
//      After TSR::main has returned, the hotkey flag is cleared and
//      the original context (stack, DTA, PSP and interrupt vectors)
//      is restored.  Since this function is declared as a friend in
//      the class declaration, it has to be public; to make sure it is
//      not called directly, it checks that "TSRrequest" is non-zero
//      before doing anything.
//
void activate ()
{
    // declare non-stack variables
    static unsigned oldpsp;             // saved PSP segment
    static unsigned olddtaseg;          // saved DTA segment
    static unsigned olddtaoff;          // saved DTA offset
    static int oldsp;                   // saved stack pointer
    static int oldss;                   // saved stack segment
    static union REGS r;                // registers for DOS calls
    static struct SREGS s;              // segment registers for DOS calls

    // test TSR activation has been requested
    if (TSRrequest == 0)
        return;

    // save DTA and PSP addresses
    r.h.ah = 0x2F;                          // get DTA
    intdosx (&r, &r, &s);
    olddtaseg = s.es, olddtaoff = r.x.bx;
    r.h.ah = 0x51;                          // get PSP
    intdos (&r, &r);
    oldpsp = r.x.bx;

    // set DTA and PSP to saved addresses
    r.h.ah = 0x1A;                          // set DTA
    s.ds = dtaseg, r.x.dx = dtaoff;
    intdosx (&r, &r, &s);
    r.h.ah = 0x50;                          // set PSP
    r.x.bx = pspseg;
    intdos (&r, &r);

    // set interrupt vectors for TSR execution
    oldint21 = getvect (0x21);
    oldint23 = getvect (0x23);
    oldint24 = getvect (0x24);
    setvect (0x21, Handler (TSRint21));
    setvect (0x23, Handler (TSRint23));
    setvect (0x24, Handler (TSRint24));

    // switch to TSR stack
    asm { cli; }
    oldsp = _SP;
    oldss = _SS;
    _SP = FP_OFF (stack);
    _SS = FP_SEG (stack);
    asm { sti; }
    
    // execute body of TSR
    TSRactive = 1;
    instance->main (hotkeyflag);
    TSRactive = 0;
    
    // restore original stack
    asm { cli; }
    _SP = oldsp;
    _SS = oldss;
    asm { sti; }

    // restore original interrupt vectors
    setvect (0x21, oldint21);
    setvect (0x23, oldint23);
    setvect (0x24, oldint24);

    // save DTA and PSP addresses
    r.h.ah = 0x2F;                          // get DTA
    intdosx (&r, &r, &s);
    dtaseg = s.es, dtaoff = r.x.bx;
    r.h.ah = 0x51;                          // get PSP
    intdos (&r, &r);
    pspseg = r.x.bx;

    // reset original DTA and PSP
    r.h.ah = 0x1A;                          // set DTA
    s.ds = olddtaseg, r.x.dx = olddtaoff;
    intdosx (&r, &r, &s);
    r.h.ah = 0x50;                          // set PSP
    r.x.bx = oldpsp;
    intdos (&r, &r);

    // clear hotkey and request flags
    hotkeyflag = 0;
    TSRrequest = 0;
}

//--------------------------------------------------------------------------
//
//      TSR::TSR
//
//      This is the class constructor.  It checks for a number of
//      possible errors, and stores the name and stack size of the
//      TSR in global variables.  A pointer to the current instance
//      is stored in the global variable "instance" so that interrupt
//      routines can invoke member functions.  The multiplex (int 2F)
//      functions from 0xC0 to 0xFF are scanned for an unused function
//      or an existing TSR based on this class; this is stored in
//      "TSRfunction" and will be the function code recognised by
//      the int 2F handler.
//
TSR::TSR (const char* name, unsigned stacksize)
{
    stat = SUCCESS;

    // copy name
    strncpy (TSRname, name, sizeof(TSRname));
    TSRname [sizeof(TSRname) - 1] = '\0';

    // check DOS version
    if (_osmajor < 3)
    {   stat = DOS_VERSION;       // error: DOS version < 3
        return;
    }

    // save instance pointer
    if (instance != 0)
    {   stat = MULTI_COPIES;      // error: multiple instances
        return;
    }
    instance = this;

    // set stack length
    stacklen = (stacksize < MIN_STACK ? MIN_STACK : stacksize);

    // find spare multiplex function
    union REGS r;
    struct SREGS s;
    for (int i = 0xC0; i <= 0xFF; i++)
    {   r.h.ah = i, r.h.al = 0;
        r.x.bx = FP_SEG (COPYRIGHT);
        r.x.di = FP_OFF (COPYRIGHT);
        s.es = 0, r.x.si = 0;
        int86x (0x2F, &r, &r, &s);
        if (r.h.al == 0)
            break;                  // function not in use
        if (r.h.al == 0xFF
            && compare ((char far*) MK_FP(s.es, r.x.si), COPYRIGHT) == 0)
            break;                  // function in use by derivation of TSR
    }
    if (i > 0xFF)
    {   stat = NO_MUX_FUNC;         // error: can't find multiplex function
        return;
    }
    TSRfunction = i;
}

//--------------------------------------------------------------------------
//
//      Do TSR setup.
//
//      This function creates the stack, saves the DTA and PSP addresses,
//      locates the INDOS and critical error flags, and hooks the wake-up
//      interrupts.  Note that the stack is never deleted; it will remain
//      in existence while the TSR is loaded, and will be deallocated along
//      with everything else when it is unloaded.  It returns zero if the
//      stack could not be allocated.
//
static int setup ()
{
    // create stack (note: this is never deleted!)
    char* stk = new char [stacklen];
    if (stk == 0)
        return 0;
    stack = (stk + stacklen);

    // save DTA and PSP addresses
    union REGS r;
    struct SREGS s;
    r.h.ah = 0x2F;                       // get DTA
    intdosx (&r, &r, &s);
    dtaseg = s.es, dtaoff = r.x.bx;
    r.h.ah = 0x51;                       // get PSP
    intdos (&r, &r);
    pspseg = r.x.bx;

    // locate INDOS flag
    r.h.ah = 0x34;
    intdosx (&r, &r, &s);
    indos = (char far*) MK_FP(s.es, r.x.bx);

    // locate critical error flag
    r.x.ax = 0x5D06;
    intdosx (&r, &r, &s);
    critical = (char far*) MK_FP(s.ds, r.x.si);

    // hook interrupts
    oldint8  = getvect (0x08);
    oldint9  = getvect (0x09);
    oldint13 = getvect (0x13);
    oldint28 = getvect (0x28);
    setvect (0x08, Handler (TSRint8));
    setvect (0x09, Handler (TSRint9));
    setvect (0x13, Handler (TSRint13));
    setvect (0x28, Handler (TSRint28));

    return 1;
}

//--------------------------------------------------------------------------
//
//      TSR::run
//
//      This function makes the TSR resident, and will only return if
//      a copy of the TSR is already loaded.  The virtual function
//      "startup" is called to perform any class-specific intialisation.
//
void TSR::run (int hotkey, unsigned timeslice)
{
    if (stat != SUCCESS)
        return;

    // avoid reloading TSR if already loaded or failed
    if (loaded ())
    {   stat = RELOAD_FAIL;
        return;
    }

    // set hotkey shift state and scancode
    hotshift = (hotkey >> 8) & 0xFF;
    hotscan = hotkey & 0xFF;

    // check for F1 .. F10, which have different scan codes if ALT, CTRL
    // or SHIFT is pressed (ALT takes precedence over CTRL which takes
    // precedence over SHIFT)
    if (hotscan >= F1 && hotscan <= F10)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人深夜视频在线观看| 免费观看久久久4p| 色噜噜狠狠色综合中国| 亚洲欧美日韩国产手机在线| 在线免费亚洲电影| 午夜精品成人在线| 日韩欧美www| 成人午夜在线免费| 亚洲精品写真福利| 7777女厕盗摄久久久| 韩国一区二区在线观看| 国产精品―色哟哟| 欧美系列亚洲系列| 另类调教123区| 国产欧美在线观看一区| 一本大道久久a久久综合婷婷| 亚洲情趣在线观看| 精品亚洲国产成人av制服丝袜| 精品一区二区三区免费毛片爱| 免费在线观看视频一区| 国产成人免费xxxxxxxx| 国产69精品久久久久777| 成人性生交大片免费看中文| 性久久久久久久| 91免费在线视频观看| 91福利视频在线| 久久免费的精品国产v∧| 亚洲欧洲成人自拍| 亚洲免费成人av| 精品无人码麻豆乱码1区2区| 综合久久综合久久| 亚洲一区二区三区自拍| 韩日欧美一区二区三区| 欧美精品在线视频| 日韩亚洲国产中文字幕欧美| 国产不卡视频在线观看| 欧美色网一区二区| 麻豆一区二区99久久久久| 国产精华液一区二区三区| 亚洲人成在线播放网站岛国| 同产精品九九九| 日韩色视频在线观看| 中文字幕一区二区三区四区 | 日韩不卡免费视频| 精品在线播放免费| 亚洲欧美日韩在线| 欧美精品乱码久久久久久| 日日夜夜精品视频免费| 亚洲美女偷拍久久| 毛片不卡一区二区| 欧美aaaaaa午夜精品| 国产精品久久久一本精品 | 337p粉嫩大胆色噜噜噜噜亚洲 | 欧美大胆一级视频| 国产丝袜美腿一区二区三区| 99re在线精品| 欧美日本韩国一区| 精品播放一区二区| 精品sm在线观看| 一区二区成人在线视频| 日韩午夜激情视频| 亚洲精品一区二区三区精华液| 久久看人人爽人人| 亚洲人亚洲人成电影网站色| 欧美不卡一二三| 韩国v欧美v日本v亚洲v| 国产精品一二三在| 欧美丰满美乳xxx高潮www| 国内成人精品2018免费看| 国产一区三区三区| 久久精品国产成人一区二区三区| 日本va欧美va精品发布| 精品欧美一区二区久久| 欧美性猛片aaaaaaa做受| 日本怡春院一区二区| 国产一区不卡视频| 欧美日本免费一区二区三区| 麻豆精品一区二区| 国产最新精品免费| 亚洲欧美欧美一区二区三区| 欧美一区二区三区公司| 国产精品久久久久四虎| 中文字幕亚洲电影| 亚洲视频免费在线观看| 亚洲欧美区自拍先锋| 玉足女爽爽91| 亚欧色一区w666天堂| 日韩主播视频在线| 人人爽香蕉精品| 国产一区中文字幕| 国产电影一区在线| 91视频国产观看| 欧美日韩一卡二卡| 亚洲精品一区二区三区蜜桃下载| 国产三级一区二区三区| 国产精品美日韩| 亚洲国产日韩a在线播放性色| 午夜久久久久久久久| 精品一区二区在线视频| 成人午夜视频在线| 欧洲生活片亚洲生活在线观看| 欧美色中文字幕| 久久新电视剧免费观看| 国产女人18水真多18精品一级做| 综合欧美一区二区三区| 午夜久久久久久| 国产毛片精品一区| 色婷婷国产精品| 日韩欧美第一区| 国产精品高潮呻吟| 日韩av一二三| 97久久精品人人爽人人爽蜜臀| 欧美麻豆精品久久久久久| 亚洲综合一区二区| 精品一区二区免费| 色综合色综合色综合色综合色综合 | 精品一区二区三区免费观看| 国产99精品视频| 欧美视频一区二区| 久久色在线视频| 亚洲在线视频网站| 国产精品一区二区三区网站| 欧美日韩在线精品一区二区三区激情 | 欧美激情艳妇裸体舞| 亚洲午夜在线电影| 国产乱码精品1区2区3区| 欧美综合一区二区| 国产日本欧洲亚洲| 日本在线不卡视频| 色天天综合久久久久综合片| 精品福利一区二区三区免费视频| 亚洲美女免费在线| 国产成人在线视频播放| 欧美日韩亚洲综合在线| 中文字幕巨乱亚洲| 日韩精品电影在线观看| 91在线丨porny丨国产| ww亚洲ww在线观看国产| 亚洲一区二区三区美女| 成人黄色一级视频| 精品国产凹凸成av人导航| 亚洲高清免费视频| 色呦呦日韩精品| 中文字幕国产精品一区二区| 激情成人午夜视频| 日韩一区二区免费在线观看| 亚洲综合视频网| 91免费小视频| 中文av一区二区| 国产一区二区在线电影| 日韩美女视频一区二区在线观看| 亚洲韩国一区二区三区| 91在线观看美女| 国产精品毛片久久久久久| 狠狠狠色丁香婷婷综合激情 | 欧美人与禽zozo性伦| 一区二区三区日韩在线观看| 不卡电影免费在线播放一区| 国产亚洲一区二区三区在线观看| 老色鬼精品视频在线观看播放| 欧美视频在线一区| 亚洲一区二区三区四区在线观看 | 亚洲人吸女人奶水| 99久久精品费精品国产一区二区| 国产午夜精品一区二区三区四区| 韩国成人精品a∨在线观看| 日韩欧美国产一区二区三区| 蜜臀av在线播放一区二区三区| 欧美日本乱大交xxxxx| 天堂久久一区二区三区| 日本高清免费不卡视频| 一区二区三区在线视频观看| 在线免费观看日本欧美| 亚洲国产视频网站| 91精品久久久久久久久99蜜臂| 日韩电影免费在线观看网站| 69堂精品视频| 免费观看在线综合色| 欧美精品一区二区三区在线播放| 韩国一区二区视频| 国产精品国产成人国产三级| 91丝袜美腿高跟国产极品老师| 亚洲影院免费观看| 中文字幕亚洲成人| 91成人免费在线| 日日摸夜夜添夜夜添精品视频| 3d动漫精品啪啪| 久久成人免费网| 欧美国产日韩在线观看| 风间由美中文字幕在线看视频国产欧美| 国产精品色在线观看| 在线一区二区三区四区五区 | 免费精品99久久国产综合精品| 日韩午夜三级在线| 成人一区二区在线观看| 亚洲一区二区三区在线播放| 日韩三级在线观看| av在线综合网| 午夜电影网一区| 久久久影视传媒|