[comp.sys.tandy] Reading/Writing TRS-80 Model III Sectors

TRM900@PSUVM.BITNET (Tony R. Marasco) (10/14/88)

For some time now I have been trying to come up with the Port codes to
read/write sectors on my TRS-80 Model III.  The ports are X'F0-X'F4 if I'm
not mistaken, but I don't know what code I have to send to get a read/write.
I know how to turn the drive motor on and I have written a program that tells
me what track and sector the drive is working with by patching into the
keyboard routine.  Any help is greatly appreciated.

-------
+-------------------------------------------------------------------------+
| Tony Marasco                 |  UUCP: psuvax1!psuvm!trm900              |
| Penn State University        |  BITNET: trm900@psuvm.BITNET             |
| Schuylkill Haven Highway     |                   - or -                 |
| Schuylkill Haven, PA 17976   |  trm900%psuvm.psu.edu@CUNYVM.CUNY.EDU    |
| "Questions are a burden for others.  Answers are a prison for oneself." |
|       -- The Prisoner                                                   |
+-------------------------------------------------------------------------+

ditto@cbmvax.UUCP (Michael "Ford" Ditto) (10/18/88)

In article <57322TRM900@PSUVM> TRM900@PSUVM.BITNET (Tony R. Marasco) writes:
>For some time now I have been trying to come up with the Port codes to
>read/write sectors on my TRS-80 Model III.  The ports are X'F0-X'F4 if I'm
>not mistaken, but I don't know what code I have to send to get a read/write.

Floppy I/O is much more complicated than a few IN/OUT instructions, and
requires interaction with the Floppy Disk Controller chip.  The easiest
solution is to use the DOS routines; if you have LDOS there are documented
entry points for raw sector I/O (and then your program will work on hard
drives, ram disks, etc.), but if you have to run under MIII TRSDOS you
have to get really slimy and call some undocumented DOS routines (which
probably won't be there the next TRSDOS release :-) :-) :-)).

If anyone's interested, I can post the TRSDOS 1.3 sector I/O routine
addresses.

I can also post the port definitions, but they are useless without a
WD279X-series spec sheet.  Here's a guess from memory (It's been
about 3 years since I hacked MIII's):

	0xF0: FDC command/status
	0xF1: FDC track
	0xF2: FDC sector
	0xF3: FDC data
	0xF4: various (bits 0-3: drive select; others are side select,
		       density, precomp, some other stuff.)

I'll look up the details when I get home.

I think I have some sector I/O code somewhere; if someone's *really*
desparate to bypass the DOS I could probably find it.

> I have written a program that tells
>me what track and sector the drive is working with by patching into the
>keyboard routine.

What?  Huh?
-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ford@kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto@cbmvax.commodore.com