home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
open
/
qbinters.lzh
/
SETDRIVE.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-04-23
|
1KB
|
58 lines
'Sun Apr 23, 1989 10:59:44 pm
'*****************************************************************************
'This routine sets the default drive. It contains a function which reads the
'default drive, as well.
'*****************************************************************************
TYPE RegType
ax AS INTEGER
bx AS INTEGER
cx AS INTEGER
dx AS INTEGER
bp AS INTEGER
si AS INTEGER
di AS INTEGER
flags AS INTEGER
END TYPE
DIM SHARED inregs AS RegType, outregs AS RegType
DECLARE SUB setdrive (drive$)
DECLARE FUNCTION drive$ ()
setdrive "c:"
PRINT drive$
FUNCTION drive$
inregs.ax = &H1900
CALL interrupt(&H21, inregs, outregs)
ah = FIX(outregs.ax / 256)
al = outregs.ax - (ah * 256)
SELECT CASE al
CASE 0: d$ = "A:"
CASE 1: d$ = "B:"
CASE 2: d$ = "C:"
CASE 3: d$ = "D:"
CASE 4: d$ = "E:"
CASE 5: d$ = "F:"
CASE 6: d$ = "G:"
END SELECT
drive$ = d$
END FUNCTION
SUB setdrive (drive$)
d$ = UCASE$(LEFT$(drive$, 1))
SELECT CASE d$
CASE "A": d = 0
CASE "B": d = 1
CASE "C": d = 2
CASE "D": d = 3
CASE "E": d = 4
CASE "F": d = 5
CASE "G": d = 6
END SELECT
inregs.ax = &HE00: inregs.dx = d
CALL interrupt(&H21, inregs, outregs)
END SUB