![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-15 04:05 |
47,812 topics / 349,917 posts / today 0 new / 48,268 members |
| DOS开发编程 & 发展交流 (开发室) » BASIC source code to determine whether a CD-ROM drive is installed |
| Printable Version 775 / 1 |
| Floor1 qb45 | Posted 2003-09-20 00:00 |
| 高级用户 Posts 194 Credits 677 | |
|
'$INCLUDE: 'qb.bi'
DIM SHARED ax, bx, cx, dx PRINT "The CD-ROM drive letter is ";disk$ FUNCTION disk$ DIM d$(25) d$(0) = "A:": d$(1) = "B:": d$(2) = "C:": d$(3) = "D:": d$(4) = "E:": d$(5) = "F:" d$(6) = "G:": d$(7) = "H:": d$(8) = "I:": d$(9) = "J:": d$(10) = "K:": d$(11) = "L:" ax = &H1500 int2f IF bx = 0 THEN PRINT "No CD-ROM found --No CDRom" ELSE disk$ = d$(cx) END FUNCTION SUB int2f InRegs.ax = ax InRegs.bx = bx InRegs.cx = cx InRegs.dx = dx InRegs.flags = flags INTERRUPTX &H2F, InRegs, OutRegs ax = OutRegs.ax bx = OutRegs.bx cx = OutRegs.cx dx = OutRegs.dx flags = OutRegs.flags END SUB |
|
| Floor2 qb45 | Posted 2003-09-29 00:00 |
| 高级用户 Posts 194 Credits 677 | |
|
Explanation: INT 2F interrupt, entry AH=15H
If BX returns zero, there is no CD-ROM drive! |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |