<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bitchin100.com/wiki/index.php?action=history&amp;feed=atom&amp;title=TPDD-2_Driver_Reverse_Engineering</id>
	<title>TPDD-2 Driver Reverse Engineering - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bitchin100.com/wiki/index.php?action=history&amp;feed=atom&amp;title=TPDD-2_Driver_Reverse_Engineering"/>
	<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;action=history"/>
	<updated>2026-04-29T17:55:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=1096&amp;oldid=prev</id>
		<title>Jhoger: Reverse engineering by Joel Dinda moved to TPDD-2 Driver Reverse Engineering: improve title</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=1096&amp;oldid=prev"/>
		<updated>2009-02-23T17:47:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/index.php?title=Reverse_engineering_by_Joel_Dinda&quot; class=&quot;mw-redirect&quot; title=&quot;Reverse engineering by Joel Dinda&quot;&gt;Reverse engineering by Joel Dinda&lt;/a&gt; moved to &lt;a href=&quot;/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&quot; title=&quot;TPDD-2 Driver Reverse Engineering&quot;&gt;TPDD-2 Driver Reverse Engineering&lt;/a&gt;: improve title&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:47, 23 February 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Jhoger</name></author>
	</entry>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=933&amp;oldid=prev</id>
		<title>Jhoger at 07:01, 31 January 2009</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=933&amp;oldid=prev"/>
		<updated>2009-01-31T07:01:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:01, 31 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l230&quot;&gt;Line 230:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 230:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;July 4, 88&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;July 4, 88&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Model T Developer Reference]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jhoger</name></author>
	</entry>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=803&amp;oldid=prev</id>
		<title>64.81.88.222 at 07:42, 8 January 2009</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=803&amp;oldid=prev"/>
		<updated>2009-01-08T07:42:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:42, 8 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;======================================================&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;======================================================&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l228&quot;&gt;Line 228:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 229:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Joel Dinda&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Joel Dinda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;July 4, 88&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;July 4, 88&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>64.81.88.222</name></author>
	</entry>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=802&amp;oldid=prev</id>
		<title>64.81.88.222: New page: TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2) ====================================================== Joel Dinda [75725,1134]  While FLOPPY isn&#039;t my favorite program, it provides T...</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=TPDD-2_Driver_Reverse_Engineering&amp;diff=802&amp;oldid=prev"/>
		<updated>2009-01-08T07:42:04Z</updated>

		<summary type="html">&lt;p&gt;New page: TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2) ====================================================== Joel Dinda [75725,1134]  While FLOPPY isn&amp;#039;t my favorite program, it provides T...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;TD2TIP.009 Direct Sector Access using FLOPPY (FLOPPY2)&lt;br /&gt;
======================================================&lt;br /&gt;
Joel Dinda&lt;br /&gt;
[75725,1134]&lt;br /&gt;
&lt;br /&gt;
While FLOPPY isn&amp;#039;t my favorite program, it provides TDD2 users the capability&lt;br /&gt;
to bypass the TDD file structure and access disk sectors directly.  The most&lt;br /&gt;
obvious applications for this capability are utility programs (there are&lt;br /&gt;
several such in this Library) and (random access?) database programs (aside:&lt;br /&gt;
database programmers will have to write their own file-management routines, a&lt;br /&gt;
matter this discussion ignores).  This file lists all-in-one-place those things&lt;br /&gt;
someone writing such a program will need to know.&lt;br /&gt;
&lt;br /&gt;
First I&amp;#039;ll talk about syntax, then I&amp;#039;ll discuss some necessary concerns,&lt;br /&gt;
finally I&amp;#039;ll discuss some background matters.&lt;br /&gt;
&lt;br /&gt;
**WARNING:  This is an advanced and fairly specialized programming tip.  Only&lt;br /&gt;
fairly experienced M100(etc) programmers will understand some of this&lt;br /&gt;
discussion.  Lots of it is pretty opaque.  While it&amp;#039;s not intended to&lt;br /&gt;
intimidate, you&amp;#039;ve got to be writing a pretty sophisticated program to want to&lt;br /&gt;
know these things.&lt;br /&gt;
&lt;br /&gt;
Powr-DOS/TDD1 users/programmers will want to read DOSTIP.009.&lt;br /&gt;
&lt;br /&gt;
Syntax&lt;br /&gt;
======&lt;br /&gt;
The necessary command is a conventional BASIC CALL:&lt;br /&gt;
&lt;br /&gt;
      CALL Z,Y,X&lt;br /&gt;
Where:&lt;br /&gt;
      Z is the start of FLOPPY&amp;#039;s file transfer routine (depends upon which&lt;br /&gt;
      computer you&amp;#039;re using)&lt;br /&gt;
