@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr  :/:SDSKIODUNIDCOMNDSKSECTONOKSIDOLDSECTONXCCOGNOSBYTECOUNFPOINODUMMXXXXHEXSCRPUTXHEPFLAWO}RKDIROFLINEDDIRDUMPDSK2SIJCOTKSSESMAFPOINTFNCOUNOLDSECTENFTRACESECTORTRBI }@@Aa@@ @ $ @ @  oAa}B%6 WW$@rAa@PP a JK!r "r}HU#@$@%&'(At)*A +,-./@01A }234E&&================================&&> ӠŠàԠϠҠԠϠϠ̠ <&&> (SINGLE/DOUBLE D }ENSITY) <&&> (C) 1985, 1986 BY <&&> JOHN DAVID MCFARLAND III <&&> VER. 0.861A 01/16/86 }<&&> <&&> 3206 DORSET DRIVE <&&> LITTLE ROCK, AR. 72204 < &&==== }============================O6-Aa!A)@3A0@E@@O B %%============ }===================#%%> SUBROUTINES <$%%===============================(C -@6@}<2@"@@ C$21.6-?:C:,<< ENTER SECTOR }NUMBER CHECK RANGE }& READ SECTOR <$$==============================E+!$)+ @*"@,) @5 B ;6-E A'}6-6-@'6-@ @P A0$$==============================$$> DISPLAY DATA CONT}ROL <$$============================== (}( D-@% BP/( ҠD(}Link Sector : X!26-P:+&@,'@,%@>!@L6-&@X6-@6-?:C:, WRITE <$$==============================o @@-@@!o(JUse "}cursor controls to change any byte. Press on each row.RAR'-@2@/( 9 @#}C AR6.7@,,AR@,6-F:@,&@!! )!@AUS"@g#-$}@O67@ &@$,.7@"&@$,S "@r A@ -@7%@( B%}4-@@!*(Is that all?4 @#@*@x# ADD67@%$@%+A($&},<@%$@%A($,."@A0"@xA j-@@!`(EIf you're sure you'} really want to write this sector press .j @@A&6-@ @P0 A`##(}=============================##> LINK DATA <##=============================..6-P:@:7A($&)}@,,'+@$,,OO6-+@:7A($&@,,&$+@$,,$AV%@:7A($&@,, @)!$6*}-6-@:7A($,,$$##=============================##> MOVE SECTOR ROUTINE <##==================+}===========s-@@!I(MOVE sector # to sector # : ----[ARc(m @s6-,})AR@)"A33!$)+ @*"@,) @AX-@@!N(2Pre-}ss <> to move this sector to sector # X @ @A) 6-6-@ @P) A`##.}=============================##> HEX CONVERSION <##=============================YY6-?:C:DhhhЩ/}΅ͤ.Hȱ80 h80  ȄΤ͑Ȅ`, INTRO <'""============================$'5#@@E:5AR@1}']];@6,;A`,;AV,;@,;Ap,;A H,;Ac,;@u,'<<;@,;A,;A2},;@,;AW`,'; 6.67A H,.)67@,./6.56.;6.'6-@r' B 't @@3} BP)-@@>(Drive # or ?H @^ @P)!@Rj6-@t B'6-&@H'4}-@0@('6-!-@@ _(9ingle, nhanced, or ouble density ?i @5}u"@6-@'b6-A "@i'6-@36-A#?6-@Q-@0@X(>:,b B6}("@h6-@ (!! @)!@B(-@0@(>:,(a6-!-@@?(7}ingle or ouble sided ?I @U"@a6-@("@h6-@((!! @)!@B-(-8}@0@(>:,<( @@Z(--@@-(*6-Aa B *""===============9}=============*""> DISK HANDLER <*""============================*y96./hhhhhhhh h hh:}hhh hY67@H<@H,.>:Ab,y67@I<@I,.>:A%,*` 67@P<@T,.@67@U<@U;},.>:Ab,`67@V<@V,.>:AS,*tt67@W<AE,.Yҩ1 W@ Y  i<})ұ%э ȱ΍   iΐϭ  *,,67AF<Ab,.  У`*""============================*""> =} SCREEN DUMP <*""============================*TT6.JhhhХYӥXhhi(Ґɀ` >}@i @(`*""============================*""> SCREEN DISPLAY <*""============================*t?}T67@<@W,.9hhhХYϥXiΐhhͩ҅өԤұ{ҦCFJJJJt67@X<@X,.>:Ab,*E%67@Y@}<@h,. ҈)E67@i<@i,.>:Ab,*C#67@p<@w,.C67@x<@x,.>:@',A}*nn67@y,.[ iiӑлӥi(ΐɠɀ` i@8 ӑп`*""===========B}=================*""> SEARCH FOR A STRING <*""============================*RR6.HhhhhhhhhhРC}ߥЅԥх`ԅ`*""============================*""> SIDE BARS OF MAIN DISPLAY<*""=========D}===================*c6.hX˥Yhhi567@ ,.>:Ab,K67@!,.ːc67@',.>:Ab,*v#6E}7@(,.͑i;67@D,.>:@0,v67@E,.+ː̱͑i ːi͐ΰ`*mm6.cF}*e!67A,.!!G}967A,.>:@4,M67A,.e67A,.>:@4,*<<67A ,.)##$$%%&H}&*$*""============================*""> PRINT <*""============================+B BI}-@@P:8@B B+%"@6-% B@ + 3 3+F/3 Byte count : J} SECTOR: C3 Link sector: F3 +-@@*+6-?:C:,'H A R+$S+FFF:A,A8*F:A,%AV$FL}:A,BBU+R-@ @ 0(D-@@N @@R V+((~~~~~~~~~~M}~~~~~~~~~~~( B\+""============================]+""> DIRECTORY <^+""============================N}p+ 6-z+C-@@!2(Reading Directory...C67A H,.+_6-@6-A`'6-@1 @PO}76-_6-@:7@,,%AV$@:7@,,+::6-?:C:,<<@ TRACE FUNCTION Z} <.""============================.Y6-!-@@!O((Enter starting sector # : ----Y @[}.33 @)!$)+ @*"@,A.a6-@6-@'6-@-6-56.F67AW`,.U6\}7@,.a6-.G 6--@@!-( Tracing G67@<@,.=:,/b-@@!( ]} %6-/ @P9 A0T67$@%@,.b"B ` / F:Ad,AUB"/=67@%$@^},.=:,-6-%@36-= B @/""============================/4 (}-@4(&/_}-@+-@@"9-$@(A:7@%@$+$@"%&@,%<@%@$+$@"`}%&@,%,,0/-$@"%%'@ '#'- B!:/O  6-%A+-@@#;( 宮E a}@O B `D/4-@@#!"4( N/D-@"@#*(4 @:6-b}D AU/(F:Ad,"@(6-( AU/6-@ B `:""============================:""> OTHc}ER SUBROUTINES <:""============================:EB(9 E$:d}g (}-@@d(DӠŠàԠϠҠԠϠϠ̠ (C) 1985 by J.D.McFarlandg$R""===================e}========= R""> FIND FUNCTION < R""============================lR>-@@!>($You may search for f}up to 8 bytes.R-"@g-( --------RK"@rK(6 -- -- -- -- -- -- -- --g}R1AR(' @1 AR4AR F:@,@#ARV"@r*h}6-+B:,%@,'@;67@),.*E A@ V6.7@<,R)B:,!@)6.7@<@,R Bi}Rw#6-@%+&@,$@5-@@![( Starting at sector ----e @q"w6-Rj}*$&@6-RN6-!-@@!D(Follow linkage (Y or N) ? N @RO"@)"@vk}96-@%+&@,$ARE6-O BRI-@@!9(Ending at sector ----C @I6-l}R' )!$&@'6-$&@R:AR@'-@@!:( Searching R ! B0P Am}RP-@@!( 4F:Ad,AUFAdAUP A R) 6.67A,.)67@,.n}R>46-?:C:,<<@ B0Rd/67A($&@,.7A($%@,d6-?:C:, AND MORE SUBROUTINES (H BPpq$zq$ @@ @@! @@$$t""============================x}t""> SIGN-OFF SECTOR COPY <&&> VER. 1.0 05/2}}7/84 <&&> BY JOHN DAVID MCFARLAND III < &&================================2#@@E:5A~}R@G-@@(;ŠҠ٠ by COGNOS (C) 1984<; A"'6-}%@1 A; A`F] A5-@@N()Enter: from unit #,to unit # ]@P9}9+"@)"@,*+"@)"@,AZ @pdy-@@A(&Enter: ingle/ouble density } a@@K:n)@y@n>-@3@(>:,("@46-@> A@}x%"@h6-@% A@ Ay-@@A(&Enter: ingle/ouble sided a@}@K:n)@y@L-@3@(>:,("@66-$@B6-@L A%}"@h6-@% A A@;-@@ A@1-@@; A@y-@@}A(&Copy : ll/art of disk a@@K:n)@y@T-@3@(}>:,("@e46-@B6-A $J6-&T APT"@!-@@J($Enter: starting sector,endi}ng sectorT A0 Al-@@/( >@N6-&%@l"@* }@A!)!$A A 6- 6--P:', 6-%$ &$ 6-&$"}7 A5-@@) A7"A ,G-@@ A +"=-@@"G AP}6=-@@" A0) Ap3 A= A@@E-@@ AP1-@@; A0E A}pJk A5-@@) A ;-@@E APW-@@a A0k AT ^((}}finished........% A5(r$$==============================|$$> SUBROUTINES <\-@@}/(a moment please......K-AeAe%A O"UY \$B?(4INSERT SOURCE DISKETTE IN} DRIVE B$=:(/INSERT DESTINATION DISKETTE IN DRIVE =$C@(Pass %@ of P:',%@ } C$C -@6@<2@"@@ C$UR(J } U$k(and press ...0A@dP@@K:]})@h@k$e6-I:,+6-P:'AV,&@:;AV$,B6.S67$AV,.b67@,.e}$*'6-?:Ae<<@ingl}e, nhanced, or ouble. 3. Select ingle- or ouble-sided. If you use both sides of a diskette with a single-sided }drive such as the Atari 810 you will need to turn the diskette over to read the other side as you normally would. The double-}sided option is for double sided drives. SECTOR TOOL will pause a few moments to read the disk directory (sectors 361-368) }and pass control to the sector display screen.SECTOR DISPLAY SCREEN SECTOR TOOL defaults to sector 361, the first sector} of the disk directory. The following functions are supported: eq. - The key causes the next sector in numerical ord}er to be read and displayed. causes the next lower sector to be displayed. ink - The key causes the sector }indicated by the link bytes of the current sector to be read and displayed. causes the last sector linked to the cu}rrent sector to be displayed, provided you had entered the current sector via the command. The backward link function onl}y remembers the last forward link. eset - The key displays a request for a sector number and then jumps to, reads, }and displays that sector. ir. - The key displays the first 16 filenames of the current directory along with the file} status flag (FL), starting sector number, and number of sectors. Press or to display the next 16 filenames, etc. Pre}ss any other key to return to the main display. causes the first sector of the current disk directory to be displaye}d. disk - The key allows you to re-define the drive number, density, and number of sides. lter - The key pr}esents a cursor and invites you to alter any byte or series of bytes as you wish. The bytes may only be altered a row at a ti}me (a maximum of 8 bytes) and should be entered in the same format as the display. You must press on each row in wh}ich you have made changes or the changes will not be recorded. If you wish to change one or more bytes on the same row that t}he cursor starts on you must move the cursor off that row and then back on it. (This is due to the way the Atari editor input}s data.) The data written to the indicated sector is taken from screen position. ex - The key causes the sector data} to be displayed in hexidecimal form. har. - The key causes the sector data to be displayed in character form.

}rint - The

