[net.lang.forth] How Do You Use The Second Drive?

timborn@ihuxv.UUCP (10/12/83)

I am using Fig-Forth on an Apple.  From what I can make of the documentation,
I should be able to use the built in word "DR1" in some fashion to make
the computer access disk drive one (as opposed to drive zero).
The word is known to the system; it doesn't give any errors if I compile
it into a definition.  I'm not sure exactly how it's supposed to be used.
Would you mail me *one* correct example of how to get the computer to 
access drive one?  Everything I've come up with so far has failed.

thanks,
tim born
(...!ihuxv!timborn)

CSvax:Pucc-H:ags@pur-ee.UUCP (10/17/83)

   The "DR1" problem in fig-FORTH for the Apple is caused by the "R/W" word,
which, as distributed with the model, does not know how to access more than
one drive.  In fact, if you use "DR1" and then try to read, say, block 1, then
"R/W" attempts to read from track 35 on drive 0, which is an illegal disk
address.  What you want, of course, is to trap track numbers higher than 34
and assign them to other drives.

   You need to read the description of RWTS in the Apple DOS Manual to 
understand what is happening.  There are two locations in the I/O Block
(IOB) that you need to maintain:

     IOBPDN (IOB + 10 HEX) - drive accessed on previous command
     IBDRVN (IOB + 2)      - drive accessed by current command

   Note that the IOB is located at $B7E8.  Just pick up the old IBDRVN
and save it at IOBPDN.  Then when you compute the track number, do one
more divide (by 35) and use the quotient (0 or 1) to determine the drive
number.  Of course FORTH's drive 0 as known as drive 1 to Apple DOS.  Then
use the remainder from the divide for the track number.

   One other problem is that the model attempts to number blocks on the disk
beginning at zero.  This does not work, since the rest of the FORTH system
assumes that a block number of zero means that input is coming from the
keyboard, not from disk.  Therefore you probably want to offset the block
numbers by one so that you can use the whole disk.

				Dave Seaman
				..!pur-ee!pucc-h:ags