&lt;br /&gt;
      Y is the code for the activity you wish to provoke (details follow).&lt;br /&gt;
      &lt;br /&gt;
      X is the RAM address of some further instructions necessary for execution&lt;br /&gt;
      of the routine.&lt;br /&gt;
&lt;br /&gt;
Z options:&lt;br /&gt;
----------&lt;br /&gt;
      In M100/T102, Z is 62297 (-3239 integer).&lt;br /&gt;
      In T200, Z is 58980 (-6556).&lt;br /&gt;
&lt;br /&gt;
Y options:&lt;br /&gt;
----------&lt;br /&gt;
      1 attempts to format the diskette.&lt;br /&gt;
      3 attempts to read the diskette.&lt;br /&gt;
      4 attempts to write to the diskette.&lt;br /&gt;
      5 checks (reports) the status of the drive (so do the other options).&lt;br /&gt;
&lt;br /&gt;
      --TD2TIP.005 says, incorrectly, the Y=2 writes to the diskette (*easy*&lt;br /&gt;
      mistake).  If someone figures out what Y=2 actually *does* do, I&amp;#039;d like&lt;br /&gt;
      to hear about it.  Thanks.&lt;br /&gt;
&lt;br /&gt;
X options:&lt;br /&gt;
----------&lt;br /&gt;
      Any legal RAM address--but some are far better than others.  I&amp;#039;ll return&lt;br /&gt;
      to this momentarily.&lt;br /&gt;
&lt;br /&gt;
Further information at location X:&lt;br /&gt;
----------------------------------&lt;br /&gt;
The routine beginning at Z checks at X for two pieces of information:&lt;br /&gt;
      X and X+1 store the address, in RAM, reserved (by you) for the file&lt;br /&gt;
      transfer.  (Call it a buffer [BF]; this is its lowest address [possibly&lt;br /&gt;
      HIMEM].  I discuss this further below.)  Like most M100 two-byte&lt;br /&gt;
      addresses, these are stored LSB+MSB.  (I suggest a simple solution in&lt;br /&gt;
      the discussion below.)&lt;br /&gt;
&lt;br /&gt;
      X+2 is the diskette sector being transferred.&lt;br /&gt;
&lt;br /&gt;
      It may help to think of the information at X this way:  You&amp;#039;re&lt;br /&gt;
      transferring data [content and direction unspecified] between a buffer&lt;br /&gt;
      which is indicated at X &amp;amp; X+1 and a diskette sector which is indicated at&lt;br /&gt;
      X+2.&lt;br /&gt;
&lt;br /&gt;
Necessary Concerns:&lt;br /&gt;
===================&lt;br /&gt;
M100 or T200?&lt;br /&gt;
-------------&lt;br /&gt;
By this time there&amp;#039;s no excuse for donating a computer- specific program to&lt;br /&gt;
this SIG without good reason.  PEEK(1) returns 51 in M100/T102; it returns 171&lt;br /&gt;
in T200.  Once you know this, you can assign the appropriate value to Z and any&lt;br /&gt;
other computer-related POKEs, PEEKs, or CALLs you&amp;#039;ll be using.  (I like to&lt;br /&gt;
work over the keyboard buffer, for instance.)&lt;br /&gt;
&lt;br /&gt;
Is FLOPPY there?&lt;br /&gt;
----------------&lt;br /&gt;
Next, check to see if FLOPPY&amp;#039;s actually installed.  Tandy&amp;#039;s BACKUP does this by&lt;br /&gt;
checking four RAM locations; the following line is a slightly more compact&lt;br /&gt;
version of theirs:&lt;br /&gt;
      IF PEEK(Z)=229 AND PEEK(Z+1)=94 AND PEEK(Z+239)=4 AND PEEK(Z+240)=195&lt;br /&gt;
      THEN continue ELSE error: &amp;quot;No System&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Buffers&lt;br /&gt;
-------&lt;br /&gt;
Next create one or more buffers for your program&amp;#039;s use.&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;ll need one buffer for each sector you intend to duplicate in RAM at any&lt;br /&gt;
one time; the exact number will depend either upon the nature of your&lt;br /&gt;
application or the amount of RAM available.  Each buffer will be 1284 bytes&lt;br /&gt;
long; it should be locked in with some variation of the following instruction:&lt;br /&gt;
      CLEAR256,HIMEM-(1284*(number of buffers))&lt;br /&gt;
