Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : FLOPTST2.ZIP
Filename : FLOPTST.DOC
;
; Function: FloppyTst
; Author: Dave Peckam
;
; Purpose: FloppyTst determines the status of the specified floppy
; disk drive. FloppyTst 2.0 was designed to remove the
; need for Tom Rettig's Library and to make FloppyTst less
; machine-dependent.
;
; The original version worked under the Autumn '86 release
; of Clipper and release 1.1 of Tom Rettig's Library. In
; the latest update to the Library, however, Tom Rettig
; uses the Clipper memory allocation system. FloppyTst 2.0
; uses a fixed buffer of 512 bytes.
;
; FloppyTst has been tested with:
;
; Autumn '86 and Summer '87 releases of Clipper
; Release 1.1 of Tom Rettig's Library (TR86 and TR87)
;
;
; History: Dec 9, 1986 FloppyTst 1.0 written in Clipper
; by Charlie Butler with calls to the
; ROMBIOS, Allocate and DeAlloc routines
; from Tom Rettig's Library
;
; Feb 12, 1988 Converted FloppyTst to external assembler
; function written in MASM 3.0. Function now
; accepts integer instead of character disk
; specifiers.
;
; Converted Int 13h BIOS calls to
; Int 25h (MS-DOS Absolute Disk Read) and
; Int 26h (MS-DOS Absolute Disk Write) calls
; for greater MS-DOS compatibility
;
; Feb 17, 1988 Added support for "Sector not found"
; and "Unknown Media" errors
;
; Feb 18, 1988 Function now accepts character parameters.
; For example, call with "A", "a", "B" or "b".
;
;
; Date: February 17, 1988
; Version: 2.0a for Clipper '87
; Language: Microsoft Macro Assembler (MASM) version 3.0
;
; Syntax: FloppyTst (
;
; where
;
; Returns: A
;
; 0 - Drive loaded and ready to read or write
; 1 - Drive door open or diskette inserted upside-down
; 2 - Diskette is unformatted
; 3 - Diskette has a write-protect tab installed
; 4 - Diskette is of incorrect media type for this floppy drive
; 8 - Diskette has been damaged (Sector not found) or
; is not formatted
; 15 - Invalid drive specifier passed in
;
; n - Any return code other than those listed here indicates
; that an error did occur, though the source of the error
; can not be exactly determined
;
;
; Notes: The
; character values: "A", "a", "B" or "b". Thus, calls of the
; form FloppyTst ("A") and FloppyTst ("B") are legal. If
; is not one of these values, the value 15 will be returned as
; the function value. The function may return a misleading
; value if drive B: is tested on a machine with only an A: drive.
; The result will usually correspond to the status of the A: drive.
;
; The DOS Critical Interrupt handler may, under certain
; circumstances, report a confusing or ambiguous error.
; For example, attempting to read or write to a non-DOS
; diskette or a 1.2Mb diskette formatted for 1.2Mb
; capacity may cause FloppyTst to return eight instead
; of four. If you understand this, you may provide
; better error messages for users. For those who have
; replaced the MS-DOS Critical Error Handler with their
; own, you must be sure that your replacement handler
; returns the same error codes, or that you modify the
; error routines in this assembler module to conform to
; your return codes.
;
;
; Algorithm:
; 1. Verify that valid drive specifier has been passed.
; 2. Read sector zero into buffer using MS-DOS interrupt 25h,
; Absolute Read.
; 3. Write buffer to sector zero using MS-DOS interrupt 26h,
; Absolute Write.
; 4. The return value is based upon error codes returned from
; the MS-DOS Critical Error handler.
;
;
;******************************************************************************
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/