key sends a facsimile of the display to the printer. In double density mode both pages of the sector display a}re printed. If you only want to print one page of a double density display (i.e. bytes 0-127 or 128-255) press . ext - The key toggles the display of the two pages of a double density sector. ind - The key allows you to defi}ne up to 8 bytes to search for within a range of sectors or within a file. To escape during a search press any key. ove} - The key allows you to write a copy of the current sector to any other sector. dir - The key allows you to est}ablish a working disk directory other than the standard disk directory. Enter the starting sector number of the working direc}tory. re-establishes the default directory. race - The key will ask for a starting sector number and then} follow the sector links to the end of the file. A list will then be displayed of all the sectors found to be linked. You may} abort a Trace by pressing , for full abort, or any other key to see a current link list. uit - The key termina}tes the program.NOTES The "error detected" sign is displayed when any kind of error occurs. This is just a warning. It }does not mean that a fatal error has occurred. SECTOR TOOL ignores most disk errors so it is possible to recover some bad sec}tors by reading and rewriting the bad sector. As an alternative, you could move the data from the bad sector and make the app}ropriate changes to the linkage bytes and bit map (VTOC). Because the first 3 sectors are boot sectors they are always sing}le density. In double density mode you will not be allowed to read sectors 1, 2, or 3. To read sectors 1, 2, or 3 of a double} density disk use single density mode. The Find function may be set to follow the linkage within a file or to read sequentia}lly. The Find function reads across the byte count and linkage bytes (the last 3 bytes of a sector), so that a string of data} bytes starting near the end of one sector and continuing into the next sector will be recognized. If you make an alteratio}n to the disk directory, this change will not be revealed by a command unless you first re-read the directory via an }command or a / command. Problems will be encountered if you try to alter data bytes in character format on rows }that contain 'EOL' characters. In that situation it is recommended that you make your alterations in hexidecimal form ($9B).} When the