&lt;br /&gt;
It is *always* good practice to restore HIMEM to its previous value when the&lt;br /&gt;
program finishes; there are at least two workable schemes.  Folks who use&lt;br /&gt;
MAXRAM instead of HIMEM in programs which overwrite high memory are despicable&lt;br /&gt;
creatures; they should, at least, warn users that they&amp;#039;re destroying files.&lt;br /&gt;
&lt;br /&gt;
Variable X:&lt;br /&gt;
-----------&lt;br /&gt;
The third CALL argument points to a RAM address containing address information&lt;br /&gt;
for the CALL&amp;#039;s use.  I know of two ways to do this, but suggest that everyone&lt;br /&gt;
use this one:&lt;br /&gt;
&lt;br /&gt;
If BF is the first (lowest) address in the buffer, and S is the sector number:&lt;br /&gt;
&lt;br /&gt;
      0 ... :DEFINT T:DIM T(1): ...&lt;br /&gt;
      16 ... :T(0)=BF:T(1)=S:CALL Z,Y,VARPTR(T(0)): ...&lt;br /&gt;
&lt;br /&gt;
      This is a &amp;quot;cute trick&amp;quot;; it works because M100 stores T(0) and T(1)&lt;br /&gt;
      together in RAM; VARPTR(T(0)) tells that location.  [Please notice the&lt;br /&gt;
      DEFINT!  It matters!]&lt;br /&gt;
&lt;br /&gt;
Some of the SIG&amp;#039;s utilities use POKEs to accomplish this, but there&amp;#039;s no&lt;br /&gt;
advantage (and the coding&amp;#039;s more difficult).&lt;br /&gt;
&lt;br /&gt;
Detecting Errors&lt;br /&gt;
----------------&lt;br /&gt;
While this CALL does not directly return error messages, it *does* return error&lt;br /&gt;
information.  This information is stored at address X; if you&amp;#039;ve used&lt;br /&gt;
VARPTR(T(0)), you only need to determine the value of T(0).  Good practice (and&lt;br /&gt;
common sense) dictate that you check this value *immediately* after attempting&lt;br /&gt;
any file transfer.&lt;br /&gt;
&lt;br /&gt;
These are the documented errors:&lt;br /&gt;
      T(0)=0 or 1       no error&lt;br /&gt;
      T(0)=3            RS232 Not Ready (Powr-DOS Error 59/NR)&lt;br /&gt;
      T(0)=5            Communications Error (61/CM)&lt;br /&gt;
      T(0)=6            Write Protected (63/WP)&lt;br /&gt;
      T(0)=8            No Disk in Drive (65/ND)&lt;br /&gt;
      T(0)=9            Hard Trouble (66/HT)&lt;br /&gt;
      T(0)=12           Drive Not Responding (60/DN) [not previously documented]&lt;br /&gt;
&lt;br /&gt;
Presumably the &amp;quot;empty&amp;quot; numbers can be generated, but I haven&amp;#039;t figured out how.&lt;br /&gt;
If you discover one, please pass it along.  Thanks.&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve been using the following approach.  Obviously there are others, but I&amp;#039;m&lt;br /&gt;
happy with this one:&lt;br /&gt;
&lt;br /&gt;
      0 ON ERROR GOTO 99: ...&lt;br /&gt;
            ...&lt;br /&gt;
      16 ... :CALL Z,X,VARPTR(T(0)):GOSUB98: ...&lt;br /&gt;
            ...&lt;br /&gt;
      97 MENU&lt;br /&gt;
      98 IF T(0)&amp;lt;2 THEN RETURN ELSE IF T(0)=6 OR T(0)=8 THEN ERROR 63 ELSE IF&lt;br /&gt;
      T(0)=3 OR T(0)=5 OR T(0)=9 OR T(0)=12 THEN ERROR 60 ELSE ERROR 99&lt;br /&gt;
      99 IF ERR=63 THEN PRINT &amp;quot;Disk Error&amp;quot; ELSE IF ERR=60 THEN PRINT &amp;quot;Drive&lt;br /&gt;
      Error&amp;quot; ELSE PRINT &amp;quot;Error&amp;quot; ERR &amp;quot;in line&amp;quot; ERL:END&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve used ERROR 99 as a clue that we&amp;#039;ve found a new error code.  The other&lt;br /&gt;
codes simplify conversion between Powr-DOS &amp;amp; FLOPPY.&lt;br /&gt;
&lt;br /&gt;
You can modify this to RESUME or quit, as appropriate.  For instance, knowledge&lt;br /&gt;
that T(0)=6 means the diskette is write protected can be used with CALL Z,5,X&lt;br /&gt;
force the user to protect a diskette&amp;#039;s files.&lt;br /&gt;
&lt;br /&gt;
Background&lt;br /&gt;
==========&lt;br /&gt;
Much of the technical information was obtained by studying Tandy&amp;#039;s BACKUP.BA,&lt;br /&gt;
which is supplied with the TDD2 drive, and by systematic experimentation.  Some&lt;br /&gt;
of the other discussion follows from Powr-DOS experience.&lt;br /&gt;
&lt;br /&gt;
Buffer Format:&lt;br /&gt;
--------------&lt;br /&gt;
The first byte in the sector (more exactly, in the buffer) (let&amp;#039;s call it BF+0)&lt;br /&gt;
indicates the diskette format in use.  0 means it&amp;#039;s a TDD1 diskette; 22 means&lt;br /&gt;
it&amp;#039;s a TDD2 diskette.  This is evidently provided for our information, as&lt;br /&gt;
changing it has no effect--if you &amp;quot;save&amp;quot; a sector with this byte changed, then&lt;br /&gt;
retrieve it again, it&amp;#039;s been restored to its original value.&lt;br /&gt;
&lt;br /&gt;
The second byte in the sector (well, buffer) (BF+1) is the file vector:&lt;br /&gt;
      0 means the sector&amp;#039;s empty;&lt;br /&gt;
      255 is an EOF marker; and&lt;br /&gt;
      any other number indicates &amp;quot;file continues here&amp;quot;.&lt;br /&gt;
Since file deletions do *not* modify these vectors, these may be misleading.&lt;br /&gt;
&lt;br /&gt;
Two bytes of unknown consequence follow at BF+2 &amp;amp; BF+3.  They appear to always&lt;br /&gt;
be zero; presumably they could contain information with meaning to the drive.&lt;br /&gt;
&lt;br /&gt;
The next 1280 bytes (starting at BF+4) duplicate the sector&amp;#039;s contents.  If the&lt;br /&gt;
sector is not 0 or 1, this could be anything (TDD2 doesn&amp;#039;t inflict any format).&lt;br /&gt;
Unless modified, Sectors 0 and 1 conform, with three significant modifications,&lt;br /&gt;
to the information in SECTR0.TDD, available from this Library.  Discussion&lt;br /&gt;
follows immediately....&lt;br /&gt;
&lt;br /&gt;
Directory Structure:&lt;br /&gt;
--------------------&lt;br /&gt;
TDD directory structure is discussed at some length in my file SECTR0.TDD. &lt;br /&gt;
Since FLOPPY delivers a somewhat different copy of the sector to RAM, a few&lt;br /&gt;
adjustments must be made; some of these adjustments result from differences&lt;br /&gt;
between the drives, while others seem to be idiosyncratic programming&lt;br /&gt;
decisions.&lt;br /&gt;
&lt;br /&gt;
Perhaps the most important difference between sector buffers created by&lt;br /&gt;
Powr-DOS and FLOPPY is that FLOPPY&amp;#039;s sectors come with four leading bytes (two&lt;br /&gt;
of which contain information), while P-DOS&amp;#039;s come with 12 trailing bytes (one&lt;br /&gt;
of which contains information).  When reading SECTR0.TDD, you must therefore&lt;br /&gt;
add an offset of 4 to most counts, while the file vector check must be adjusted&lt;br /&gt;
from BF+1281 to BF+1.&lt;br /&gt;
&lt;br /&gt;
Since TDD2 diskettes contain two directories (Sectors 0 and 1), certain&lt;br /&gt;
allowances must be made for this.  Except for the allocation table, the&lt;br /&gt;
structure of the directory sector(s) is unchanged from that described in&lt;br /&gt;
SECTR0.&lt;br /&gt;
&lt;br /&gt;
The allocation table *is* changed.  Where TDD1 stores allocation information&lt;br /&gt;
for 80 sectors on half of 160 bits, TDD2 (naturally) uses all 160 bits to store&lt;br /&gt;
twice as much information.  The allocation table is duplicated on both&lt;br /&gt;
directories, effectively describing the entire diskette for either. &lt;br /&gt;
*Important related matter:*  FLOPPY (and any other DOS, near as I can tell)&lt;br /&gt;
updates *both* allocation tables when you add or subtract a file.  One side&lt;br /&gt;
effect of this is that Sector 1 should be considered unavailable under all&lt;br /&gt;
circumstances--unless you&amp;#039;re writing your own file control routines and *never*&lt;br /&gt;
use the TDD2&amp;#039;s built-in routines for file transfers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enough.  That should point you in the right direction....&lt;br /&gt;
Joel Dinda&lt;br /&gt;
July 4, 88&lt;/div&gt;</summary>
		<author><name>64.81.88.222</name></author>
	</entry>
</feed>