lastdrv2.c
来自「汇编源代码大全」· C语言 代码 · 共 37 行
C
37 行
/* 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 + =
减小字号Ctrl + -
显示快捷键?