[net.micro.atari8] load vectors and whatnot

jhs@MITRE-BEDFORD.ARPA (03/17/86)

I just noticed that "Inside Atari DOS" apparently has an error in describing
the sequence of the control bytes at the end of DOS sectors.  I would
appreciate confirmation by anyone who knows.

Inside Atari DOS (IAD) says that a sector consists of 128 bytes, numbered 0
through 127, and that in DOS files only 125 bytes (0 - 124) are used for data.
(This much is true.)  They go on to say that byte numbers 125, 126, and 127
are numbered as follows:

		125                     126                     127
IAD    | # of bytes actually    6 hi bits=file number     low 8 bits of next-
Version| used in the sector     2 lo bits=hi bits of      sector number (link)
				next-sector number

Documentation supplied with David Young's OMNIMONXL resident monitor/debugger
says that the numbering is

		125                     126                     127
The   | 6 hi bits=file number   low 8 bits of next-     number of bytes
Truth!| 2 lo bits=hi bits of    sector nr (link)        actually used in this
      | next sector nr (link)                           sector.


Based on what I can see in the actual sectors I have looked at, both with
OMNIMONXL and with another independently developed debugger, David Young's
information appears to be correct and Inside Atari DOS appears to have
incorrect information.

I would appreciate confirmation of my conclusion by others who have noticed
the error in IAD.  (Also if they have any other errors I would like to be
made aware of them!)

						John Sangster
						jhs at mitre-bedford.arpa
				   <anypath to ihnp4>!ihnp4!linus!mbunix!jhs

dyer@atari.UUcp (Landon Dyer) (03/18/86)

Here is the REAL story of an Atari DOS data sector.  This is taken
verbatim from the Atari OS manual.

----------------

The format of a sector in a user's data file is shown below:

	 7             0
	+-+-+-+-+-+-+-+-+
	|  data		|   +0
	+-+-+-+-+-+-+-+-+
	| file #    |hi |   +125
	+-+-+-+-+-+-+-+-+
	|forward pointer|   +126
	+-+-+-+-+-+-+-+-+
	|S| byte count  |   +127
	+-+-+-+-+-+-+-+-+

The file # is a redundant piece of information which is used to verify
file integrity; the file number field contains the value of the
directory position of that file.  If there is ever a mismatch
between the file's position in the directory and the file number as
contained in each sector, the Disk File Manager will generate the
error $A4.

The forward pointer field contains the ten bit value of the disk sector
number of the next sector of the file.  The pointer will equal zero
for the last sector of the file.

The S bit indicates whether or not the sector is a "short" sector (one
containing fewer than 125 data bytes).  S is equal to one when the
sector is short.

The byte count field contains the number of data bytes in the sector.

----------------


-Landon

DYOUNG@USC-ISID.ARPA (C. David Young) (03/20/86)

I don't know where you got your information but the "S bit" you describe
is definately not correct. All 8 bits of the last byte of the sector are
use for byte count. Of course the MSB (your "S bit") can be a 1 only in
double density.

David Young
-------

dlm@ihelp.UUCP (Daryl Monge) (03/22/86)

> I don't know where you got your information but the "S bit" you describe
> is definately not correct. All 8 bits of the last byte of the sector are
> use for byte count. Of course the MSB (your "S bit") can be a 1 only in
> double density.
> 
> David Young
> -------

He got it from the ATARI Personal Computer System OPERATING SYSTEM Users
Manual, section 5, page 84; which I have sitting in my lap this minute.

Are you saying the manual is wrong?  This manual came directly from ATARI.


Daryl Monge
AT&T
Bell Labs, Naperville, Ill

...!ihnp4!ihelp!dlm