UTILS\FLOP.DOC  ·  DOC  ·  5.7 KB  ·  1991-04-01  ·  from WhatPC_Issue-21_Apr-1991
                                    FLOP

                              Author  Rick Housh

         For PC's and compatibles

         SPEED UP YOUR FLOPPIES - Start doing it now.

         For reference, see the column "C Notes", by Joseph Katz in
         SEXTANT magazine, May-June, 1987, pp. 46-53, and the article
         "Faster Disk Access for Heath/Zenith MS-DOS", by Pat Swayne,
         REMark magazine, August, 1986.  Both those articles deal with
         the concept of this simple utility.

         This program, while originally written for Heath/Zenith PC
         compatible computers, should work with any IBM PC compatible,
         with ANY version of MS-DOS, with assembly by ANY version of
         MASM.

         Reconfigures floppy drives to modify the head settle times
         and wait for motor start set in ROM.  These original times
         have proved to be overly conservative for the latest
         half-height drives with locking latches, in which the heads
         are always engaged.

         Based on an original idea by Pat Swayne, modified and
         translated by me into Turbo Pascal, rewritten by Joseph Katz
         in 'C', and here translated back into assembly language for
         MASM.

         All higher language overhead has been removed here, and the
         medium speed has been modified slightly, to allow some head
         settle time.  Experience and testing have indicated that,
         while reducing the head settle time to zero has increased
         transfer rates, it has also increased the number of retries
         caused by read or write errors.  If that does not prove to be
         a problem, use FLOP FAST, otherwise use FLOP MEDIUM.  Almost
         never should FLOP SLOW be required.

         How will you know if you have an excessive number of retries?
         Beats me!  My Shugarts do, my Teacs don't.

         This is NOT a TSR (memory resident) program.  It patches (on
         the fly) the memory locations in which DOS holds the DBP
         (disk base parameters).  Therefore, it can be run at any time
         and will effectuate the changes immediately.

         Typically, switching from FLOP SLOW to FLOP FAST will result
         in an increase in the data transfer rate of about 30%, a
         worthwhile gain.

         Actually, to be completely "well-behaved" this program should
         get the segment and offset addresses of the disk parameters
         through function 35 (hex) of DOS interrupt 21 (hex), which
         would supply the vector to them, then use function 25 (hex)
         to reset the vectors to entirely new locations.

         Nevertheless, in the interests of speed and size, direct
         memory access is used herein, based on the assumption that
         Bill Gates and "Big Blue" will not decide to grace us all
         with a change, and the values in the original locations are
         simply "patched" with new values.  "And God bless us all,"
         said Tiny Tim.

         In his column Dr.  Katz expressed some anxiety that many
         Turbo Pascal programmers might be in better physical
         condition than he, implying some apprehension that he might
         be in danger of abuse for criticizing someone's choice of
         language.  I, for one, am just a simple country lawyer, as
         deskbound as any college professor such as Dr.  Katz, and
         have no intention of disputing his claims that C can produce
         more compact programs.  On the contrary, I agree.  What I do
         not agree with is that one needs a C shell simply for the
         purpose of calling a few assembly language routines.

         To those of you who are interested, because I was taken
         somewhat to task by Dr.  Katz for my Turbo Pascal program,
         which occupied about 12,000 bytes, while his 'C' program only
         used about 6,000, this assembly program, which performs
         almost exactly the same function, uses only 472 bytes, less
         than one standard MS-DOS disk sector.

         How can that be, you say?

         Well, it has nothing in it that it doesn't use, while
         compilers have a lot of unused baggage.  Yes, Turbo Pascal
         has more than C.

         You get what you pay for (with your coding time) and
         compilers carry overhead.  This is a very small program, and
         should be written in assembly language.  I have done it here
         just to show the contrast.

         It could even be written in <UGH> BASIC and compiled, in
         which case it would need about 32,000 bytes.  (Think of all
         the unused "PLAY" and "SCREEN" and "Who-Knows-What-Else" code
         which is carried along, unused).

         It is the "#include <stdio.h>" in Dr.  Katz' C program which
         carries the C baggage.  The equivalent code is automatically
         included in Turbo Pascal and Basic.  Assembly includes
         nothing you don't write yourself.

         If you are interested, access Compuserve, Heath Users Group,
         (GO PCS 48) and download my Turbo Pascal program DSKSPD.ARC,
         in addition to this program, FLOP.ARC.  I could not find Dr.
         Katz' program SPIN.C (mentioned in his SEXTANT column) there.
         I guess you'll have to buy that issue.

         The whole schmear (SP?) is a good lesson in why you should
         learn assembly language.

                            Rick Housh
                            Compuserve PIN 72466,212
                            MUG (Mission, KS. User's Group)
                            BBS (913) 362-9583



Press any key to continue...