⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lastdrv2.c

📁 汇编源代码大全
💻 C
字号:
/* LASTDRV2.C -- uses only documented DOS */

#include <stdlib.h>
#include <stdio.h>

main()
{
    unsigned lastdrv;

#ifdef __TURBOC__
    asm mov ah, 19h         /* C-style comments only */
    asm int 21h
    asm mov dl, al
    asm mov ah, 0x0e        /* C-style hex */
    asm int 21h             /* assembly-style hex */
    asm xor ah, ah
    asm mov lastdrv, ax     /* refer to C variables */
#elif (defined(_MSC_VER) && (_MSC_VER >= 600)) || defined(_QC)
    _asm {
        mov ah, 19h         ; can include assembly-style comments
        int 21h             /* and C-style as well */
        mov dl, al          // and this style as well
        mov ah, 0x0E        ; can include C-style hex numbers
        int 21h             ; or assembly-style hex numbers
        xor ah, ah
        mov lastdrv, ax     ; can refer to C variables in _asm
        }
#else
#error Requires inline assembler
#endif

    fputs("LASTDRIVE=", stdout);
    putchar('A' - 1 + lastdrv);
    putchar('\n');
    return lastdrv;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -