From b773fd6d8cf47b5bed6faf748a116d9a51f81b62 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Thu, 20 Jul 2017 15:45:47 -0700 Subject: [PATCH] Remove trailing whitespace, normalize dot commands --- .editorconfig | 3 -- D1S1/CH1#064000.txt | 28 +++++----- D1S1/CH2#064000.txt | 18 +++---- D1S1/CH3.1#064000.txt | 66 ++++++++++++------------ D1S1/CH3.1T#040000.txt | 64 +++++++++++------------ D1S1/CH3.2#064000.txt | 28 +++++----- D1S1/CH4#064000.txt | 50 +++++++++--------- D1S1/CH5#064000.txt | 32 ++++++------ D1S1/CH6.1#064000.txt | 46 ++++++++--------- D1S1/CH6.2#064000.txt | 46 ++++++++--------- D1S1/CH7#064000.txt | 6 +-- D1S2/CH8#064000.txt | 36 ++++++------- D1S2/CH8.1#064000.txt | 12 ++--- D1S2/CH8.2#064000.txt | 8 +-- D1S2/CH8.3#064000.txt | 4 +- D1S2/CH8.4#064000.txt | 12 ++--- D1S2/CH8.5#064000.txt | 4 +- D1S2/CH8.6#064000.txt | 12 ++--- D1S2/CH8.7#064000.txt | 42 +++++++-------- D1S2/CH8.ZPAGE.USE#064000.txt | 2 +- D1S2/TABLE.OF.CONTEN#064000.txt | 90 ++++++++++++++++----------------- D2S1/APPENDIX.A#064000.txt | 56 ++++++++++---------- D2S1/APPENDIX.B#064000.txt | 18 +++---- D2S1/APX.C.1#064000.txt | 38 +++++++------- D2S1/APX.C.2#064000.txt | 20 ++++---- D2S1/CORRECTIONS#064000.txt | 20 ++++---- README.md | 3 ++ 27 files changed, 382 insertions(+), 382 deletions(-) diff --git a/.editorconfig b/.editorconfig index 95c666a..38d1032 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,8 +7,5 @@ insert_final_newline = true trim_trailing_whitespace = true max_line_length=80 -[*.txt] -trim_trailing_whitespace = false - [*.md] trim_trailing_whitespace = false diff --git a/D1S1/CH1#064000.txt b/D1S1/CH1#064000.txt index 504bdba..78ccee5 100644 --- a/D1S1/CH1#064000.txt +++ b/D1S1/CH1#064000.txt @@ -1,35 +1,35 @@ -.ec ^ +.ec^ .na .ll60 .m11 .m22 .m48 .fo ''-%- -.pn 5 +.pn5 .pi0 .br .np .ce CHAPTER 1 - INTRODUCTION -.sp 2 +.sp2 Beneath Apple DOS is intended to serve as a companion to Apple's DOS Manual, providing additional -information for the advanced +information for the advanced programmer or the novice Apple user who wants to know more about the structure of -diskettes. +diskettes. It is not the intent of this manual to replace the documentation provided -by Apple Computer Inc. +by Apple Computer Inc. Although, for the -sake of +sake of continuity, some of the material covered in the Apple manual is also covered here, it will be assumed that -the reader is reasonably familiar +the reader is reasonably familiar with the contents of the DOS Manual. Since all chapters presented here may not @@ -45,7 +45,7 @@ It also draws from application notes, articles, and discussions with knowledgeable people. This manual was not prepared with the -assistance of Apple Computer Inc. +assistance of Apple Computer Inc. Although no guarantee can be made concerning the accuracy of the information @@ -56,7 +56,7 @@ tested. There were several reasons for writing Beneath Apple DOS: -.SP1 +.sp1 .nf To show direct assembly language access to DOS. .br @@ -83,15 +83,15 @@ internal workings of DOS. With the advent of DOS 3.3, the old 3.2 manual was updated but the body of information in it remained -essentially intact. Beyond these -Apple manuals, +essentially intact. Beyond these +Apple manuals, there have been no significant additions to the documentation on -DOS, +DOS, apart from a few articles in APPLE user group magazines and newsletters. This manual takes up -where the +where the Disk Operating System Manual leaves off. .bp diff --git a/D1S1/CH2#064000.txt b/D1S1/CH2#064000.txt index 8a56051..2795de7 100644 --- a/D1S1/CH2#064000.txt +++ b/D1S1/CH2#064000.txt @@ -2,7 +2,7 @@ .np .ce CHAPTER 2 - THE EVOLUTION OF DOS -.sp 2 +.sp2 Since its introduction, Apple DOS has gone through three major versions. @@ -30,10 +30,10 @@ such, it had a number of bugs. With the movement towards the APPLE II PLUS and the introduction of the AUTOSTART ROM, a new release was needed. -.SP1 +.sp1 DOS 3.2 - 16 February 1979 -Although DOS 3.2 embodied more +Although DOS 3.2 embodied more changes from its predecessor than any other release of DOS, 90% of the basic structure of DOS 3.1 @@ -77,7 +77,7 @@ can. .bp - Some DOS commands are allowed to -create a new file, others will not. +create a new file, others will not. Under DOS 3.1, any reference to a file that didn't exist, caused it to be created. This forced DOS 3.1 to @@ -140,7 +140,7 @@ creating master diskettes. UPDATE and allows the HELLO file to be renamed. .br -.pi0 +.pi0 .in0 .ps1 .sp1 @@ -163,14 +163,14 @@ new bootstrap and state ROM chips for the disk controller card which provide the capability to format, read, and write a -diskette with 16 sectors. +diskette with 16 sectors. (These ROMs are the same ones used with the LANGUAGE -SYSTEM.) +SYSTEM.) This improvement represents almost a 25% increase in available disk space over the old -13 sector format. +13 sector format. Also included in the 3.3 package is an updated version of the DOS manual, a BASICS diskette (for 13 @@ -242,7 +242,7 @@ Because the COPY program was rewritten under 3.3, that restriction no longer applies. .br -.pi0 +.pi0 .in0 .ps1 .nx ch3.1 diff --git a/D1S1/CH3.1#064000.txt b/D1S1/CH3.1#064000.txt index 8335359..5fa8728 100644 --- a/D1S1/CH3.1#064000.txt +++ b/D1S1/CH3.1#064000.txt @@ -2,12 +2,12 @@ .np .ce CHAPTER 3 - DISK II HARDWARE AND TRACK FORMATTING -.sp 2 +.sp2 Apple Computer's excellent manual on the Disk Operating System (DOS) provides only very basic information -about how diskettes are formatted. +about how diskettes are formatted. This chapter will explain in detail how information is structured on a diskette. The first section will @@ -16,7 +16,7 @@ hardware, and may be skipped by those already familiar with the DOS manual. For system housekeeping, DOS divides -diskettes into tracks and sectors. +diskettes into tracks and sectors. This is done during the initialization process. A track is a physically defined circular path @@ -26,14 +26,14 @@ track is identified by its distance from the center of the disk. Similar to a phonograph stylus, the read/write head of the disk drive may -be positioned over any given track. +be positioned over any given track. The tracks are similar to the grooves in a record, but they are not connected in a spiral. Much like playing a record, the diskette is spun at a constant speed while the data is read from or written to its -surface with the read/write head. +surface with the read/write head. Apple formats its diskettes into 35 tracks. They are numbered from 0 to 34, track 0 being the outermost track @@ -70,7 +70,7 @@ protection schemes. A sector is a subdivision of a track. It is the smallest unit of -"updatable" data on the diskette. +"updatable" data on the diskette. DOS generally reads or writes data a sector at a time. This is to avoid using a large chunk of memory as a @@ -86,7 +86,7 @@ locate the first sector of the track. The implication is that the software must be able to locate any given track and sector -with no help from the hardware. +with no help from the hardware. This scheme, known as "soft sectoring", takes a little more space for storage but allows flexibility, @@ -100,14 +100,14 @@ sector formats. .ne10 .nf DISK ORGANIZATION -.SP1 +.sp1 TRACKS All DOS versions................35 -.SP1 +.sp1 SECTORS PER TRACK DOS 3.2.1 and earlier...........13 DOS 3.3.........................16 -.SP1 +.sp1 SECTORS PER DISKETTE DOS 3.2.1 and earlier..........455 DOS 3.3........................560 @@ -118,15 +118,15 @@ BYTES PER SECTOR BYTES PER DISKETTE DOS 3.2.1 and earlier.......116480 DOS 3.3.....................143360 -.SP1 +.sp1 USABLE* SECTORS FOR DATA STORAGE DOS 3.2.1 and earlier..........403 DOS 3.3........................496 -.SP1 +.sp1 USABLE* BYTES PER DISKETTE DOS 3.2.1 and earlier.......103168 DOS 3.3.....................126976 -.SP2 +.sp2 * Excludes DOS, VTOC, and CATALOG .bp TRACK FORMATTING @@ -186,12 +186,12 @@ least significant bit cell would be bit cell 0. When reference is made to a specific data bit (i.e. data bit 5), it is with respect to the -corresponding bit cell (bit cell 5). +corresponding bit cell (bit cell 5). Data is written and read serially, one bit at a time. Thus, during a write operation, bit cell 7 of each byte would be written first, with bit -cell 0 being written last. +cell 0 being written last. Correspondingly, when data is being read back from the diskette, bit cell 7 is read first and bit cell 0 is @@ -245,19 +245,19 @@ instructed to write in 32 cycle intervals. If not, zero bits will continue to be written every four cycles, which is, in fact, exactly -how self-sync bytes are created. +how self-sync bytes are created. Self-sync bytes will be covered in detail shortly. .sp1 *** INSERT FIGURE 3.6 HERE *** -A "field" is made up of a group of +A "field" is made up of a group of consecutive bytes. The number of bytes varies, depending upon the nature of the field. The two types of fields present on a diskette are the Address -Field and the Data Field. They are +Field and the Data Field. They are similar in that they both contain a prologue, a data area, a checksum, and an epilogue. Each field on a track is @@ -277,7 +277,7 @@ beneath the read/write head. All gaps are primarily alike in content, consisting of self-sync hexadecimal FF's, and vary only in -the number of bytes they contain. +the number of bytes they contain. Figure 3.7 is a diagram of a portion of a typical track, broken into its major components. @@ -286,7 +286,7 @@ major components. Self-sync or auto-sync bytes are special bytes that make up the three -different types of gaps on a track. +different types of gaps on a track. They are so named because of their ability to automatically bring the hardware into synchronization with @@ -311,14 +311,14 @@ clock bits from data bits, the hardware finds the first bit cell with data in it and proceeds to read the following -seven data +seven data bits into the eight bit latch. In effect, it assumes that it had started at the beginning of a data byte. Of course, in reality, the odds of its having started at the beginning of a byte are only one in -eight. +eight. Pictured in Figure 3.8 is a small portion of a track. The clock bits have been stripped out and 0's and @@ -381,7 +381,7 @@ the track. We can now discuss the particular portions of a track in detail. The -three gaps will be covered first. +three gaps will be covered first. Unlike some other disk formats, the size of the three gap types will vary from drive to drive and even from @@ -424,13 +424,13 @@ clarity). .bp Gap 2 appears after each Address -Field and before each Data Field. +Field and before each Data Field. Its length varies from five to ten bytes on a normal drive. The primary purpose of Gap 2 is to provide time for the information in an Address Field to be decoded by the computer -before a read or write takes place. +before a read or write takes place. If the gap were too short, the beginning of the Data Field might spin past while DOS was still @@ -444,7 +444,7 @@ will occur in exactly the same spot each time. This is due to the fact that the drive which is rewriting the Data Field may not be the one -which originally INITed or wrote it. +which originally INITed or wrote it. Since the speed of the drives can vary, it is possible that the write could start in mid-byte. (See Figure @@ -472,7 +472,7 @@ boundary, thus altering an existing byte. Figure 3.12 illustrates this. .sp1 *** INSERT FIGURE 3.11 HERE *** -.SP1 +.sp1 *** INSERT FIGURE 3.12 HERE *** Gap 3 appears after each @@ -485,7 +485,7 @@ additional time needed to manipulate the data that has been read before the next sector is to be read. The length of Gap 3 is not as critical as -that of Gap 2. If the +that of Gap 2. If the following Address Field is missed, DOS can always wait for the next time it spins around @@ -503,7 +503,7 @@ An examination of the contents of the two types of fields is in order. The Address Field contains the "address" or identifying -information about the Data Field +information about the Data Field which follows it. The volume, track, and sector number of any given sector can be thought of as its "address", @@ -519,7 +519,7 @@ Figure 3.13. The prologue consists of three bytes which form a unique sequence, found -in no other component of the track. +in no other component of the track. This fact enables DOS to locate an Address Field with almost no possibility of error. The three @@ -539,7 +539,7 @@ where it is positioned on a particular diskette. The checksum is computed by exclusive-ORing the first three pieces of information, and is -used to verify its integrity. +used to verify its integrity. Lastly follows the epilogue, which contains the three bytes $DE, $AA and $EB. Oddly, the $EB is always written @@ -558,14 +558,14 @@ Field. Much like the Address Field, it consists of a prologue, data, checksum, and an epilogue. (Refer to Figure 3.14) The prologue is -different only in the third byte. +different only in the third byte. The bytes are $D5, $AA, and $AD, which again form a unique sequence, enabling DOS to locate the beginning of the sector data. The data consists of 342 bytes of encoded data. The encoding scheme used will -be discussed in the next section. +be discussed in the next section. The data is followed by a checksum byte, used to verify the integrity of the data just read. The epilogue diff --git a/D1S1/CH3.1T#040000.txt b/D1S1/CH3.1T#040000.txt index ff57aa7..edc0d2e 100644 --- a/D1S1/CH3.1T#040000.txt +++ b/D1S1/CH3.1T#040000.txt @@ -2,12 +2,12 @@ .np .ce CHAPTER 3 - DISK II HARDWARE AND TRACK FORMATTING -.sp 2 +.sp2 Apple Computer's excellent manual on the Disk Operating System (DOS) provides only very basic information -about how diskettes are formatted. +about how diskettes are formatted. This chapter will explain in detail how information is structured on a diskette. The first section will @@ -16,7 +16,7 @@ hardware, and may be skipped by those already familiar with the DOS manual. For system housekeeping, DOS divides -diskettes into tracks and sectors. +diskettes into tracks and sectors. This is done during the initialization process. A track is a physically defined circular path @@ -26,14 +26,14 @@ track is identified by its distance from the center of the disk. Similar to a phonograph stylus, the read/write head of the disk drive may -be positioned over any given track. +be positioned over any given track. The tracks are similar to the grooves in a record, but they are not connected in a spiral. Much like playing a record, the diskette is spun at a constant speed while the data is read from or written to its -surface with the read/write head. +surface with the read/write head. Apple formats its diskettes into 35 tracks. They are numbered from 0 to 34, track 0 being the outermost track @@ -70,7 +70,7 @@ protection schemes. A sector is a subdivision of a track. It is the smallest unit of -"updatable" data on the diskette. +"updatable" data on the diskette. DOS generally reads or writes data a sector at a time. This is to avoid using a large chunk of memory as a @@ -86,7 +86,7 @@ locate the first sector of the track. The implication is that the software must be able to locate any given track and sector -with no help from the hardware. +with no help from the hardware. This scheme, known as "soft sectoring", takes a little more space for storage but allows flexibility, @@ -100,14 +100,14 @@ sector formats. .ne10 .nf DISK ORGANIZATION -.SP1 +.sp1 TRACKS All DOS versions................35 -.SP1 +.sp1 SECTORS PER TRACK DOS 3.2.1 and earlier...........13 DOS 3.3.........................16 -.SP1 +.sp1 SECTORS PER DISKETTE DOS 3.2.1 and earlier..........455 DOS 3.3........................560 @@ -118,15 +118,15 @@ BYTES PER SECTOR BYTES PER DISKETTE DOS 3.2.1 and earlier.......116480 DOS 3.3.....................143360 -.SP1 +.sp1 USABLE* SECTORS FOR DATA STORAGE DOS 3.2.1 and earlier..........403 DOS 3.3........................496 -.SP1 +.sp1 USABLE* BYTES PER DISKETTE DOS 3.2.1 and earlier.......103168 DOS 3.3.....................126976 -.SP2 +.sp2 * Excludes DOS, VTOC, and CATALOG .bp TRACK FORMATTING @@ -186,12 +186,12 @@ least significant bit cell would be bit cell 0. When reference is made to a specific data bit (i.e. data bit 5), it is with respect to the -corresponding bit cell (bit cell 5). +corresponding bit cell (bit cell 5). Data is written and read serially, one bit at a time. Thus, during a write operation, bit cell 7 of each byte would be written first, with bit -cell 0 being written last. +cell 0 being written last. Correspondingly, when data is being read back from the diskette, bit cell 7 is read first and bit cell 0 is @@ -245,19 +245,19 @@ instructed to write in 32 cycle intervals. If not, zero bits will continue to be written every four cycles, which is, in fact, exactly -how self-sync bytes are created. +how self-sync bytes are created. Self-sync bytes will be covered in detail shortly. .sp1 *** INSERT FIGURE 3.6 HERE *** -A "field" is made up of a group of +A "field" is made up of a group of consecutive bytes. The number of bytes varies, depending upon the nature of the field. The two types of fields present on a diskette are the Address -Field and the Data Field. They are +Field and the Data Field. They are similar in that they both contain a prologue, a data area, a checksum, and an epilogue. Each field on a track is @@ -277,7 +277,7 @@ beneath the read/write head. All gaps are primarily alike in content, consisting of self-sync hexadecimal FF's, and vary only in -the number of bytes they contain. +the number of bytes they contain. Figure 3.7 is a diagram of a portion of a typical track, broken into its major components. @@ -286,7 +286,7 @@ major components. Self-sync or auto-sync bytes are special bytes that make up the three -different types of gaps on a track. +different types of gaps on a track. They are so named because of their ability to automatically bring the hardware into synchronization with @@ -311,14 +311,14 @@ clock bits from data bits, the hardware finds the first bit cell with data in it and proceeds to read the following -seven data +seven data bits into the eight bit latch. In effect, it assumes that it had started at the beginning of a data byte. Of course, in reality, the odds of its having started at the beginning of a byte are only one in -eight. +eight. Pictured in Figure 3.8 is a small portion of a track. The clock bits have been stripped out and 0's and @@ -381,7 +381,7 @@ the track. We can now discuss the particular portions of a track in detail. The -three gaps will be covered first. +three gaps will be covered first. Unlike some other disk formats, the size of the three gap types will vary from drive to drive and even from @@ -424,13 +424,13 @@ clarity). .bp Gap 2 appears after each Address -Field and before each Data Field. +Field and before each Data Field. Its length varies from five to ten bytes on a normal drive. The primary purpose of Gap 2 is to provide time for the information in an Address Field to be decoded by the computer -before a read or write takes place. +before a read or write takes place. If the gap were too short, the beginning of the Data Field might spin past while DOS was still @@ -444,7 +444,7 @@ will occur in exactly the same spot each time. This is due to the fact that the drive which is rewriting the Data Field may not be the one -which originally INITed or wrote it. +which originally INITed or wrote it. Since the speed of the drives can vary, it is possible that the write could start in mid-byte. (See Figure @@ -472,7 +472,7 @@ boundary, thus altering an existing byte. Figure 3.12 illustrates this. .sp1 *** INSERT FIGURE 3.11 HERE *** -.SP1 +.sp1 *** INSERT FIGURE 3.12 HERE *** Gap 3 appears after each @@ -485,7 +485,7 @@ additional time needed to manipulate the data that has been read before the next sector is to be read. The length of Gap 3 is not as critical as -that of Gap 2. If the +that of Gap 2. If the following Address Field is missed, DOS can always wait for the next time it spins around @@ -503,7 +503,7 @@ An examination of the contents of the two types of fields is in order. The Address Field contains the "address" or identifying -information about the Data Field +information about the Data Field which follows it. The volume, track, and sector number of any given sector can be thought of as its "address", @@ -519,7 +519,7 @@ Figure 3.13. The prologue consists of three bytes which form a unique sequence, found -in no other component of the track. +in no other component of the track. This fact enables DOS to locate an Address Field with almost no possibility of error. The three @@ -539,7 +539,7 @@ where it is positioned on a particular diskette. The checksum is computed by exclusive-ORing the first three pieces of information, and is -used to verify its integrity. +used to verify its integrity. Lastly follows the epilogue, which contains the three bytes $DE, $AA and $EB. Oddly, the $EB is always written @@ -558,6 +558,6 @@ Field. Much like the Address Field, it consists of a prologue, data, checksum, and an epilogue. (Refer to Figure 3.14) The prologue is -different only in the third byte. +different only in the third byte. The bytes are $D5, $AA, and $AD, which again form a diff --git a/D1S1/CH3.2#064000.txt b/D1S1/CH3.2#064000.txt index 7b8f614..7adff08 100644 --- a/D1S1/CH3.2#064000.txt +++ b/D1S1/CH3.2#064000.txt @@ -1,9 +1,9 @@ -.SP2 +.sp2 DATA FIELD ENCODING Due to Apple's hardware, it is not possible to read all 256 possible -byte values from a diskette. +byte values from a diskette. This is not a great problem, but it does require that the data written to the disk be encoded. Three different @@ -17,7 +17,7 @@ bits. It would thus require 512 "disk" bytes for each 256 byte sector of data. Had this technique been used for sector data, no more than 10 -sectors would have fit on a track. +sectors would have fit on a track. This amounts to about 88K of data per diskette, or roughly 72K of space available to the user; typical for 5 @@ -43,7 +43,7 @@ comparable drives of the day. Currently, of course, DOS 3.3 features 16 sectors per track and provides a 23% increase in disk -storage over the 13 sector format. +storage over the 13 sector format. This was made possible by a hardware modification (the P6 PROM on the disk controller card) which allowed a "6 @@ -55,7 +55,7 @@ bytes. These three different encoding techniques -will now be covered in some detail. +will now be covered in some detail. The hardware for DOS 3.2.1 (and earlier versions of DOS) imposed a number of restrictions upon how data @@ -86,7 +86,7 @@ contained in the Address Field. It is quite easy to decode the data, since the byte with the odd bits is simply shifted left and logically ANDed with -the byte containing the even bits. +the byte containing the even bits. This is illustrated in Figure 3.16. .sp1 *** INSERT FIGURE 3.16 HERE *** @@ -121,7 +121,7 @@ bytes, thus leaving an exact mapping between five bit data bytes and eight bit "disk" bytes. The process of converting eight bit data bytes to eight bit -"disk" bytes, then, is twofold. +"disk" bytes, then, is twofold. An overview is diagrammed in Figure 3.17. .sp1 @@ -132,7 +132,7 @@ up a sector must be translated to five bit bytes. This is done by the "prenibble" routine at $B800. It is a fairly involved process, involving -a good deal of bit rearrangement. +a good deal of bit rearrangement. Figure 3.18 shows the before and after of prenibbilizing. On the left is a buffer of eight bit data bytes, as @@ -141,7 +141,7 @@ package by DOS. Each byte in this buffer is represented by a letter (A, B, C, etc.) and each bit by a number (7 through 0). On the right side are -the results of the transformation. +the results of the transformation. The primary buffer contains five distinct areas of five bit bytes (the top three bits of the eight bit bytes @@ -194,7 +194,7 @@ the checksum computation to decode data, the transformation shown in Figure 3.20 greatly facilitates the time -constraint. As the data is being +constraint. As the data is being read from a sector the accumulator contains the cumulative result of all previous bytes, exclusive-ORed @@ -230,7 +230,7 @@ with only 64 needed. An additional requirement was introduced to force the mapping to be one to one, namely, that there must be at least two -adjacent bits set, excluding bit 7. +adjacent bits set, excluding bit 7. This produces exactly 64 valid "disk" values. The initial transformation is done by the prenibble routine @@ -301,7 +301,7 @@ into a "pseudo" or soft sector number used by DOS. For example, if the sector number found on the disk were a 2, this is used as an offset into a -table where the number $0B is found. +table where the number $0B is found. Thus, DOS treats the physical sector 2 as sector 11 ($0B) for all intents and purposes. This presents no @@ -322,7 +322,7 @@ access time. It is interesting to point out that Pascal, Fortran, and CP/M diskettes -all use software interleaving also. +all use software interleaving also. However, each uses a different sector order. A comparison of these differences is presented in Figure @@ -330,4 +330,4 @@ differences is presented in Figure .sp1 *** INSERT FIGURE 3.24 (22) HERE *** .br -.nxch4 +.nx ch4 diff --git a/D1S1/CH4#064000.txt b/D1S1/CH4#064000.txt index a9a6134..747f718 100644 --- a/D1S1/CH4#064000.txt +++ b/D1S1/CH4#064000.txt @@ -38,7 +38,7 @@ with new files or expansions of existing files. An example of the way DOS uses sectors is given in Figure 4.1. -.SP1 +.sp1 *** INSERT FIGURE 4.1 *** .sp1 DISKETTE SPACE ALLOCATION @@ -96,7 +96,7 @@ following format (all byte offsets are given in base 16, hexadecimal): .np VOLUME TABLE OF CONTENTS (VTOC) FORMAT -.SP1 +.sp1 .un BYTE DESCRIPTION 00 Not used @@ -126,14 +126,14 @@ C4-FF Bit maps for additional tracks if there are more than 35 tracks per diskette .bp BIT MAPS OF FREE SECTORS ON A GIVEN TRACK -.SP1 +.sp1 A four byte binary string of ones and zeros, representing free and allocated sectors respectively. Hexadecimal sector numbers are assigned to bit positions as follows: .sp1 BYTE SECTORS - +0 FEDC BA98 + +0 FEDC BA98 +1 7654 3210 +2 .... .... (not used) +3 .... .... (not used) @@ -151,7 +151,7 @@ An example of a VTOC sector is given in Figure 4.2. This VTOC corresponds to the map of the diskette given in Figure 4.1. -.SP1 +.sp1 *** INSERT FIGURE 4.2 *** .bp THE CATALOG @@ -187,7 +187,7 @@ sector (sector 1) has a zero pointer to indicate that there are no more catalog sectors in the chain. -.SP1 +.sp1 *** INSERT FIGURE 4.3 *** In each catalog @@ -203,8 +203,8 @@ described on the following page. .sp1 .np CATALOG SECTOR FORMAT -.SP1 -.UN +.sp1 +.un BYTE DESCRIPTION 00 Not used 01 Track number of next catalog sector (usually 11 hex) @@ -219,9 +219,9 @@ BA-DC Sixth file descriptive entry DD-FF Seventh file descriptive entry .bp FILE DESCRIPTIVE ENTRY FORMAT -.SP1 +.sp1 RELATIVE -.UN +.un BYTE DESCRIPTION 00 Track of first track/sector list sector. If this is a deleted file, this byte contains a hex @@ -260,9 +260,9 @@ was needed to describe them. There are four entries in use and three entries which have never been used and contain zeros. -.SP1 +.sp1 *** INSERT FIGURE 4.4 *** -.SP1 +.sp1 THE TRACK/SECTOR LIST Each file has @@ -276,7 +276,7 @@ sector points to this T/S List sector which, in turn, points to each sector in the file. This concept is diagramed in Figure 4.5. -.SP1 +.sp1 *** INSERT FIGURE 4.5 *** .bp The format of a Track/Sector List @@ -317,9 +317,9 @@ have no data sectors allocated in the T/S List. This distinction is not always handled correctly by DOS. The VERIFY command, for instance, stops when it gets to the first zero T/S List entry and can not be used -to verify some random organization text files. +to verify some random organization text files. -An example T/S List sector is given in Figure 4.6. +An example T/S List sector is given in Figure 4.6. The example file (HELLO, from our previous examples) has only one data sector, since it is less than 256 @@ -328,7 +328,7 @@ sector and the T/S List sector, HELLO is 2 sectors long, and this will be the value shown when a CATALOG command is done. -.SP1 +.sp1 *** INSERT FIGURE 4.6 *** .bp Following the Track/Sector pointer in @@ -349,8 +349,8 @@ the Track/Sector List, DOS can read each sector of the file in the correct order so that the programmer need never know that the data was broken up into -sectors at all. -.SP1 +sectors at all. +.sp1 TEXT FILES The TEXT data type is the least @@ -389,7 +389,7 @@ less efficient in the use of disk space than with a BINARY type file, since each digit must occupy a full byte in the file. -.SP1 +.sp1 *** INSERT FIGURE 4.7 *** .bp BINARY FILES @@ -399,7 +399,7 @@ shown in Figure 4.8. An exact copy of the memory involved is written to the disk sector(s), preceded by the memory address where it was found and -the length (a total of four bytes). +the length (a total of four bytes). The address and length (in low order, high order format) are those given in the A and L keywords from the BSAVE @@ -419,9 +419,9 @@ address either by providing the A entered, or by changing the address in the first two bytes of the file on the diskette. -.SP1 +.sp1 *** INSERT FIGURE 4.8 *** -.SP1 +.sp1 APPLESOFT AND INTEGER FILES A BASIC program, be it APPLESOFT or @@ -431,7 +431,7 @@ format of an APPLESOFT file type is given in Figure 4.9 and that of INTEGER BASIC in 4.10. When the SAVE command is typed, DOS determines the -location of the BASIC program image +location of the BASIC program image in memory and its length. Since a BASIC program is always loaded at a location known to the BASIC @@ -453,7 +453,7 @@ scope of this manual, but a breakdown of the example INTEGER BASIC program is given in Figure 4.10. -.SP1 +.sp1 *** INSERT FIGURES 4.9 AND 4.10 *** .bp OTHER FILE TYPES (S,R,A,B) @@ -478,7 +478,7 @@ based on additional information stored with the image itself. The format for this type of file is given in the documentation accompanying the -DOS TOOLKIT. +DOS TOOLKIT. It is recommended that if the reader requires more information about R files he should refer to that diff --git a/D1S1/CH5#064000.txt b/D1S1/CH5#064000.txt index df18705..2a2faa1 100644 --- a/D1S1/CH5#064000.txt +++ b/D1S1/CH5#064000.txt @@ -2,7 +2,7 @@ .np .ce CHAPTER 5 - THE STRUCTURE OF DOS -.sp 2 +.sp2 DOS MEMORY USE DOS is an assembly language program @@ -37,7 +37,7 @@ on a 48K system, it will not boot on less than 48K since the RAM DOS occupied does not exist on a smaller machine. -.SP1 +.sp1 *** INSERT FIGURE 5.1 *** A diagram of DOS's memory for a 48K @@ -57,7 +57,7 @@ changed from 3, the space occupied by the file buffers also changes. This affects the placement of HIMEM, moving it up or down with fewer or -more buffers respectively. +more buffers respectively. The 3.5K above the file buffers is occupied by @@ -69,7 +69,7 @@ interfacing to BASIC, interpreting commands, and managing the file buffers. All disk functions are passed on via subroutine calls to the -file manager. +file manager. .bp The file manager, occupying about 4.3K, is a collection @@ -85,7 +85,7 @@ lanaguage program which is not part of DOS. This interface is generalized through a group of vectors in page 3 of RAM and is documented in the next -chapter. +chapter. The last 2.5K of DOS is the Read/Write Track/Sector (RWTS) @@ -147,19 +147,19 @@ table itself starts at $3D0. .ll60 .bp DOS VECTOR TABLE ($3D0-$3FF) -.NP +.np ADDR USAGE 3D0 A JMP (jump or GOTO) instruction to the DOS warmstart - routine. This routine reenters DOS but does not + routine. This routine reenters DOS but does not discard the current BASIC program and does not reset MAXFILES or other DOS environmental variables. -3D3 A JMP to the DOS coldstart routine. This routine +3D3 A JMP to the DOS coldstart routine. This routine reinitializes DOS as if it was rebooted, clearing the current BASIC file and resetting HIMEM. 3D6 A JMP to the DOS file manager subroutine to allow a user written assembly language program to call it. 3D9 A JMP to the DOS Read/Write Track/Sector (RWTS) - routine to allow user written assembly language + routine to allow user written assembly language programs to call it. 3DC A short subroutine which locates the input parameter list for the file manager to allow a user written @@ -170,9 +170,9 @@ ADDR USAGE up input parameters before calling RWTS. 3EA A JMP to the DOS subroutine which "reconnects" the DOS intercepts to the keyboard and screen data streams. -3EF A JMP to the routine which will handle a BRK machine +3EF A JMP to the routine which will handle a BRK machine language instruction. This vector is only supported by - the AUTOSTART ROM. Normally the vector contains the + the AUTOSTART ROM. Normally the vector contains the address of the monitor ROM subroutine which displays the registers. 3F2 LO/HI address of routine which will handle RESET for @@ -185,7 +185,7 @@ ADDR USAGE RESET was pressed. If a power-up occured, the AUTOSTART ROM ignores the address at 3F2 (since it has never been initialized) and attempts to boot a - diskette. To prevent this from happening when you + diskette. To prevent this from happening when you change $3F2 to handle your own RESETs, EOR (exclusive OR) the new value at $3F2 with a $A5 and store the result in the power-up byte. @@ -216,7 +216,7 @@ The location of these stages on the diskette and a memory map are given in Figure 5.2 and a description of the bootstrap process follows. -.SP1 +.sp1 *** INSERT FIGURE 5.2 *** The first boot stage (let's call it @@ -368,7 +368,7 @@ The various stages of the bootstrap process will be covered again in greater detail in Chapter 8, DOS PROGRAM LOGIC. -.SP1 +.sp1 *** INSERT FIGURE 5.3 HERE *** -.BR -.NX CH6.1 +.br +.nx CH6.1 diff --git a/D1S1/CH6.1#064000.txt b/D1S1/CH6.1#064000.txt index 63aa181..58670d6 100644 --- a/D1S1/CH6.1#064000.txt +++ b/D1S1/CH6.1#064000.txt @@ -29,7 +29,7 @@ eight two byte toggles that essentially represent pulling a TTL line high or low. Applications which could use direct disk access range from a -user written operating system to DOS-independent +user written operating system to DOS-independent utility programs. The device address assignments are given in Figure 6.1. @@ -64,7 +64,7 @@ ADDRESS LABEL DESCRIPTION .bp The addresses are slot dependent and the offsets are computed by -multiplying the slot number by 16. +multiplying the slot number by 16. In hexadecimal this works out nicely and we can add the value $s0 (where s is the slot number) to the base @@ -106,7 +106,7 @@ Basically, each of the four phases (0-3) must be turned on and then off again. Done in ascending order, this moves the arm inward. In descending -order, this moves the arm outward. +order, this moves the arm outward. The timing between accesses to these locations is critical, making this a non-trivial exercise. It is @@ -119,10 +119,10 @@ MOTOR OFF/ON: .sp1 .nf LDA $C088,X Turn motor off. -.SP1 +.sp1 LDA $C089,X Turn motor on. -.SP1 -.FI +.sp1 +.fi NOTE: A sufficient delay should be provided to allow the motor time to come up to speed. Shugart recommends @@ -132,39 +132,39 @@ until data starts to change. .bp .nf ENGAGE DRIVE 1/2: -.SP1 +.sp1 LDA $C08A,X Engage drive 1. .sp1 LDA $C08B,X Engage drive 2. .sp1 READ A BYTE: -.SP1 +.sp1 READ LDA $C08C,X BPL READ -.SP1 -.FI +.sp1 +.fi NOTE: $C08E,X must already have been accessed to assure Read mode. The loop is necessary to assure that the -accumulator will contain valid data. +accumulator will contain valid data. If the data latch does not yet contain valid data the high bit will be zero. .sp1 .nf SENSE WRITE PROTECT: -.SP1 +.sp1 LDA $C08D,X LDA $C08E,X Sense write protect. BMI ERROR If high bit set, protected. .sp1 WRITE LOAD AND WRITE A BYTE -.SP1 +.sp1 LDA DATA STA $C08D,X Write load. ORA $C08C,X Write byte. .sp1 -.FI +.fi NOTE: $C08F,X must already have been accessed to insure Write mode and a 100 microsecond delay should be @@ -195,7 +195,7 @@ without an adjustment. WRITE STA $C08D,X (5) ORA $C08C,X (4) RTS (6) -.SP2 +.sp2 CALLING READ/WRITE TRACK/SECTOR (RWTS) Read/Write Track/Sector (RWTS) exists @@ -205,7 +205,7 @@ roughly the top third of the DOS program. The interface to RWTS is standardized and thoroughly documented by Apple and may be called by a -program running outside of DOS. +program running outside of DOS. There are two subroutines which must be called or whose function must be @@ -241,7 +241,7 @@ on the facing page (offsets are given in hexadecimal): .bp .nf INPUT/OUTPUT CONTROL BLOCK - GENERAL FORMAT -.SP1 +.sp1 BYTE DESCRIPTION 00 Table type, must be $01 01 Slot number times 16 (s0: s=slot. Example: $60) @@ -272,14 +272,14 @@ BYTE DESCRIPTION 10 Drive number of last access (must be initialized) .sp1 DEVICE CHARACTERISTICS TABLE -.SP1 +.sp1 BYTE DESCRIPTION 00 Device type (should be $00 for DISK II) 01 Phases per track (should be $01 for DISK II) 02-03 Motor on time count (should be $EFD8 for DISK II) .bp RWTS IOB BY CALL TYPE -.SP1 +.sp1 SEEK Move disk arm to desired track .sp1 Input: Byte 00 - Table type ($01) @@ -293,7 +293,7 @@ Input: Byte 00 - Table type ($01) .sp1 Output: Byte 0D - Return code (See previous definition) 0F - Current Slot number * 16 - 10 - Current Drive number + 10 - Current Drive number .sp1 READ Read a sector into a specified buffer .sp1 @@ -314,7 +314,7 @@ Input: Byte 00 - Table type ($01) Output: Byte 0D - Return code (See previous definition) 0E - Current Volume number 0F - Current Slot number * 16 - 10 - Current Drive number + 10 - Current Drive number .bp WRITE Write a sector from a specified buffer .sp1 @@ -335,7 +335,7 @@ Input: Byte 00 - Table type ($01) Output: Byte 0D - Return code (See previous definition) 0E - Current Volume number 0F - Current Slot number * 16 - 10 - Current Drive number + 10 - Current Drive number .sp1 FORMAT Initialize the diskette (does not put DOS on disk, create a VTOC/CATALOG, or store HELLO program) @@ -353,6 +353,6 @@ Input: Byte 00 - Table type ($01) Output: Byte 0D - Return code (See previous definition) 0E - Current Volume number 0F - Current Slot number * 16 - 10 - Current Drive number + 10 - Current Drive number .bp .nx ch6.2 diff --git a/D1S1/CH6.2#064000.txt b/D1S1/CH6.2#064000.txt index ccc68b7..25f5084 100644 --- a/D1S1/CH6.2#064000.txt +++ b/D1S1/CH6.2#064000.txt @@ -7,7 +7,7 @@ the central third of the DOS program. The interface to these routines is generalized in such a way that they may be called by a program running -outside of DOS. The definition of +outside of DOS. The definition of this interface has never been published by APPLE (or anyone else, for that manner) but @@ -19,7 +19,7 @@ these routines may be relied upon as "safe". Indeed, the new FID utility program uses these routines to process files -on the diskette. +on the diskette. There are two subroutines which must be called @@ -81,7 +81,7 @@ The general format of the file manager parameter list is as follows: .bp FILE MANAGER PARAMETER LIST - GENERAL FORMAT -.NP +.np BYTE DESCRIPTION 00 Call type: 01=OPEN 05=DELETE 09=RENAME 02=CLOSE 06=CATALOG 0A=POSITION @@ -97,7 +97,7 @@ BYTE DESCRIPTION FILE MANAGER PARAMETER LIST BY CALL TYPE below. 0A Return code (note: not all return codes can occur for any call type). The processor CARRY - flag is set upon return from the file + flag is set upon return from the file manager if there is a non-zero return code: 00=No errors 01=Not used ("LANGUAGE NOT AVAILABLE") @@ -114,7 +114,7 @@ BYTE DESCRIPTION 0C-0D Address of a 45 byte buffer which will be used by the file manager to save its status between calls. This area is called the file manager workarea and need not - be initialized by the caller but the space must be + be initialized by the caller but the space must be provided and this two byte address field initialized. (addresses are in low/high order format) 0E-0F Address of a 256 byte buffer which will be used by the @@ -124,15 +124,15 @@ BYTE DESCRIPTION 10-11 Address of a 256 byte buffer which will be used by the file manager to maintain the data sector buffer. Buffer need not be initialized by the caller. -.SP1 +.sp1 *** INSERT FIGURE 6.2 *** .bp FILE MANAGER PARAMETER LIST BY CALL TYPE -.NP +.np OPEN Locates or creates a file. A call to POSITION should follow every OPEN. .sp1 -Input: Byte 00 - 01 +Input: Byte 00 - 01 02/03 - Fixed record length or 0000 if variable 04 - Volume number or 00 for any volume 05 - Drive number to be used (01 or 02) @@ -280,7 +280,7 @@ Input: Byte 00 - 0B .sp1 Output: Byte 0A - Return code .sp2 -VERIFY Verify that there are no bad sectors in a file by +VERIFY Verify that there are no bad sectors in a file by reading every sector. .sp1 Input: Byte 00 - 0C @@ -292,7 +292,7 @@ DOS BUFFERS Usually it is desirable to use one of DOS's buffers when calling the file manager to save memory. DOS buffers consist of -each of the three buffers used by the file manager (file +each of the three buffers used by the file manager (file manager workarea, T/S List sector, and data sector) as well as a 30 byte file name buffer and some link pointers. All together a DOS buffer occupies 595 bytes of memory. The address of the @@ -300,7 +300,7 @@ first DOS buffer is stored in the first two bytes of DOS ($9D00 on a 48K APPLE II). The address of the next buffer is stored in the first and so on in a chain of linked elements. The link address to the next buffer in the last buffer is zeros. If the -buffer is not being used by DOS, the first byte of the file +buffer is not being used by DOS, the first byte of the file name field is a hex 00. Otherwise, it contains the first character of the name of the open file. The assembly language programmer should follow these conventions to avoid having DOS @@ -309,18 +309,18 @@ name of the file should be stored in the buffer to reserve it for exclusive use (or at least a non-zero byte stored on the first character) and later, when the user is through with the buffer, a 00 should be stored on the file name to return it -to DOS's use. If the later is not done, DOS will eventually -run out of available buffers and will refuse even to do a +to DOS's use. If the later is not done, DOS will eventually +run out of available buffers and will refuse even to do a CATALOG command. A diagram of the DOS buffers for MAXFILES 3 is given in -Figure 6.3 and +Figure 6.3 and the format of a DOS buffer is given below. -.SP1 +.sp1 *** INSERT FIGURE 6.3 *** .sp1 .ne10 DOS BUFFER FORMAT -.NP +.np BYTE DESCRIPTION 000/0FF Data sector buffer (256 bytes in length) 100/1FF T/S List sector buffer (256 bytes in length) @@ -401,15 +401,15 @@ COMMON ALGORITHMS Given below are several pieces of code which are used when working with DOS: -.SP1 +.sp1 .ne5 LOCATE A FREE DOS BUFFER The following subroutine may be used to locate an unallocated DOS buffer for use with the DOS file manager. -.SP1 -.NP +.sp1 +.np FBUFF LDA $3D2 LOCATE DOS LOAD POINT STA $1 LDY #0 @@ -445,11 +445,11 @@ call RWTS or the file manager to insure that DOS is present on this machine. .sp1 -.NP +.np LDA $3D0 GET VECTOR JMP CMP #$4C IS IT A JUMP? BNE NODOS NO, DOS NOT LOADED -.SP2 +.sp2 .ne5 WHICH VERSION OF DOS IS ACTIVE? @@ -469,7 +469,7 @@ the DOS version may be required: .sp2 .ne5 WHICH BASIC IS SELECTED? -.PP + Some programs depend upon either the INTEGER BASIC ROM or the APPLESOFT ROM. To find out which is active and @@ -481,7 +481,7 @@ is used for INTEGER BASIC and $4C is used for APPLESOFT. To set up for APPLESOFT, for example: .sp1 -.NP +.np LDA #$4C CODE FOR APPLESOFT JSR SETBSC CALL SUBROUTINE BNE ERROR LANGUAGE NOT AVAILABLE diff --git a/D1S1/CH7#064000.txt b/D1S1/CH7#064000.txt index 4962ebf..c756f11 100644 --- a/D1S1/CH7#064000.txt +++ b/D1S1/CH7#064000.txt @@ -64,18 +64,18 @@ be followed to do this: Execute MASTER CREATE (800G) When MASTER CREATE finishes loading the DOS image it will exit. You may use the monitor to make - changes in the image. MASTER CREATE loads DOS + changes in the image. MASTER CREATE loads DOS into memory at $1200 such that Boot 2 (RWTS) is loaded first, followed by the main part of DOS starting at $1C00. When all patches have been made, reenter MASTER CREATE at location $82D (82DG). - Complete the MASTER CREATE update normally. The + Complete the MASTER CREATE update normally. The resulting diskette will have the patches applied. .br This procedure will work for versions 3.2, 3.2.1, and 3.3 of DOS. -.SP1 +.sp1 .ne5 AVOIDING RELOAD OF LANGUAGE CARD diff --git a/D1S2/CH8#064000.txt b/D1S2/CH8#064000.txt index a38c790..dbca226 100644 --- a/D1S2/CH8#064000.txt +++ b/D1S2/CH8#064000.txt @@ -5,8 +5,8 @@ .m22 .m48 .fo ''-%- -.pn 5 -.pi 0 +.pn5 +.pi0 .br .np .ce @@ -34,7 +34,7 @@ are given in decimal, addresses in hexadecimal (base 16). .sp1 DISK II CONTROLLER CARD ROM - BOOT 0 -.SP1 +.sp1 .pi0 .ul ADDRESS @@ -44,9 +44,9 @@ C600-C65B This routine is the first code executed when a disk C600G or 6 control-P. Dynamically build a translate table for converting disk codes to six bit hex at location $356-$3FF. - Call an RTS instruction in the monitor ROM and + Call an RTS instruction in the monitor ROM and extract the return address from the stack to find out - the address of this controller card ROM. + the address of this controller card ROM. Use this address to determine the slot number of this drive by shifting $Csxx. Save the slot number times 16 ($s0) @@ -92,9 +92,9 @@ C65C-C6FA This subroutine reads the sector number stored at Otherwise, go to $801 to begin executing the second stage of the bootstrap. .sp1 -FIRST RAM BOOTSTRAP LOADER - BOOT 1 +FIRST RAM BOOTSTRAP LOADER - BOOT 1 .sp1 -.Ul +.ul ADDRESS .np 0801-084C This routine loads the second RAM loader, Boot 2, @@ -104,7 +104,7 @@ ADDRESS Create the address of the ROM sector read subroutine (C65C in our case) and store it at $3E,$3F. Pick up the first memory page in which to read Boot 2 - from location $8FE, add the length of Boot 2 in + from location $8FE, add the length of Boot 2 in sectors from $8FF, and set that value as the first address to which to read (read last page first). 081F Get sector to read, if zero, go to $839. @@ -124,8 +124,8 @@ ADDRESS master disk, $B700 in its final relocated location). .sp1 DOS 3.3 MAIN ROUTINES -.SP1 -.Ul +.sp1 +.ul ADDRESS .np 9D00-9D0F Relocatable address constants @@ -144,7 +144,7 @@ ADDRESS and this table contains the address of the routine which handles each state from state 0 to state 6. .np -9D1E-9D55 Command handler entry point table. This table +9D1E-9D55 Command handler entry point table. This table contains the address of a command handler subroutine for each DOS command in the following standard order: INIT A54F @@ -186,7 +186,7 @@ ADDRESS 9D5E Address of BASIC warmstart. 9D60 Address of BASIC relocate (APPLESOFT only). .np -9D62-9D6B Image of the entry point vector for INTEGER BASIC. +9D62-9D6B Image of the entry point vector for INTEGER BASIC. This image is copied to 9D56 if INTEGER BASIC is made active. .np @@ -213,7 +213,7 @@ ADDRESS Set NOMON C,I,O. Set video intercept handler state to 0. Coldstart or warmstart the current BASIC (exit DOS). - (DOS will next gain control when BASIC prints its + (DOS will next gain control when BASIC prints its input prompt character) .np 9DEA-9E50 First entry processing for DOS. This routine is @@ -227,7 +227,7 @@ ADDRESS Set MAXFILES to 3 by default. Call A7D4 to build the DOS file buffers. If an EXEC was active, close the EXEC file - Set the video intercept state to 0 and indicate + Set the video intercept state to 0 and indicate warmstart status by calling A75B. If the last command executed was not INIT (this DOS was not just booted), go to 9E45. @@ -242,7 +242,7 @@ ADDRESS If so, go to A180 to execute it. Otherwise, return to caller. .np -9E51-9E7F An image of the DOS 3-page jump vector which the +9E51-9E7F An image of the DOS 3-page jump vector which the above routine copies to $3D0-$3FF. See Chapter 5 for a description of its contents. .np @@ -252,7 +252,7 @@ ADDRESS go to 9E9E. Get value in A register at entry and echo it on the screen (erases flashing cursor). - If in read state (reading a file) go to A626 to get + If in read state (reading a file) go to A626 to get next byte from disk file. Otherwise, call 9DEA to do first entry processing. Put cursor on screen in next position. @@ -287,7 +287,7 @@ ADDRESS If read flag is on (file being read) and output is a "?" character (BASIC INPUT), go to state 6 to skip it. - If read flag is on and output is prompt character + If read flag is on and output is prompt character ($33) go to state 2 to ignore the line. Set state to 2 (ignore non-DOS command) just in case. If output character is not a control-D, go to @@ -329,7 +329,7 @@ ADDRESS Exit DOS with echo on screen if MON O. .np 9F61-9F70 State 5 output handler. --Start of WRITE data line-- - If the character is a control-D, go to state 0 to + If the character is a control-D, go to state 0 to immediately exit write mode. If the character is a line feed, write it and exit, staying in state 5. diff --git a/D1S2/CH8.1#064000.txt b/D1S2/CH8.1#064000.txt index caf3d35..add4e87 100644 --- a/D1S2/CH8.1#064000.txt +++ b/D1S2/CH8.1#064000.txt @@ -8,13 +8,13 @@ If it doesn't match and if there are more entries left to check, go back to 9FD6. If it does match, go to A01B. - Otherwise, if command was not found in the table, + Otherwise, if command was not found in the table, check to see if the first character was a control-D. If so, go to A6C4 to print "SYNTAX ERROR". Otherwise, call A75B to reset the state and warmstart flag and go to 9F95 to echo the command and exit. (the command must be for BASIC, not DOS) - A01B Compute an index into the operand table for the + A01B Compute an index into the operand table for the command which was entered. Call A65E to see if a BASIC program is executing. If not, and the command is not a direct type command, @@ -26,7 +26,7 @@ is a legal operand for this command. If not, go to A0A0. Otherwise, clear the filename buffer (call A095). - Flush to the next non-blank (call A1A4) and copy + Flush to the next non-blank (call A1A4) and copy the filename operand to the first filename buffer. Skip forward to a comma if one was not found yet. If a second filename is legal for this command, use @@ -82,7 +82,7 @@ A17A-A17F Call A180 to process the command, then exit via echo A180-A192 Do command. Reset the video intercept state to zero. Clear the file manager parameter list. - Using the command index, get the address of the + Using the command index, get the address of the command handling routine from the command handler routine table at 9D1E and go to it. Command handler will exit to caller of this routine. @@ -93,12 +93,12 @@ A193-A1A3 Get next character on command line and check to see A1A4-A1AD Flush command line characters until a non-blank is found. .np -A1AE-A1B8 Clear the file manager parameter list at B5BA to +A1AE-A1B8 Clear the file manager parameter list at B5BA to zeros. .np A1B9-A1D5 Convert numeric operand from command line. Call either A1D6 (decimal convert) or A203 (hex convert) - depending upon the presence or lack thereof of a + depending upon the presence or lack thereof of a dollar sign ($). .np A1D6-A202 Decimal convert subroutine. diff --git a/D1S2/CH8.2#064000.txt b/D1S2/CH8.2#064000.txt index 442e70f..5332ea6 100644 --- a/D1S2/CH8.2#064000.txt +++ b/D1S2/CH8.2#064000.txt @@ -57,7 +57,7 @@ A331-A35C BSAVE command handler. Open and verify a B type file (A3D5). Write the A keyword value as the first two bytes of the file. - Write the L keyword value as the next two bytes of + Write the L keyword value as the next two bytes of the file. Use the A value to exit by writing a range of bytes from memory to the file. @@ -92,7 +92,7 @@ A397-A3D4 SAVE command handler. A3BC Open and test for I type file (A3D5). Compute program length (HIMEM-PGMSTART). Write this two byte length to file. - Exit by writing program image from PGMSTART as a + Exit by writing program image from PGMSTART as a range of bytes (A3FF). .np A3D5-A3DF Open and test file type. @@ -124,7 +124,7 @@ A413-A479 LOAD command handler. Which BASIC is active? If INTEGER, go to A450. Select APPLESOFT BASIC (A4B1). This call could result - in DOS losing control if the RAM version must be + in DOS losing control if the RAM version must be run. Read first two bytes of file as length of program. Add length to LOMEM (program start) to compute @@ -159,7 +159,7 @@ A4B1-A4D0 Select desired BASIC. Save current command index in case we must RUN APPLESOFT. If INTEGER, go to A59E to select it. - Otherwise, copy primary file name to secondary + Otherwise, copy primary file name to secondary buffer to save it in case RAM APPLESOFT is needed. Go to A57A to set APPLESOFT. .np diff --git a/D1S2/CH8.3#064000.txt b/D1S2/CH8.3#064000.txt index ff70d9f..723c5d4 100644 --- a/D1S2/CH8.3#064000.txt +++ b/D1S2/CH8.3#064000.txt @@ -20,7 +20,7 @@ A59E-A5B1 INT command handler. A5B2-A5C5 Set ROM to desired BASIC. (This routine is passed a $4C for APPLESOFT or a $20 for INTEGER, since these bytes appear at $E000 in - these BASICs. It will work regardless of which + these BASICs. It will work regardless of which BASIC is onboard) If desired BASIC is already available, exit. Try selecting ROM card. @@ -76,7 +76,7 @@ A65E-A678 Test to see if BASIC is running a program or is in immediate command mode. If active BASIC is INTEGER, go to A672. If line number is greater than 65280 and prompt is - "]" then APPLESOFT is in immediate mode. + "]" then APPLESOFT is in immediate mode. Otherwise, it is executing a program. Exit to caller with appropriate return code. A672 Check $D9 to determine whether BASIC is executing a diff --git a/D1S2/CH8.4#064000.txt b/D1S2/CH8.4#064000.txt index 88e6ed0..a224a52 100644 --- a/D1S2/CH8.4#064000.txt +++ b/D1S2/CH8.4#064000.txt @@ -14,7 +14,7 @@ A909-A940 Command valid keywords table. This table is used to determine which keywords are required or may be given for any DOS command. Each command has a two byte entry with 16 flags, - indicating which keywords may be given. The flag + indicating which keywords may be given. The flag bit settings are as follows: .ul BIT MEANING @@ -71,7 +71,7 @@ A909-A940 Command valid keywords table. .np A941-A94A Keyword name table. This table contains all the ASCII names of the DOS - keywords in standard order. Each keyword name + keywords in standard order. Each keyword name occupies one byte: V,D,S,L,R,B,A,C,I,O .np @@ -133,13 +133,13 @@ A971-AA3E Error message text table. .np AA3F-AA4F Error message text offset index table. This table contains the offset in bytes to the text - of any given error message in the table above. + of any given error message in the table above. Entries are one byte each for each error code number. .np AA4F-AA65 DOS main routines variables. AA4F Current file buffer address (2 bytes). - AA51 Status flags: $01=READ state, $00=Warmstart, - $80=Coldstart, $40=APPLESOFT RAM + AA51 Status flags: $01=READ state, $00=Warmstart, + $80=Coldstart, $40=APPLESOFT RAM AA52 DOS CSWL intercept state number. AA53 Address of true CSWL handler (2 bytes). AA55 Address of true KSWL handler (2 bytes). @@ -202,7 +202,7 @@ AAFD-AB05 File manager external entry point (from $3D6). Is X register zero? If so, allow new files by simulating an INIT command index. - Otherwise, require old file by simulating a LOAD + Otherwise, require old file by simulating a LOAD command index. Fall through to main file manager entry point. .np diff --git a/D1S2/CH8.5#064000.txt b/D1S2/CH8.5#064000.txt index 7dd5a3d..55d55d0 100644 --- a/D1S2/CH8.5#064000.txt +++ b/D1S2/CH8.5#064000.txt @@ -79,7 +79,7 @@ AC96-ACA7 READ A RANGE OF BYTES subcode handler. Read a byte (ACA8). Point $42,$43 at range address and add one to address Store byte read at address. - Loop back to AC96. (length check will exit file + Loop back to AC96. (length check will exit file manager when length is zero.) .np ACA8-ACB8 Read a data byte. @@ -245,7 +245,7 @@ AE8E-AF07 INIT function handler. Set up link from this directory sector to next (track $11, sector-1). Call RWTS to write directory sector. - Write each sector on track in this way except for + Write each sector on track in this way except for sector zero. On last sector (sector 1) zero link pointer. Point RWTS parms at DOS load point (B7C2). diff --git a/D1S2/CH8.6#064000.txt b/D1S2/CH8.6#064000.txt index 975f121..3b79770 100644 --- a/D1S2/CH8.6#064000.txt +++ b/D1S2/CH8.6#064000.txt @@ -15,7 +15,7 @@ AF5E-AFDB Read a T/S List sector to file buffer. Is first or next wanted? If first, go to AFB5 to continue. Otherwise, get link to next T/S List from this one. - If link is non-zero, use it to find next one and go + If link is non-zero, use it to find next one and go to AFB5. Otherwise, we are out of T/S Lists for this file. If we are reading file, exit with error code. @@ -113,7 +113,7 @@ B0B6-B133 Read next data sector (if necessary). If non-zero, go to B114. Otherwise, if not writing, exit with error (no data to read there). - If writing, allocate a new sector and store its + If writing, allocate a new sector and store its track/sector location in the list at this point (B134). Go to B120. @@ -196,7 +196,7 @@ B23A-B243 Switch to second pass in directory scan. B244-B2C2 Allocate a disk sector. Is there a track currently allocated to this file? If not, go to B26A to find a track with free sectors. - B249 Otherwise, decrement sector number to get next + B249 Otherwise, decrement sector number to get next possible free sector number. If there are no more sectors on this track, go to B265 to find a new track. @@ -225,7 +225,7 @@ B244-B2C2 Allocate a disk sector. Compute bit map index (tracknumber*4). Copy track bit map from VTOC to workarea, watching to see if all four bytes are zero (track is full). - In any case, set all four bytes in VTOC to zero + In any case, set all four bytes in VTOC to zero (allocate all sectors). If no free sectors in the track, go to B272 to try next track. @@ -337,7 +337,7 @@ B4BB-B5BA DIRECTORY sector buffer. B5BB-B5D0 File manager parameter list. B5BB Opcode B5BC Subcode - B5BD Eight bytes of variable parameters depending on + B5BD Eight bytes of variable parameters depending on opcode. B5C5 Return code. B5C7 Address of file manager workarea buffer. @@ -385,7 +385,7 @@ B600-B6FF Start of Boot 2/RWTS image. on track 0, sector 0. B65D DOS 3.3 patch area. B65D APPEND patch flag. - B65E APPEND patch. Come here when file manager driver + B65E APPEND patch. Come here when file manager driver gets an error other than end of data. Locate and free the file buffer. Clear the APPEND flag. diff --git a/D1S2/CH8.7#064000.txt b/D1S2/CH8.7#064000.txt index 7c685cd..98938c1 100644 --- a/D1S2/CH8.7#064000.txt +++ b/D1S2/CH8.7#064000.txt @@ -5,7 +5,7 @@ B700-B749 DOS 2nd stage boot loader. Create new stack. Call SETVIC ($FE93) and SETKBD ($FE89). Exit to DOS coldstart ($9D84). -.NP +.np B74A-B78C Put DOS on tracks 0-2. Set RWTS parmlist to write DOS to disk. Call Read/Write group of pages ($B793). @@ -20,7 +20,7 @@ B793-B7B4 Read/Write a group of pages. B7B5-B7C1 Disable interrupts and call RWTS. .np B7C2-B7D5 Set RWTS parameters for writing DOS. -.NP +.np B7D6-B7DE Zero current buffer. Zero 256 bytes pointed to by $42,$43. Exit to caller. @@ -51,14 +51,14 @@ B7E8-B7F8 RWTS parmlist. B7F6 Volume number found. B7F7 Slot number found. B7F8 Drive number found. -.NP +.np B7F9-B7FA Unused. -.NP +.np B7FB-B7FE Device Characteristics Table (DCT). B7FB Device type (should be $00). B7FC Phases per track (should be $01). B7FD Motor on time count (2 bytes - should be $EF, $D8). -.NP +.np B7FF Unused. .np B800-B829 PRENIBBLE routine. @@ -128,7 +128,7 @@ B8DC-B943 READ routine. B944-B99F RDADR routine. Read an Address Field. Reads starting address marks ($D5/$AA/$96), address - information (volume/track/sector/checksum), and + information (volume/track/sector/checksum), and closing address marks ($DE/$AA). On entry: X-reg:Slot number times 16 Read mode (Q6L,Q7L) @@ -181,13 +181,13 @@ BA29-BA68 Write Translate Table. Values range from $96 to $FF. Codes with more than one pair of adjacent zeros or with no adjacent ones are excluded. -.NP +.np BA69-BA95 Unused. .np BA96-BAFF Read Translate Table. Contains 8 bit bytes used to convert 6 bit "nibbles". Values range from $96 to $FF. - Codes with more than one pair of adjacent zeros or + Codes with more than one pair of adjacent zeros or with no adjacent ones are excluded. .np BB00-BBFF Primary Buffer. @@ -220,7 +220,7 @@ BCC4-BCDE Write double byte subroutine. BCDF-BCFF Unused. .np BD00-BD18 Main entry to RWTS. - Upon entry, store Y-reg and A-reg at $48,$49 as + Upon entry, store Y-reg and A-reg at $48,$49 as pointers to the IOB. Initialize maximum number of recals at 1 and seeks at 4. @@ -242,9 +242,9 @@ BD54-BD73 Move pointers in IOB to zero page for future use. BD74-BD8F Select appropriate drive and save drive being used as high bit of $35. 1=drive 1, 0=drive 2. Get test results. If drive was on, branch to $BD90. - Wait for capacitor to discharge using MSWAIT + Wait for capacitor to discharge using MSWAIT subroutine at $BA00. -BD90-BDAA Get destination track and go to it using MYSEEK +BD90-BDAA Get destination track and go to it using MYSEEK subroutine at $BE5A. Check test result again and if drive was on, branch to TRYTRK at $BDAB. @@ -281,17 +281,17 @@ BE0B-BE0C Used to branch to ALLDONE at $BE46. BE0D-BF0F FORMDSK Jump to DSKFORM at $BEAF. BE10-BE25 RTTRK - Check volume number found against volume number + Check volume number found against volume number wanted. If no volume was specified, then no error. If specified volume doesn't match, load A-reg with - $20 (volume mismatch error) and exit via HNDLERR + $20 (volume mismatch error) and exit via HNDLERR at $BE48. BE26-BE45 CRCTVOL Check to see if sector is correct. Use ILFAV table at $BFB8 for software sector interleaving. - If wrong sector, try again by branching back to + If wrong sector, try again by branching back to TRYADR at $BDC1. If sector correct, find out what operation to do. If write, branch to WRIT at $BE51. @@ -310,11 +310,11 @@ BE51-BE59 WRITE If the write was good, exit via ALLDONE ($BE46). If bad write, load A-reg with $10 (write protect error) and exit via HNDLERR ($BE48). -BE5A-BE8D MYSEEK - Provides necessary housekeeping before going to +BE5A-BE8D MYSEEK + Provides necessary housekeeping before going to SEEKABS routine. Determines number of phases per track and stores - track information in appropriate slot dependent + track information in appropriate slot dependent location. BE8E-BE94 XTOY routine. Put slot in Y-reg by transferring X-reg divided @@ -331,7 +331,7 @@ BEAF-BF0C INIT command handler Allow 48 retries during initialization. Double check that the first sector found is zero after calling TRACK WRITE. - Increment the track number after successfully + Increment the track number after successfully formatting a track. Loop back until 35 tracks are done. BF0D-BF61 TRACK WRITE routine. @@ -339,7 +339,7 @@ BF0D-BF61 TRACK WRITE routine. Preceed it with 128 self-sync bytes. Follow them with sectors 0 through 15 in sequence. Set retry count for verifying the track at 48. - Fill the sector initilization map with positive + Fill the sector initilization map with positive numbers. Loop through a delay period to bypass most of the initial self-sync bytes. @@ -355,7 +355,7 @@ BF62-BF87 VERIFY TRACK routine. This routine reads all 16 sectors from the track that was just formatted. If an error occurs during the read of either the - Address Field or the Data Field, the number of + Address Field or the Data Field, the number of retries is decremented. The routine continues reading until retries is zero. Calls Sector Map routine ($BF88). @@ -367,7 +367,7 @@ BF88-BFA7 Sector Map routine. if that value is greater than zero. Upon completion of track zero, the sync count is decremented by two if it is at least 16. -.NP +.np BFA8-BFB7 Sector Initialization Map used to mark sectors as they are initialized. Contains a $30 prior to initialization of a track. diff --git a/D1S2/CH8.ZPAGE.USE#064000.txt b/D1S2/CH8.ZPAGE.USE#064000.txt index 9a7b92a..0733f49 100644 --- a/D1S2/CH8.ZPAGE.USE#064000.txt +++ b/D1S2/CH8.ZPAGE.USE#064000.txt @@ -2,7 +2,7 @@ .nf .na DOS ZERO PAGE USAGE -.SP1 +.sp1 .un BYTE USE 24 Cursor horizontal (DOS) diff --git a/D1S2/TABLE.OF.CONTEN#064000.txt b/D1S2/TABLE.OF.CONTEN#064000.txt index afa32f6..aed478b 100644 --- a/D1S2/TABLE.OF.CONTEN#064000.txt +++ b/D1S2/TABLE.OF.CONTEN#064000.txt @@ -1,39 +1,39 @@ .na -.NF +.nf .ce -TABLE OF CONTENTS -.SP3 +TABLE OF CONTENTS +.sp3 CHAPTER 1 -.SP1 -.UL +.sp1 +.ul INTRODUCTION -.SP3 +.sp3 CHAPTER 2 -.SP1 -.UL +.sp1 +.ul THE EVOLUTION OF DOS -.SP1 +.sp1 DOS 3 DOS 3.1 DOS 3.2 DOS 3.2.1 DOS 3.3 -.SP3 +.sp3 CHAPTER 3 -.SP1 -.UL +.sp1 +.ul THE DISK II HARDWARE AND TRACK FORMATTING -.SP1 +.sp1 DISK ORGANIZATION TRACK FORMATTING DATA FIELD ENCODING SECTOR INTERLEAVING -.SP3 +.sp3 CHAPTER 4 -.SP1 -.UL +.sp1 +.ul DISKETTE DATA FORMATS -.SP1 +.sp1 DISKETTE SPACE ALLOCATION THE VTOC THE CATALOG @@ -43,21 +43,21 @@ BINARY FILES APPLESOFT AND INTEGER FILES OTHER FILE TYPES (S,R,A,B) EMERGENCY REPAIRS -.SP3 +.sp3 CHAPTER 5 -.SP1 -.UL +.sp1 +.ul THE STRUCTURE OF DOS -.SP1 +.sp1 DOS MEMORY USE THE DOS VECTORS IN PAGE 3 WHAT HAPPENS DURING BOOTING -.SP3 +.sp3 CHAPTER 6 -.SP1 -.UL +.sp1 +.ul USING DOS FROM ASSEMBLY LANGUAGE -.SP1 +.sp1 DIRECT USE OF DISK DRIVE CALLING READ/WRITE TRACK/SECTOR (RWTS) RWTS IOB BY CALL TYPE @@ -65,50 +65,50 @@ CALLING THE DOS FILE MANAGER FILE MANAGER PARAMETER LIST BY CALL TYPE THE FILE MANAGER WORKAREA COMMON ALGORITHMS -.SP3 +.sp3 CHAPTER 7 -.SP1 -.UL +.sp1 +.ul CUSTOMIZING DOS -.SP1 +.sp1 SLAVE VS MASTER PATCHING AVOIDING RELOAD OF LANGUAGE CARD INSERTING A PROGRAM BETWEEN DOS AND ITS BUFFERS BRUN OR EXEC A HELLO FILE REMOVING THE PAUSE DURING A LONG CATALOG -.SP3 +.sp3 CHAPTER 8 -.SP1 -.UL +.sp1 +.ul DOS PROGRAM LOGIC -.SP1 +.sp1 DISK II CONTROLLER CARD ROM - BOOT 0 FIRST RAM BOOT STRAP LOADER - BOOT 1 DOS 3.3 MAIN ROUTINES DOS FILE MANAGER READ/WRITE TRACK/SECTOR -.BP +.bp APPENDIX A -.SP1 -.UL +.sp1 +.ul EXAMPLE PROGRAMS -.SP1 +.sp1 HOW TO USE THE PROGRAMS DUMP - TRACK DUMP PROGRAM ZAP - DISK UPDATE PROGRAM FTS - FIND TRACK/SECTOR LISTS PROGRAM COPY - BINARY TO TEXT FILE CONVERT PROGRAM INIT - REFORMAT A SINGLE DISK TRACK -.SP3 +.sp3 APPENDIX B -.SP1 -.UL +.sp1 +.ul DISK PROTECTION SCHEMES -.SP3 +.sp3 APPENDIX C -.SP1 -.UL +.sp1 +.ul GLOSSARY -.SP3 +.sp3 INDEX -.BR +.br diff --git a/D2S1/APPENDIX.A#064000.txt b/D2S1/APPENDIX.A#064000.txt index 849a323..66bc13e 100644 --- a/D2S1/APPENDIX.A#064000.txt +++ b/D2S1/APPENDIX.A#064000.txt @@ -1,12 +1,12 @@ -.ec^ +.ec^ .m11 .m22 .m48 .na .ll60 .fo ''-%- -.pn 5 -.pi 0 +.pn5 +.pi0 .br .np .ce @@ -34,7 +34,7 @@ It is recommended that, until the reader is completely familiar with the operation of these programs, he would be well advised to use them -only on an "expendable" diskette. +only on an "expendable" diskette. None of the programs can physically damage a diskette, but they can, if used improperly, destroy the data on @@ -43,7 +43,7 @@ re-INITialized. .sp1 Five programs are provided: .sp1 -.NF +.nf DUMP TRACK DUMP UTILITY .pi8 .in8 @@ -69,7 +69,7 @@ attempt to patch a diskette directory back together. It is also useful in examining the structure of files stored on disk and in applying -patches to files or DOS directly. +patches to files or DOS directly. ZAP allows its user to read, and optionally write, any sector on a diskette. As such, it serves as a @@ -84,7 +84,7 @@ INIT REFORMAT A SINGLE TRACK This program will initialize a single track on a diskette. Any volume -number ($00-$FF) may be specified. +number ($00-$FF) may be specified. INIT is useful in restoring a track whose sectoring has been damaged without reinitializing the entire @@ -97,7 +97,7 @@ FTS FIND T/S LISTS UTILITY .in8 FTS may be used when the directory -for a diskette has been destroyed. +for a diskette has been destroyed. It searches every sector on a diskette for what appear to be Track/Sector Lists, printing the @@ -131,7 +131,7 @@ the File Manager. .pi0 .in0 STORING THE PROGRAMS ON DISKETTE -.pp +.pp The enterprising programmer may wish to type the source code for each program into an assembler and @@ -160,10 +160,10 @@ be stored there .sp1 For example... .sp1 -.NF +.nf 0800:20 DC 03 112 COPY JSR LOCFPL FIND PARMLIST -.SP1 -.FI +.sp1 +.fi indicates that the binary code "20DC03" should be stored at 0800 and that this is statement 112. To enter @@ -172,14 +172,14 @@ must type in each address and its corresponding object code. The following is an example of how to enter the DUMP program: -.BP +.bp .nf CALL -151 (Enter the monitor from BASIC) 0800:20 E3 03 0803:84 00 0805:85 01 0807:A5 02 -.SP1 +.sp1 ...etc... .sp1 0879:85 3F @@ -196,16 +196,16 @@ When the program is to be run... BLOAD DUMP (Load program) CALL -151 (Get into monitor) 02:11 N 800G (Store track to dump, run program) -.pp +.pp The BSAVE commands which must be used with the other programs are: .sp1 BSAVE ZAP,A$900,L$6C -.BR +.br BSAVE INIT,A$800,L$89 -.BR +.br BSAVE FTS,A$900,L$DC -.BR +.br BSAVE COPY,A$800,L$1EC .bp DUMP -- TRACK DUMP UTILITY @@ -230,7 +230,7 @@ I/O errors. The DUMP program serves as an example of direct use of the DISK II hardware from assembly language, with little or no use of -DOS. +DOS. To use DUMP, first store the number of the track you wish dumped at @@ -278,7 +278,7 @@ The next step up the ladder from DUMP is to access data on the diskette at the sector level. The ZAP program allows its user to specify a track -and sector to be read into memory. +and sector to be read into memory. The programmer can then make changes in the image of the sector in memory and subsequently use ZAP to write the @@ -337,7 +337,7 @@ entered... .nf 803:02 (Change 03 to 02) 04:02 N 900G (Change ZAP to write mode and do it) -.pp +.pp Note that ZAP will remember the previous values in $02, $03, and $04. @@ -448,7 +448,7 @@ printed by FTS to see if it is really a T/S List. Additionally, FTS will find every T/S List image on the diskette, even some which were for -files which have since been deleted. +files which have since been deleted. Since it is difficult to determine which files are valid and which are old deleted files, it is usually @@ -484,7 +484,7 @@ read track $12, sector $0F. At +$0C is the track and sector of the first sector in the file. This sector can be read and examined to try to -identify the file and its type. +identify the file and its type. Usually a BASIC program can be identified, even though it is stored in tokenized form, from the text @@ -492,7 +492,7 @@ strings contained in the PRINT statements. An ASCII conversion chart (see page 8 in the APPLE II REFERENCE MANUAL) can be used to -decode these character strings. +decode these character strings. Straight T-type files will also contain ASCII text, with each line separated from the others with $8D @@ -509,8 +509,8 @@ something else. Given below is an example ZAP to the CATALOG to create an entry for the file whose T/S List is at T=12 S=0F. -.SP1 -.NF +.sp1 +.nf CALL -151 BLOAD ZAP ...insert disk to be ZAPped... @@ -531,7 +531,7 @@ found by FTS until all of the files have been recovered. As each file is recovered, it may be RENAMEd to its previous name. Once all the files -have been copied to another disk, +have been copied to another disk, and successfully tested, the damaged disk may be re-INITialized. .bp @@ -549,7 +549,7 @@ file. The name of the input file is assumed to be "INPUT", although this could just as easily have been inputted from the keyboard, and the -name of the output file is "OUTPUT". +name of the output file is "OUTPUT". COPY is a single drive operation, using the last drive which was referenced. diff --git a/D2S1/APPENDIX.B#064000.txt b/D2S1/APPENDIX.B#064000.txt index a8dc65b..085ecaa 100644 --- a/D2S1/APPENDIX.B#064000.txt +++ b/D2S1/APPENDIX.B#064000.txt @@ -112,7 +112,7 @@ the order of the information, doubling the sector numbers, or altering the checksum with some constant. Any of the above would -cause an I/O error in a normal DOS. +cause an I/O error in a normal DOS. Finally, we have the two closing bytes ($DE/$AA), which are similar to the starting bytes, but with a @@ -135,7 +135,7 @@ also. Switching the third bytes between the two fields is an example of a protective measure. The data portion consists of 342 bytes of -data, followed by a checksum byte. +data, followed by a checksum byte. Quite often the data is written so that the checksum computation will be non-zero, causing an error. The @@ -176,7 +176,7 @@ A state of the art protection scheme consists of two elements. First, the data is stored on the diskette in some non-standard way in order to -make copying very difficult. +make copying very difficult. Secondly, some portion of memory is utilized that will be altered upon a RESET. (For example, the primary @@ -186,7 +186,7 @@ software from being removed from memory intact. Recently, several "nibble" or byte -copy programs have become available. +copy programs have become available. Unlike traditional copy programs which require the data to be in a predefined format, these utilities @@ -196,7 +196,7 @@ protected disks were first introduced, it has been asked, "why can't a track be read into memory and then written back out to another -diskette in exactly the same way?". +diskette in exactly the same way?". The problem lies with the self-sync or auto-sync bytes. (For a full discussion see Chapter 3) These @@ -227,13 +227,13 @@ will expand the physical space needed to write the track back out, since sync bytes require 25% more room. If enough hex $FF's occur in the data, -the track will overwrite itself. +the track will overwrite itself. This can happen in general if the drive used to write the data is -significantly slower than normal. +significantly slower than normal. Thus, we are back to having to analyze the data and, in effect, make -some assumptions. It appears that, +some assumptions. It appears that, apart from using some hardware device to help find the sync bytes, a software program must make @@ -255,7 +255,7 @@ nibble copy programs to rely heavily upon the user for direction. If the present trend continues, it is very likely that protection schemes will -evolve to a point where automated +evolve to a point where automated techniques cannot be used to defeat them. .br diff --git a/D2S1/APX.C.1#064000.txt b/D2S1/APX.C.1#064000.txt index d7b7bf4..dc72384 100644 --- a/D2S1/APX.C.1#064000.txt +++ b/D2S1/APX.C.1#064000.txt @@ -5,8 +5,8 @@ APPENDIX C - GLOSSARY .sp1 .pn5 -.IN20 -.PI-20 +.in20 +.pi-20 ACCESS TIME]>The time required to locate and read or write data on a @@ -31,7 +31,7 @@ ALPHANUMERIC]>An alphabetic character term used to refer to the class of all characters and digits. -ANALOG]>As opposed to digital. +ANALOG]>As opposed to digital. Having a value which is continuous, such as a voltage or electrical resistance. @@ -73,7 +73,7 @@ of a program or data against the possibility of its accidental loss or destruction. -BASE]>The number system in use. +BASE]>The number system in use. Decimal is base 10, since each digit represents a power of 10 (1,10,100,...). Hexadecimal is base @@ -155,7 +155,7 @@ predecessor via an address pointer. CHECKSUM/CRC]>A method for verifying that data has not been damaged. When data is written, the sum of all its -constituent bytes is stored with it. +constituent bytes is stored with it. If, when the data is later read, its sum no longer matches the checksum, it has been damaged. @@ -163,7 +163,7 @@ it has been damaged. CLOBBERED]>Damaged or destroyed. A clobbered sector is one which has been overwritten such that it is -unrecoverable. +unrecoverable. CODE]>Executable instructions to the computer, usually in machine @@ -233,7 +233,7 @@ contain a printable ASCII character, binary numeric data, or a machine language instruction. -DCT]>Device Characteristics Table. +DCT]>Device Characteristics Table. Used as an input parameter table to Read/Write Track/Sector (RWTS) to describe the hardware characteristics @@ -249,7 +249,7 @@ an executing BASIC program. OPEN, READ, WRITE, and CLOSE are all examples of deferred commands. -DIGITAL]>As opposed to analog. +DIGITAL]>As opposed to analog. Discrete values as opposed to continuous ones. Only digital values may be stored in a computer. Analog @@ -281,7 +281,7 @@ data stored there. DISK INITIALIZATION]>The process which places track formatting information, including sectors and -gaps, on a blank diskette. +gaps, on a blank diskette. During disk initialization, DOS also places a VTOC and directory on the newly formatted disk, as well as @@ -289,7 +289,7 @@ saving the HELLO program. DISPLACEMENT]>The distance from the beginning of a block of data to a -particular byte or field. +particular byte or field. Displacements are usually given beginning with 0, for the first byte, 1 for the second, etc. Also known as @@ -304,7 +304,7 @@ sends them to the printer. DUMP]>An unformatted or partially formatted listing of the contents of -memory or a diskette in hexadecimal. +memory or a diskette in hexadecimal. Used for diagnostic purposes. ENCODE]>To translate data from one @@ -316,7 +316,7 @@ on a DISK II. ENTRY POINT (EPA)]>The entry point address is the location within a -program where execution is to start. +program where execution is to start. This is not necessarily the same as the load point (or lowest memory address in the program). @@ -414,7 +414,7 @@ because it easily converts with binary. HIGH MEMORY]>Those memory locations -which have high address values. +which have high address values. $FFFF is the highest memory location. Also called the "top" of memory. @@ -436,7 +436,7 @@ block of storage. INSTRUCTION]>A single step to be performed in an assembly language or -machine language program. +machine language program. Instructions perform such operations as addition, subtraction, store, or load. @@ -482,7 +482,7 @@ disk or cassette tape. JMP]>A 6502 assembly langauge instruction which causes the computer to begin executing instructions at a -different location in memory. +different location in memory. Similar to a GOTO statement in BASIC. JSR]>A 6502 assembly langauge @@ -500,7 +500,7 @@ from the keyboard or a remote terminal. LABEL]>A name associated with a -location in a program or in memory. +location in a program or in memory. Labels are used in assembly langauge much like statement numbers are used in BASIC. @@ -521,7 +521,7 @@ array of data items. LOAD POINT (LP)]>The lowest address of a loaded assembly language -program -- the first byte loaded. +program -- the first byte loaded. Not necessarily the same as the entry point address (EPA). @@ -552,7 +552,7 @@ or Least Significant Byte. The 1's bit in a byte or the second pair of hexadecimal digits forming an address. In the address $8030, $30 -is the LO order part of the address. +is the LO order part of the address. MASTER DISK]>A DOS diskette which will boot in an APPLE II of any size @@ -602,7 +602,7 @@ stored as a file on a diskette. OFFSET]>The distance from the beginning of a block of data to a -particular byte or field. +particular byte or field. Offsets are usually given beginning with 0, for the first byte, 1 for the second, etc. Also known as diff --git a/D2S1/APX.C.2#064000.txt b/D2S1/APX.C.2#064000.txt index 8324ea2..faf9fb8 100644 --- a/D2S1/APX.C.2#064000.txt +++ b/D2S1/APX.C.2#064000.txt @@ -1,6 +1,6 @@ PAGE]>256 bytes of memory which share -a common high order address byte. +a common high order address byte. Zero page is the first 256 bytes of memory ($0000 through $00FF). @@ -11,7 +11,7 @@ a separate line or wire. PARAMETER LIST]>An area of storage set aside for communication between -a calling program and a subroutine. +a calling program and a subroutine. The parameter list contains input and output variables which will be used by the subroutine. @@ -57,7 +57,7 @@ beginning of a disk field which uniquely identify it from any other data on the track. -PROM]>Programmable Read Only Memory. +PROM]>Programmable Read Only Memory. PROMs are usually used on controller cards associated with peripherals to hold the driver program which @@ -120,7 +120,7 @@ RELEASE]>A version of a distributed piece of software. There have been several releases of DOS. -RELOCATABLE]>The attribute of +RELOCATABLE]>The attribute of an object module file which contains a machine language program and the information necessary @@ -131,7 +131,7 @@ RETURN CODE]>A numeric value returned from a subroutine, indicating the success or failure of the operation attempted. A return code of zero -usually means there were no errors. +usually means there were no errors. Any other value indicates the nature of the error, as defined by the design of the subroutine. @@ -195,7 +195,7 @@ DOS image will always be loaded into the same memory location, regadless of the size of the machine. -SOFT ERROR]>A recoverable I/O error. +SOFT ERROR]>A recoverable I/O error. A worn diskette might produce soft errors occasionally. @@ -252,13 +252,13 @@ Also called "strobe". TOKENS]>A method where human recognizable words may be coded to single binary byte values for memory -compression and faster processing. +compression and faster processing. BASIC statements are tokenized, where hex codes are assigned to words like IF, PRINT, and END. TRACK]>One complete circular path of -magnetic storage on a diskette. +magnetic storage on a diskette. There are 35 concentric tracks on an APPLE diskette. @@ -276,7 +276,7 @@ sector number for each of its data sectors in the order that they are to be read or written. -TTL]>Transistor to Transistor Logic. +TTL]>Transistor to Transistor Logic. A standard for the interconnection of integrated circuits which also defines the which voltages @@ -295,7 +295,7 @@ VOLUME]>An identification for a diskette, disk platter, or cassette, containing one or more files. -VTOC]>Volume Table Of Contents. +VTOC]>Volume Table Of Contents. Based upon the IBM OS/VS VTOC. On the APPLE, a sector mapping the free sectors on the diskette and diff --git a/D2S1/CORRECTIONS#064000.txt b/D2S1/CORRECTIONS#064000.txt index 0d49705..9486adc 100644 --- a/D2S1/CORRECTIONS#064000.txt +++ b/D2S1/CORRECTIONS#064000.txt @@ -25,7 +25,7 @@ Q7H with Q6L = Write Q7H with Q6H = Load Write Latch .bp SIG 3-4 -.SP3 +.sp3 8-5 .sp1 9E9E If EXECing, call A682 to get the next byte from the @@ -37,9 +37,9 @@ SIG 3-4 8-8 .sp1 table of valid keywords (A941). -.SP3 +.sp3 8-9 -.SP1 +.sp1 A1AE-A1B8 Clear the file manager parameter list at B5BB to .sp3 8-13 @@ -55,9 +55,9 @@ AACA-ACD9 WRITE A RANGE OF BYTES subcode handler. ACDA-ACEE Write a data byte. .sp3 8-27 -.SP1 +.sp1 AF3A Otherwise, set up RWTS pointer (AF4B). -.SP1 +.sp1 next (C=1)). .sp3 8-28 @@ -78,13 +78,13 @@ B134-B15A Add a new data sector to file. 8-34 .sp1 Call SETVID ($FE93) and SETKBD ($FE89). -.SP3 +.sp3 8-35 -.SP1 +.sp1 $20=Volume mismatch, $40=Drive error, $08=INIT error. .sp1 Uses Write Translate Table ($BA29). -.SP3 +.sp3 8-37 .sp1 Y-reg:number of autosyncs to write @@ -92,7 +92,7 @@ B134-B15A Add a new data sector to file. 8-39 .sp1 Jump to DSKFORM at $BEAF. -.SP1 +.sp1 Use ILEAV table at $BFB8 for software sector .sp3 8-41 @@ -100,7 +100,7 @@ B134-B15A Add a new data sector to file. BFC8-BFD8 Patch area starts here. .bp SIG 5-6 -.SP3 +.sp3 A-16 .sp1 using ZAP to patch a catalog entry into track 17 for each diff --git a/README.md b/README.md index 82c51d7..7ec7140 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ join in--send patches, help add stuff, etc. * Escape all else in C-style 3. Remove NUL at end of .txt files 4. .pp dot command is paragraph break, replace with blank line. +5. Remove trailing whitespace +6. Normalize case and spacing of dot commands (lowercase here) + This has probably broken the .s files a bit, and I haven't bothered to decompile the five byte HELLO ... ;)