


                        Ŀ
                                          
                            APPENDIX  C   
                                          
                        


           Ŀ
                                                        
                     THE STRANGE CASE OF N = 0          
                                                        
           




The data length code N = 0  is known as the 'sector length not
specified code'.
The Disk Base Table (Chapter II - section 7) has an entry (known as)
DTL  that is supposed to hold the data length to be used when N = 0.
Such a parameter is also required in the command phase of some
LDC operations (e.g. read track).

At first glance, it does not seem too difficult to guess the meaning
of all this.

When it comes to experimenting, things turn out to be rather
surprising. To be more precise let me say that I find strange results
when experimenting. Maybe this is specific to my computer brand and /
or model.

Anyway, I think that the reader should experiment :


EXPERIMENT

(a)  Format track 10 / head 0 using INT 13h / function 5. Call with

             data length code    00
             sectors / track     09
             format gap          80
             fill byte           F6h
             CHRN fields         10  0  R  0   (1  <=  R  <=  9).

The DTL value is irrelevant to format operations; if the data length
code is 0, the data length is always 128.


(b)  Reformat (a part of) track 10 / head 0  using an ABORTED  LDC
     format operation. Call with

             data length code    00
             sectors / track     01
             fill byte           F5h
             CHRN field          10  0  1  0 .

The operation MUST be ABORTED immediately after the data field CRC
word is written to the disk.


(c)  Use a LDC read track operation (call with  N = 0) to read
     track 10 / head 0.
When I do this I find

                        80 bytes of F5h
       followed by      bytes of F6h

(whatever the value of DTL is) !

No CRC error is reported.


(d)  Use INT 13h / function 2  to read track 10 / head 0 / sector 1.
     When I do this I find

                        80 bytes of F5h
       followed by      48 bytes of F6h    (from sector 2 )

(whatever the value of DTL is) !

No CRC error is reported.



My conclusion is (maybe it only applies to my computer) that
with  N = 0 :
When it comes to  read/read track  operations the disk controller
does not look at the value of DTL ; it uses invariably a value of its
own : 80 = 50h.
No CRC error is returned because although only 80 bytes are sent to
the data bus, the disk controller reads  * internally *  the complete
sector (128 bytes) and then performs a CRC check.



What about write operations called with N = 0 ?
From my own experience they seem to be quite unreliable.



Of course, my computer capabilities are not of general interest but it
seems that readers should be warned :


      Warning  Ŀ
                                                              
       DO NOT take it for granted that the disk controller    
       supports sector sizes with N = 0.                      
       Format operations cause no problem but                 
       read/write  operations may show  'no error' although   
       they do not read/write  WHERE  they are expected.      
                                                              
    


There are some 'safe' methods to try reading/writing sectors of data
length code N = 0  (they can also be used when the CHRN field shows a
value of N that does not match the 'real' data size) :

(i)   to read :  use a read track operation (call with an appropriate
                 read/write gap  and  N <> 0 ).

(ii)  writing  is more difficult; it often involves several format/
               write operations some of which are to be aborted.