rint function is called from the character display, an inverse character will be printed as a normal character }and a non-printing character will be printed as a ".".End.lay, an inverse character will be printed as a normal character =ATARI Disk Data Structures:An Interactive Tutorialby David YoungINTRODUCTION The floppy disk is a marvelous and yet }mysterious media for mass storage of data. Indeed, to understand exactly how a bit of data is stored and retrieved from the }surface of the disk requires a good knowledge of physics. However, to learn about the data structures found on a disk require }s no higher mathematics than hexadecimal arithmetic. The manual supplied with the computer usually does an adequate job of s }upplying all the technical details, but wouldn't it sink in better if the actual data on the media were viewed while it is be }ing described? The SECTOR TOOL program is used to demonstrate the disk data structures as they are being described. Follow } the instructions under GETTING STARTED in the SECTOR TOOL USER'S GUIDE to run SECTOR TOOL. Once the program has started, re }move the SECTOR TOOL diskette and insert some other diskette that has been backed up. Use the "R" (reset) function whenever }you are requested to view a particular sector on disk. Whenever you are requested to change the display format from hex to c }haracter, or vice versa, use the "C" or "H" (toggle display format) function.The Disk Media The first disk structure }to be aware of is the sector, which on any computer system consists of a group of contiguous bits recorded at a specific loca }tion on the disk. The disk drive hardware always operates on whole sectors, that is to say, it is not possible to read or wr }ite partial sectors. Groups of sectors are organized into tracks forming concentric rings about the center of the disk. The } ATARI system divides the disk into 40 tracks with 18 sectors per track for a total of 720 sectors. This is best visualized }by taking the lid off of the disk drive and watching the read/write head move as certain sectors are addressed. On the ATARI } 810 disk drive this is accomplished by removing the 4 phillips head screws hidden under gummed tabs at each corner of the li }d. While inside the case, a bit of lubrication on the 2 cylindrical guide rails supporting the head will make the drive less } noisy. If sectors 1 through 18 are read with SECTOR TOOL, the head remains fixed on the outermost track. When sector 7 }20 is read, the head moves in to the innermost track. When a disk is formatted, the head can be seen to bump sequentially th }rough all 40 tracks. It is laying down the patterns on the oxide surface which will be recognized by the drive hardware as t }he sectors.The sectors are all initially empty (128 bytes of 0), but at the end of the formatting routine, as described in t }he next section, the ATARI DOS records special data into certain sectors. The top of the drive can now be resecured. No more } information about the hardware is needed to understand the higher level disk data structures of the software.Boot Sector } At the end of the formatting process DOS reserves and initializes certain sectors for special tasks. Into sectors 1 thr }ough 3 is stored the bootstrap for DOS. On power-up the ATARI operating system reads sector 1 to determine how many sectors }to read and where into memory to load them.After it has loaded in the specified number of sectors, DOS starts executing the }new code at the load address + 6. Put SECTOR TOOL into the hex mode and read sector 1 of any DOS disk. Byte 1 says that 3 s }ectors are read (sequentially) and bytes 2 and 3 specify a load address of $700. (A 2 byte number is always specified with t }he least significant byte first.) Byte 6 is the first intruction to be executed (a $4C1407 is a JMP $714). In this case the } code which follows sets up to load the File Management System of DOS into memory. This is called the second stage of the bo }ot. Look at the first sector of any other boot disk available (any game or program which loads in from disk on power-up). }It might be seen that the program loads in entirely during the first stage of the boot, i.e. byte 1 of sector 1 has a sector }count which represents the entire program. For more details on the disk boot process, see the ATARI Operating System User's }Manual.Volume Table of Contents Besides the first three boot sectors, DOS sets up sectors 360 to 368 as the director }y of the disk. DOS uses the directory to keep track of where files are stored on disk and how much disk space remains. Read } sector 360 of a DOS disk with SECTOR TOOL in the hex mode and view a part of the directory called the Volume Table of Conten }ts (VTOC). Information pertaining to the availability of every sector on the disk is stored in this sector. Bytes 1 and } 2 specify the maximum number of user data sectors on the disk ($2C3 = 707) and bytes 3 and 4 specify the number of free sect }ors remaining on the disk (707 for an empty disk, 0 for a full one). Starting in bit 6 (the second to highest order bit) of }byte $0A, each bit up through byte $63 corresponds to a sector. A 1 corresponds to a free sector while a 0 means the sector }is being used. When a file is stored on the disk, the bits corresponding to the sectors used are set to 0. When the fil }e is erased, the bits are set back to 1. That is why DOS, when it deletes a file, can be heard reading the entire file. It i }s determining which sectors were being used by the file so that it can free them back up. Notice that bits 1, 2 and 3 (bits }6, 5 and 4 of byte $0A) are set to 0. These correspond to the 3 boot sectors. Likewise, the 9 bits starting in byte $37 are } 0 because they correspond to the sectors of the directory. These 12 sectors are thus kept from being overlaid by user files }. If the VTOC is viewed on an older disk which has had many file additions and deletions, it may be noted that the VTOC }has become quite fragmented. Any file added to the disk may get stored into sectors scattered about the disk. How DOS keeps } track of files spread over multiple sectors will be discussed shortly. By the way, even though the operating system recogni }zes sector 720 (try reading it; should be all zeroes), DOS never makes use of it. True to Murphy's Law, it adopted the numbe }r scheme of 0 to 719 instead of 1 to 720. No need to bother trying to read sector 0!The Directory Of all the disk d }ata structures, probably the most important one to be acquainted with is the directory. The 8 sectors following the VTOC (36 }1-368) contain a list of all the files on the disk along with their size, starting sector and status. Put SECTOR TOOL into c }haracter mode and read sector 361 of a DOS disk that has several files on it. It can be seen that the name of the first file }starts in byte $05 and the extension (if any) starts in byte $0D. If any of the 11 character positions of the filespec are un }used, it contains a blank. Notice that the filenames start every 16 bytes, allowing 8 directory entries per 128 byte sector. } Thus, the maximum number of entries for the 8 sectors of the directory is 64. Now put SECTOR TOOL in hex mode and read } sector 361. The first byte of each 16 byte entry contains the status of the file. For a normal file that byte is $42, unle }ss it is locked, in which case it has a status of $62. A deleted file has a status of $80. An anomaly occurs whenever a fil }e is opened for output (from BASIC, perhaps) but is not closed before the computer is powered down or glitched. Since the st }atus of an open file is $43, DOS will neither recognize the entry as "in use" nor "deleted". Even the sectors which may have } been written out will not really exist on disk because the VTOC is not updated until the file is closed. The only harm done } is that this bogus entry will take up space in the directory until the disk is reformatted. (One other solution would be to } change the $43 to an $80 using SECTOR TOOL; refer to the alter sector function, "A", in the SECTOR TOOL USER'S GUIDE.) The }second and third bytes of each entry contain the size in sectors of the file (low order byte first) while the fourth and fift }h bytes specify the first sector of the file. DOS only needs to know the first sector of a file because each sector points t }o the next sector of the file in a process called "linking".Linking At this point it would be best to explain how DO }S forms a data file on disk. First, the user must open an I/O channel for output to the disk, perhaps with the BASIC "OPEN" }command. DOS responds by creating an entry in the directory with the specified filename and a status of $43. DOS reads the }VTOC into memory and searches the disk map for the first free sector. If a free sector is found, it's number is used as the }starting sector in the directory entry. Now, when the user begins to output data via this I/O channel, perhaps with the BASI }C "PUT" command, DOS waits until it has collected 125 bytes of user data in a buffer. Then DOS adds 3 special bytes of it's }own and outputs the sector to the disk. I call these 3 bytes the "sector link". The sector link, bytes 125 to 127 of th }e sector, contains 3 pieces of information. The high order 6 bits of byte 125 contain a number which represents the position } of the file's entry within the directory (0 to 63). DOS uses this number to check the integrity of the file. If ever this n }umber should fail to match the position of the file's directory entry, DOS generates an error. The low order two bits of byt }e 125 and all of byte 126 form a pointer to the next sector of the file. A pointer is the address of a record in the compute }r's memory or, in this case, the address of a record on disk, the sector number. The next sector of the file is determined b }y scanning the bit map of the VTOC for the next free sector, which may or may not be the next sequential sector of the disk. } Thanks to the link pointers, all sectors of a file need not be contiguous sectors on the disk. The last byte of the sector }link (byte 127 of the sector) contains the number of bytes used within the sector. This byte will always be $7D (125) except } for the last sector of a file, which will probably be only partially filled. DOS writes out this partial sector only when t }he user closes the file, perhaps with the BASIC "CLOSE" command. When an output disk file is closed, DOS writes the newl }y updated VTOC back out to sector 360. It then updates the file's directory entry by changing the status to $42 and filling }in the file size (bytes 1 and 2) with the number of sectors used by the file. This completes the process of creating a file }on disk. Now, when DOS is requested to read a file from disk, it finds the directory entry of the specified file to determin }e the start sector. Then, following the link pointers, it reads the file sector by sector until EOF (end of file) is reached }, indicated by a link pointer of 0. Equipped with a basic understanding of how a file is stored on disk, try looking at }a file with SECTOR TOOL. In character mode, first locate the name of the desired file in the directory (sectors 361-368). T }hen put SECTOR TOOL in hex mode and look at the fourth and fifth byte of the entry to determine the start sector. For exampl }e, if these two bytes were "1F 01", type "287" in response to "Sector #?" to read the first sector of the file. Observe the }last three bytes of the sector and verify that the high order 6 bits of byte 125 correspond to the directory entry position a !}nd that byte 127 is the number of bytes used (probably $7D). Then determine the next sector of the file from the low order 2 "} bits of byte 125 and byte 126. For example, if bytes 125 and 126 are "1D 20" then the next sector of the file is $120 and t #}he file is the eighth entry of the directory (the first entry being entry 0). If the file is not too long, it would be instr $}uctive to follow the sector links to EOF. Once the ability of finding a file on disk and following the sector links is maste %}red, all that remains is to become familiar with the 3 types of files used by DOS. (NOTE: SECTOR TOOL will automatically fol &}low the sector links of a file if it is in linked mode; refer to the SECTOR TOOL USER'S GUIDE.)File Types The first '}type of file is not a true file, per se, because there is no entry in the directory for it. This file type includes the boot (} record and the directory itself. And since the sectors which make up these files are not linked but, instead, are related t )}o each other sequentially, I call these records "sequentially linked files". When examining a sector of the boot record or d *}irectory, merely increase the sector number by 1 to get to the next sector of the record. An example of the second type +}of file is that which is created with the BASIC "LIST" or "SAVE" command. This file consists of ASCII characters which eithe ,}r represent straight text, as in a LISTed file, or a sort of condensed text, as in a tokenized or SAVEd file. Except when vi -}ewing the sector links, the character mode of SECTOR TOOL is best suited for examinimg this type of file. At this point it w .}ould be instructive to locate in the directory of a DOS disk a file created with the BASIC "LIST" command. Upon determining /}the start sector, observe the file in the character mode. The BASIC program can be easily recognized. It may be noted that 0}the carriage return-line feed character (CRLF) is displayed in it's ATASCII representation (an inverse escape character) inst 1}ead of executed. Now observe a file that consists of a program that was SAVEd from BASIC. Since the text has been tokenized 2} the program is harder to recognize. However, certain parts of the program are not altered during the tokenization process, 3}notably text following REM and PRINT statements. Now, having investigated ASCII files, it is time to discuss the last file t 4}ype, the "binary load" file. The binary load file is primarily used to load 6502 machine code into memory for execution. 5} However, it's format is so general that it can be used just as easily to load any type of data, including ASCII text. Loca 6}te a game or other program which is run with the BINARY LOAD option of DOS. Alternatively, create a binary load file by savi 7}ng any part of memory (except ROM) with the BINARY SAVE option. Now observe the first sector of the file with SECTOR TOOL in 8} the hex mode. First, notice that all binary load files start with 2 bytes of $FF. The next four bytes are the start and en 9}d addresses, respectively, where the data to follow will be loaded into memory. If these four bytes were "00 A0 FF BF" then :}the data would be loaded between the addresses of $A000 and $BFFF. I call these four bytes a load vector. After DOS has loa ;}ded in enough bytes to satisfy the load vector, it assumes, unless EOF is reached, that the next four bytes specify another l <}oad vector. DOS will continue inputting the file at this new address. Upon completion of a BINARY LOAD, control will no =}rmally be passed back to the DOS menu. However, DOS can be forced to pass control to any address in memory by storing that 2 >} byte address at location $2E0. To store the 2 bytes, it is necessary to specify another load vector as part of the file. I ?}f, for example, it were desired to execute the program loaded in at $A000, the following load vector would be part of the fil @}e: E0 02 E1 02 00 A0. I call this specialized load vector an autorun vector. It achieves the same result as the RUN AT ADDR A}ESS option of DOS. Try to find the autorun vector in the file being viewed. Although it could be at the beginning, it is mo B}st likely located at the very end of the file.Conclusion Anyone who has made it to the end of this tutorial and has s C}uccessfully performed the exercises presented here should consider themselves proficient on the subject of ATARI disk data st D}ructures. I hope this tutorial has been useful to those wishing to gain a perspective about how data is stored on disk. At E}the very least it should have taken some of the mystery out of working with this popular device.End.s stored on disk. At g@@dbc @^ B (^@sF F $I@ y@R@ /G   E %m@@sFFG}sF   wU hZ  Z D \   X     H} \ AA=K X   U \K    U  &nARA "#8A     9OGI}A1B   d&!BA "#A \     (BA #"A    J}  B  BBB T   2DAA  wU\  &BVB "#F  \ L HS  >F  \ L HS FF >F  tU $"FE  wU  wUS}    wU  tU  %oF[F } R   N   \ HS R  wUxsT}F`E L  |F M |F -M  |F EM  |F R O GG& % G O ( %#GF OU}sF  1\  9HsF  mGx  sF1B T  & %GV} ( %G  } D  }     HH } ~  2D  W} %5HG c W sF _M |F_ _ &IH_ "X}#H ] i a D[ [ &IH[ "#H Y [  c W IIHH[ sF_ _Y} (&wJ5I_ "#I_   JU  U B$tJa a &IIa "#hI _   ] Z}wI  a a &IIa "#I _   ] I   U JJ    [} [ a \ mM U  U uM  UW "#c "#c (tJc [ *I  \ yM Ue \}R] c O] & % J] U ( %JwJ [      &+K KKK "#]}J      K  Drive %d: Used: %5d Free: %5d%c=Used%c=Empty%1d0123456789<<---- Tra^}ck Numbers ---->>This program is in the publicdomain. Please feel free to distribute this program.Enter drive # to maL_}Lp(1-4 or 0 to quit) : Insert disk into drive %dand press [RETURN] : D:*.*Error reading diskAtari Disk VTOC Mapper`}VERSION 3.1 - 11 April 1985Copyright (C) 1985By Michael Curry & SLCC<< Press any key >><< to continue >><< a} >><MM< Display Options >>1. Map Entire Diskette2. Trace Specific FileEnter Selection (1 or 2) One Moment...%2d. b}%s.%sEnter File # -> MN   &M     "#   0  (MM c} &N  "# -    "N   N   &NiN "# #"Fd}N       NO     VN    %N "N  e}     % O "#N  "#   "# %5O O    '{Oif}O "OO   _O OP  O $  $  $O "OOO g} +$  -$ P -$O    "  0)  9'TP    0  "Pq}iBvSECTOOL BASBzSECTCOPYBASB/SECTOOL DOCBDISKSCANTUTBPFDISKMAP OBJBEDISKDUMPSAVB RAMDISK COMBJDOS SYSB*7DUP SYSBaAUTORUN SYSBbMENU      P PQ$  $  $P "PPpP TQ 0)  9'Pr}  00Q a)  f'Q  W0Q A)  F'-Q  70QTQ    s} "P   &Q @ QR  tU $QQ "pQ $Q    t} bU  r$Q R w$Q R a$R R        u} S    &tR R   RS   bU   S R v}    S 00 R R   x   S &#S   H zU w}   VS  bUS    ST SS 0 x}   S  "#  TS # &S  $  $   :%   :% y}  :%yT U /U   /U  /U    TU  . _U &T  z} .     /U a& % T z( %TT  A& % U Z( %%U{}.U  00      2U00 0u _U000!0D:UV zU  |}    zU tU V zU     zU tU   zU V}}   zU N #X   % _U &{V  VS VW(V ~}    S         GW " #   -$W  DW} 0)  9'AW    0DWGWV       zU d$W  WX } 'XX s$W   ZX c$W   ZX x$W   UYX  R}   " #CV   ' &sX  "# -   X } XY   (X  "#  0      sX $X  "# 0 }   (#Y    4[  VS &QY    4[   } )YZZ      (Y 'Y  "#  0Y  "#  a  }  yY $"Z  "# 0    (PZ    4[  VS &~Z }    4[ZU[ (Z   4[  R &Z   4[  N } ([    4[  VS &0[    4[ #" (T[  R4[ V[U\  R }   0   ^ |R ^  ^ wU U  }U T  wU       S }  \  R T  wU U  }U^  R U  }U T  wU        wU V\U}] ^ wU   wU U  }U T  wU       S p   tU |   tU }x   tU    tU \ .]] ].]&]  )]0] n])] \ .J]Q] }Y].Y]V]^a]  d]k] ]d]$0 &]  # @)]  ]   )]  } ] #  tU tU   &^] S:00L 2Li0L0L0L0L1LP1L^1L1L1L1L1L1 3ت}ʎL08L0إ M0ԆLa4L0 HȱHL0JH @3lhhh hhBhhDEhhHIhhJhhK V}Ii``hhh) BHI V0`L0hhhhh) BHIL0hh01hhh L 1`hhh}hhhhL41`hhhHlhhhhhhh ``Ls1hhh}`hhhhh`hhh𪈱`hhhȱhh`hhh) hhhh) 12 hh)`dbc@2L!}2CL36Щ2ѭ@ҭ@LF2@ @2C2l  j2عk2l`'013W3h3{3333333334-4E4a4444445}5)5P5`5555556*696B6^6q6666666664dbc 1 run-time-error ""Type a key to ret23urn to DOS.2 BȝD2}E8HI Vl @3؅ԘLF2ЅȱЅ٥iА` @3؅ȱ؅LF2 @3e؅ԥeمLF2 @3ԑLF2 @3}ȥՑLF2 3ԑإ8ҥLF2҅ȱ҅` 3ԑȥՑL3ԅԄLF2ԪȱԅՆLF2BL3 @334؅ԥمLF2 4ԑȥ}LF2iҥi `AL3Ա҅ԊȦձ҅ՊLF2 4 @3Рȥёҥ؅ХمLF2҅ȱ҅ _2إ8؅ҥLF2}б҅ЊȦѱ҅ъLF2 @3؅ХمLF2L4eЅАLF2 @3L4 @3e؅ҥeم45AL3LF2}&LF2eԅȱeՅL38ԅȱՅL3ԍՍҍȱҍ 7ԭL3 p5ԭL3 p5ԭL3ҍȱ}DL3դL87ԅȱՅL3EԅȱEՅL3%ԅȱ%ՅL3҅ȱ҅FfL356ȱ҅L3}҅ȱ҅&L3Ա҅L38ԅԩՅLF2EԅԩEՅLF2LF2LF28ԅȱՅ` M6ʆL}3 M6ԅL3 M60 M60 M60åп M60ՐнԐՐЪԐПՐ67 }ԐLg6Ր԰Lz6&&& L27 `ɀE ɀf8ਊ} 7$ 8$P 8`E0 IIL78L7Ff eeF7}7fff$ 8` 2`E0 IIL78L7Ff eeF7#CDDZ"j"AAHDHDIADBGINOUSSANEVPOPOPRSFNCHCHS}   BB"}&@7 @ (@ G  FILEDUMPLLROUTINE TO GET BYT}ES FROM DISKETTE AND PRINT HEX, DECIMAL AND OP CODESWITH PRINTER(11;@,;@,;@,;@,211};@,;@,;@,;@,<LL;@,;@ ,;@ $AV,;@,;@$AV,A'}@'@@9F=6-B6-B'6-1 B=6-P< +!(PRINTER (Y/N})%<B:,"@Q 4Y AR%(Enter skip count%6-U. @6-A:,$ B.} @X6- BZ(Enter complete filename[B:,"@\* @!*(@} _<@+@@<OPEN DISK FILE` B Ac (FILE NOT FOUND @}dFOR LABEL REFERENCEnFOR LABEL REFERENCE6-F:Ad,"AUA5"@!AdAU}+ A5 A5"@5!AdAU+ A 5 A5"@")"@b+AdAU5 AP} A6-&@ 6- 6- 6.$ A)@$ B} 6.7@<@,<6-%@<6.7$@ %@<$@ %@ ,!..6.7$@%@<$}@%@,&(:   02!2(@:   : AX!$}bA#@@P:/6-@>( ҠA$l"$v-@6-*( Ҡ}-$6!@&6-6( Ҡ$$(CONT may be used to continue& A)F:A},"A6&( Input EOF)4( I/O Error F:A,(@46-((( Type CONT and to continue}& @'INPUT CONVERSION ROUTINE' GIVEN A$ (DIM A$(5)), WITH$'!!LEADING 0 FOR HEX, CONVERTS.'!!ADDRESS TO} BINARY (DECIMAL)8'IN D. DESTROYS TRAP, WITHB'D=-1 IF INVALID VALUEL'!B:,"6-!$V'B:,"@}B`'$$7@<@,40B j' B6-A:, Bt'$~'6-6@ B$'46-} -@B:,4 BP'L7<,1A*7<,/FB6-$@%@:7<,,%@&@:A,L B`'D7<},10*7<,/9:6-$@%@:7<,,&@:0,D B`'6-6@'   $'OUTPUT CONVERSION ROUTINE'!!GIVE}N D (DECIMAL), CONVERTS'!!TO FOUR CHARACTER HEX IN H$'(DIM H$(4)), USES HI, D1,(D2. D IS NOT DESTROYED (6.}0000 $(& 6-&-@@6@($6-P:'@,$6-&$@((6!@ ,67<,.>:@:A},%&@,6 B2(67<,.>:@:0,%,<( 6- $**uu67@<@,.ZBRK ORA (I X)NOP NOP} NOP ORA Z ASL Z NOP PHP ORA IMM *uu67@<A,.ZASL A NOP NOP ORA ABS AS}L ABS NOP BPL ORA (I) YNOP NOP *uu67A<Ap,.ZNOP ORA Z X ASL Z X NOP CLC O}RA ABS YNOP NOP NOP ORA ABS X*uu67Aq<A`,.ZASL ABS XNOP JSR AND (I X)NOP NOP }BIT Z AND Z ROL Z NOP *uu67Aa<AP,.ZPLP AND IMM ROL ACC NOP BIT ABS AND ABS ROL ABS } NOP BMI AND (I) Y*uu67AQ<A@,.ZNOP NOP NOP AND Z X ROL Z X NOP SEC AND ABS} YNOP NOP *uu67AA<A0,.ZNOP AND ABS XROL ABS XNOP RTI EOR (I X)NOP NOP NOP } EOR Z +uu67A1<A ,.ZLSR Z NOP PHA EOR IMM LSR ACC NOP JMP ABS EOR ABS LSR ABS NOP } +uu67A!<A,.ZBVC EOR (I) YNOP NOP NOP EOR Z X LSR Z X NOP CLI EOR ABS Y+u}u67A<A ,.ZNOP NOP NOP EOR ABS XLSR ABS XNOP RTS ADC (I X)NOP NOP +uu67A }<A ,.ZNOP ADC Z ROR Z NOP PLA ADC IMM ROR ACC NOP JMP IND ADC ABS +uu67A <A},.ZROR ABS NOP BVS ADC (I) YNOP NOP NOP ADC Z X ROR Z X NOP +uu67A<Ap,.ZS}EI ADC ABS YNOP NOP NOP ADC ABS XROR ABS XNOP NOP STA (I X)+uu67Aq<A`,.ZNOP }NOP STY Z STA Z STX Z NOP DEY NOP TXA NOP +uu67Aa<AP,.ZSTY ABS STA ABS } STX ABS NOP BCC STA (I) YNOP NOP STY Z X STA Z X +uu67AQ<A@,.ZSTX Z Y NOP TYA } STA ABS YTXS NOP NOP STA ABS XNOP NOP  +uu67AA<A0,.ZLDY IMM LDA (I X)LDX IMM NOP } LDY Z LDA Z LDX Z NOP TAY LDA IMM  +uu67A1<A ,.ZTAX NOP LDY ABS LDA ABS LDX A}BS NOP BCS LDA (I) YNOP NOP  +uu67A!<A,.ZLDY Z X LDA Z X LDX Z Y NOP CLV LDA }ABS YTSX NOP LDY ABS XLDA ABS X +uu67A<A,.ZLDX ABS YNOP CPY IMM CMP (I X)NOP NOP CPY} Z CMP Z DEC Z NOP  +uu67A<A,.ZINY CMP IMM DEX NOP CPY ABS CMP ABS DEC ABS NO}P BNE CMP (I) Y+uu67A<A,.ZNOP NOP NOP CMP Z X DEC Z X NOP CLD CMP ABS YN}OP NOP +uu67A<A p,.ZNOP CMP ABS XDEC ABS XNOP CPX IMM SBC (I X)NOP NOP CPX Z }SBC Z +uu67A q<A!`,.ZINC Z NOP INX SBC IMM NOP NOP CPX ABS SBC ABS INC ABS NOP } +uu67A!a<A"P,.ZBEQ SBC (I) YNOP NOP NOP SBC Z X INC Z X NOP SED SBC ABS Y+QQ6}7A"Q<A#,.6NOP NOP NOP SBC ABS XINC ABS XNOP .uu67@<@,.ZHEART RTINT RTBAR ULA}NG LFINT DLANG RTSLANTLFSLANTDRTRI DRSQR DLTRI URSQR ULSQR .uu67@<A,.Z UBAR DBAR DLSQR CLUB DRA}NG MBAR INTRS BLOT DHALF LFBAR DTEE UTEE LHALF.uu67A<Ap,.Z URANG ESC UAROW DAROW LAROW RAR}OW SPACE ! # $ % & .##67A9<A9,.>:@4,.uu67Aq<A`,.Z ' ( } ) * + COMMA - . / 0 1 2 3 .uu67Aa<AP,.Z 4 5 6 } 7 8 9 : ; < = > ? @ .uu67AQ<A@,.Z A B C D } E F G H I J K L M.uu67AA<A0,.Z N O P Q R } S T U V W X Y .uu67A1<A ,.ZZ [ \ ] ^ ULINE DIA}MND a b c d e f .uu67A!<A,.Z g h i j k l m n } o p q r s .uu67A<A ,.Z t u v w x y z SPADE VST}ROK CLRSCN BACKSP TABF IHEA.uu67A <A ,.ZRT IRTINT IRTBAR IULANG ILFINT IDLANG IRTSLNTILFSLNTIDRTRI IDRSQR IDL}TRI IURSQR IULSQR IUB.uu67A <A,.ZAR IDBAR IDLSQR ICLUB IDRANG IMBAR IINTRS IBLOT IDHALF ILFBAR IDTEE IUT}EE ILHALF IU.uu67A<Ap,.ZRANG RETURN CSRUP CSRDN CSRLF CSRRT ISPACE I! I I# I$ I% I& } I.##67A6<A6,.>:@4,.uu67Aq<A`,.Z' I( I) I* I+ ICOMMA I- I. I/ } I0 I1 I2 I3 .uu67Aa<AP,.ZI4 I5 I6 I7 I8 I9 I: I; I< I= } I> I? I@ .uu67AQ<A@,.Z IA IB IC ID IE IF IG IH II IJ IK } IL IM .uu67AA<A0,.Z IN IO IP IQ IR IS IT IU IV IW IX IY } IZ .uu67A1<A ,.Z I[ I\ I] I^ IULINE IDIAMNDIa Ib Ic Id Ie If Ig }.uu67A!<A,.Z Ih Ii Ij Ik Il Im In Io Ip Iq Ir Is It.mm67}A<A,.R Iu Iv Iw Ix Iy Iz ISPADE IVSTROKBUZZER DELCHR INSCHR /$D/EEHEART,RTINT,}RTBAR,ULANG,LFINT,DLANG,RTSLANT,LFSLANT,DRTRI,DRSQRD:TEMP.2PADE IVSTROKBUZZER DELCHR INSCHR /$D/EEHEART,RTINT,D8<<  B JKIHiDiELV`L8 8 BLV`Lx}8t8l Lu8hihiHHȱȱL8c !#3`Lu8JJJJ`H 8h`H}ȩh Q8L8 Z8L8 8L8 8L8 8L8S:@9E:E9H '9 H9I9 8 '9h)0IC}9D9L8 L :::: :Lr:::IEL[::i:iIIL[:`:i::i}::L:`L{:w:w: C`L:L: D8:MEM.SAV: 8| 9 '9`L:L: D:DUP.SYS:̩ 8} x:ɀL: '9`88 |9Y:X: '9L); D8:DUP.SYS; 8::88 9 '98? :`;WL`; 9}Ln; ` :Y;Y;L;L;)} So, you've got a 130XE, eh? ; 9L; ; -9  } L;D8:; :9 :Y;LZ   HH)H }p h  hyhy D L> L JJ    ! LA*` BF}7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L}EE !E^ ^ E E7EȩEdE/EȩE  D} .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV }QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh }DEL8HI4 0 HI,0 0  9 .G VLO },0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI } V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO }STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu }d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ`}$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF}7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L}EE !E^ ^ E E7EȩEdE/EȩE  D} .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK-}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU .} L ? .  t`GBJ ~DEHI B V0dV/}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh0}DEL8HI4 0 HI,0 0  9 .G VLO1},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI2} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI3} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO 4}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -5}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH6}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG"8}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES"9}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N'":}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx ";}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT"<} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL"=}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD">}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0."?}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC"@}COPY--FROM, TO?OPTION NOT ALLOWED019 FREE SECTORS COPYING---D1:RAMDISK.COMl# 0|D .L/%#"A}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY"B}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E "C}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A"D}LLOWED IN DESTINATION 0 <.|K