TRS-80 DOS - LDOS 5.3.1 for the Model I - FORMAT/CMD Disassembled
Page Customization
Page Index
FORMAT/CMD
Other Navigation
Introduction/Summary
LDOS 5.3.1 FORMAT/CMD Disassembly - The Diskette Formatter (Model I)
FORMAT writes the tracks of a diskette, checks every sector, and writes the system information: the two boot sectors and the system information sector on cylinder 0, a copy of the allocation table, and a directory with the records of BOOT/SYS and DIR/SYS on a cylinder near the middle. The command is FORMAT :d (NAME="name",MPW="password",SDEN,DDEN,SIDES=n,CYL=n,STEP=n,ABS,QUERY=N,SYSTEM,WAIT=n,DIR=n); whatever is not given is asked for or taken as a default.
The file is a load module of 4989 bytes: a copyright record, 23 load blocks with 4842 bytes in 6000H-7673H (with gaps that are not in the file), and the transfer address 6E00H. The program has two parts. The front end (6E00H-7264H) reads the parameters and the replies, copies the target drive's drive code table to 6564H and changes the copy, checks the diskette and jumps to the engine (71EBH). The engine (6000H-6563H) builds each track from a template into the memory from 6E00H up, over the front end, which has finished; it reaches the drive's driver itself, through the JP at the start of the working copy (6460H), so the system's own drive code table is never changed.
The Parameters
@PARAM reads the parameters only when the command line starts with :d; without it the drive is asked for and the rest of the line is not read (6E3EH). Each parameter's value goes into the operand of the instruction that reads it (the table at 72A8H).
| Parameter | What the Code Does |
|---|---|
| NAME="name" (N) | The diskette name, at most 8 characters, put in upper case into the allocation table (+D0H). NAME alone asks Diskette name ?; without NAME the QUERY setting decides: ask, or take LDOSDISK (6EDBH). |
| MPW="password" (M) | The master password, the same way, default PASSWORD. It must start with a letter and hold only letters and digits; its hash (SYS2/SYS) goes to +CEH-+CFH (7201H). |
| SDEN, DDEN | Single or double density. Without them the density is double when the drive's controller can do it (bit 6 of +04H), else single (6F6EH). |
| SIDES=n | SIDES=2 formats both sides (bit 5 of +04H); anything else one side. |
| CYL=n (C) | The cylinders of a 5 inch floppy, below 96; 96 or more gives Parameter error. Without it the drive's cylinders from the system information sector (SYSTEM (DRIVE=d,CYL=n)). An 8 inch diskette always gets 77. |
| STEP=n | The bootstrap step rate, 0-3, written into both boot sectors. Without it the rate of drive 0's table in the system information sector (SYSTEM (BSTEP=n), 6E17H). |
| ABS (A) | A diskette that holds data is formatted without the question Are you sure you want to format it ? (71C3H). |
| QUERY=N (Q) | No question: NAME and MPW take their defaults and the format the defaults of the drive. Any of SDEN, DDEN, SIDES, CYL or STEP also stops every question about the format. |
| SYSTEM | On a 5 inch double density floppy: after the format, cylinder 0 is written again in single density, so the ROM can boot from it (bit 4 of the configuration byte). On a drive whose table has bit 4 of +04H set: only the system information is written. Any other format refuses it with Can only SYSTEM a 5" DDEN floppy! (70BCH). |
| WAIT=n (W) | A wait of n counts of the ROM's delay (0060H) after each Step In of the format, and before each cylinder of the verify (6125H). |
| DIR=n (D) | The cylinder of the directory, when it is below the highest cylinder; else the middle cylinder. A locked out cylinder moves it to the nearest good one (6241H). |
The Questions
In this order: Which drive is to be used ? (without :d), Diskette name ?, Master password ?, Single or Double density <S,D> ? (only when the controller can do double density), Enter number of sides <1,2> ?, Number of cylinders ? (5 inch floppies only), and the bootstrap step rate in milliseconds: 6, 12, 20, 30 or 40 for a 5 inch drive, 3, 6, 10, 15 or 20 for an 8 inch drive. ENTER takes the default. For drive 0 Load destination diskette and hit <ENTER> follows, and at the end Load SYSTEM diskette and hit <ENTER>. A JCL job, which cannot answer, ends at Load destination diskette and at Are you sure you want to format it ?; the question for the system diskette waits for ENTER.
Before the format the drive must be ready, the head on track 0 after a Restore, a diskette turning (the index hole passes within half a second, 723EH), not write protected, and HIGH$ must leave room for the track above 6E00H. When cylinder 0, sector 0 can be read in the new format, the diskette is shown as Disk contains data -- with its name and date, or Non-standard format, Unreadable directory or Non-initialized directory (7167H).
The Track Templates
Four descriptors (6571H) give for each size and density the template, the values of +07H and +08H, and the memory the track takes. A template holds the sectors on a track, the skew, the order of the sectors on the track and a stream of codes that 6013H expands: 01H-F0H (and F6H-FFH; 00H means 256) put the next byte that many times, F1H-F2H enclose the part repeated for every sector, F3H marks an ID field, F5H repeats a pair of bytes, F4H ends the stream; the list of the sectors in the order of the verify follows.
| Template | Format | Sectors | Interleave, Skew | Track |
|---|---|---|---|---|
| 6589H | 5 inch, single density | 10 | 2, 7 | 3105 bytes; 2 granules of 5 sectors on a track; data E5H. |
| 65C9H | 5 inch, double density | 18 | 3, 13 | 6334 bytes; 3 granules of 6 sectors; data 6DH B6H. Its memory size (196AH) is 84 bytes less than the 6590 bytes 6013H writes. |
| 6623H | 8 inch, single density | 16 | 3, 2 | 5176 bytes; 2 granules of 8 sectors; data E5H. |
| 6668H | 8 inch, double density | 30 | 5, 3 | 10357 bytes; 3 granules of 10 sectors; data 6DH B6H. |
What FORMAT Writes
Every track of every cylinder (both sides with SIDES=2), from cylinder 0 up, the head moved only by Restore and Step In; then every sector is verified, and a cylinder with a sector not found or a CRC error is shown with an asterisk and locked out (FFH in the allocation table and the lock out table). The directory goes on the middle cylinder or the nearest good one.
| Cylinder, Sector | Contents |
|---|---|
| 0, 0 | Boot sector 0 from 6B00H, with the directory cylinder and the step rate: the sector the ROM boots from (the BOOT/SYS page shows it as it is on the system diskette). |
| 0, 1 | Boot sector 1 from 6C00H, for a boot through a disk driver. |
| 0, 2 | The system information sector: 53H and 255 bytes of 00H. |
| 0, 3 | A copy of the allocation table. |
| Directory, 0 | The allocation table (6A00H-6AFFH): a byte for each cylinder, a bit set for each granule not free; the lock out table at +60H; +CCH the cylinders less 35; +CDH the configuration byte; +CEH the hash of the master password; +D0H the name; +D8H the date; +E0H no AUTO command. |
| Directory, 1 | The hash index table: A2H (BOOT/SYS) and C4H (DIR/SYS). |
| Directory, 2 and 3 | The records of BOOT/SYS (6524H) and DIR/SYS (6544H). |
| Directory, 4 on | Empty sectors of 00H. |
Every sector of the directory cylinder is written with the deleted data mark and read back: only the error 06H of that mark is accepted (6497H). The other sectors are written with the normal mark and verified.
Drives Without Track Writing
A drive whose table has bit 4 of +04H set gets no questions about the format (density, sides, cylinders, step rate) and no check of the controller's status or of the memory, but the name, the password and the test for data on the diskette as any other; the engine writes no tracks (61FCH). A hard disk (bit 3 of +03H) is formatted only when the operator answers Y to The target drive is a hard disk!. Without SYSTEM the drive's driver gets function 0CH, with SYSTEM nothing is done to the surface. Then the system information is written. On this path nothing has stored a table at 6000H-6009H, so the copy at 62FFH puts FORMAT's own first nine bytes into the working table, and the next call through it runs those bytes as code.
About This Page
Every byte of the file has its row; the rows of the two boot sector images (6B00H-6CFFH) show their code as it runs at 4200H, and their branches link to the rows of the image. Further points read from the code: when no cylinder can take the directory, the JP 6434H at 6281H displays Format aborted! and not the text at 6715H; Number of cylinders ? takes at most 95; the default name is LDOSDISK; the question Special non-standard format desired ? (7416H) is not used; the bootstrap step rate stays 03H on a drive with bit 4 of +04H set; after the clock interrupt was shut out (6007H) FORMAT ends with Note: Realtime clock no longer accurate.
Memory Map
Load Blocks in File Order
The file starts with a copyright record (type 1FH, 49 bytes: Copyright 1991 MISOSYS, Inc., All rights reserved), then 23 load blocks with 4842 bytes in the order LDOS loads them (the two boot sector images come last), then the transfer address 6E00H. 6564H-656DH, 656FH-6570H, 685BH-68FFH, 6904H-6ACAH, 6D00H-6DFFH and 7265H-7276H are not in the file.
| Address | Contents |
|---|---|
| 6000H-60FFH | 256 bytes |
| 6100H-61FFH | 256 bytes |
| 6200H-62FFH | 256 bytes |
| 6300H-63FFH | 256 bytes |
| 6400H-64FFH | 256 bytes |
| 6500H-6563H | 100 bytes |
| 656EH-656EH | 1 bytes |
| 6571H-6670H | 256 bytes |
| 6671H-6770H | 256 bytes |
| 6771H-685AH | 234 bytes |
| 6900H-6903H | 4 bytes |
| 6ACBH-6AFFH | 53 bytes |
| 6E00H-6EFFH | 256 bytes |
| 6F00H-6FFFH | 256 bytes |
| 7000H-70FFH | 256 bytes |
| 7100H-71FFH | 256 bytes |
| 7200H-7264H | 101 bytes |
| 7277H-7376H | 256 bytes |
| 7377H-7476H | 256 bytes |
| 7477H-7576H | 256 bytes |
| 7577H-7673H | 253 bytes |
| 6B00H-6BFFH | 256 bytes |
| 6C00H-6CFFH | 256 bytes |
The Parts of the File
| Address | Contents |
|---|---|
| 6000H-6523H | The engine: the track expander (6013H), the format of every cylinder (6095H), the verify (612EH), the directory cylinder (6241H), the system information (629EH-6418H), the end (641AH), the calls to the driver (6460H) and its helpers. |
| 6524H-66D1H | The records of BOOT/SYS and DIR/SYS, the working drive code table (not in the file), the four track descriptors and templates. |
| 66D2H-6AFFH | The engine's texts, a Restore (6763H), the pointers 6900H and the allocation table image (6A00H-6AFFH). |
| 6B00H-6CFFH | The images of boot sectors 0 and 1 (run at 4200H). |
| 6D00H-6DFFH | Not in the file: the table of the ID fields of the track, then the buffer of the replies and of the sectors written. |
| 6E00H-7264H | The front end; from 6000H on the engine builds the tracks here, up to 6E00H plus the memory size of the descriptor. |
| 7265H-7673H | The saved table and the cylinders of the drives (not in the file), the two supervisor requests, the master password, the table of the parameters and the front end's texts. |
Sections of the Disassembly
| Address | Contents |
|---|---|
| 6000H | The Format Engine: Entry |
| 6013H | Expand the Track Template |
| 6095H | Format Every Cylinder |
| 60D6H | Write the Track, the Second Side, Step In |
| 612EH | Verify Every Cylinder |
| 61E3H | A Sector Failed the Verify |
| 61FCH | A Drive Without Track Writing: the Hard Disk Question |
| 6241H | Choose the Directory Cylinder |
| 629EH | The Boot Sectors: Cylinder 0, Sectors 0 and 1 |
| 62FFH | The Allocation Table: Cylinder 0, Sectors 2 and 3 |
| 6364H | The Directory Cylinder |
| 641AH | The End: Formatting Complete |
| 642FH | A Period, the Abort, and Putting Back the Interrupt Vector |
| 6460H | Calls to the Drive's Driver |
| 6497H | Verify a Directory Sector, the Error Exits, Small Helpers |
| 6524H | The Directory Records of BOOT/SYS and DIR/SYS |
| 6564H | The Working Drive Code Table and the Counts |
| 6571H | The Four Track Descriptors |
| 6589H | Template: 5 Inch, Single Density |
| 65C9H | Template: 5 Inch, Double Density |
| 6623H | Template: 8 Inch, Single Density |
| 6668H | Template: 8 Inch, Double Density |
| 66D2H | The Engine's Texts (1) |
| 6763H | Restore and Side 0 |
| 676FH | The Engine's Texts (2) |
| 685BH | Memory Not in the File, the Boot Sector Pointers, the Allocation Table Image |
| 6B00H | Image of Boot Sector 0 (Runs at 4200H) |
| 6B2EH | Image of Boot Sector 0: Locate SYS0/SYS (Runs at 422EH) |
| 6B42H | Image of Boot Sector 0: Load SYS0/SYS Record by Record (Runs at 4242H) |
| 6B79H | Image of Boot Sector 0: Fetch the Next Byte (Runs at 4279H) |
| 6B94H | Image of Boot Sector 0: Display an Error and Stop (Runs at 4294H) |
| 6B9EH | Image of Boot Sector 0: Display a Text (Runs at 429EH) |
| 6BACH | Image of Boot Sector 0: Read a Sector, Two Tries (Runs at 42ACH) |
| 6BE4H | Image of Boot Sector 0: Texts (42E4H-42FFH) |
| 6C00H | Image of Boot Sector 1 (Runs at 4200H) |
| 6C4CH | Image of Boot Sector 1: Locate SYS0/SYS (Runs at 424CH) |
| 6C66H | Image of Boot Sector 1: Load SYS0/SYS Record by Record (Runs at 4266H) |
| 6C9DH | Image of Boot Sector 1: Fetch the Next Byte (Runs at 429DH) |
| 6CB3H | Image of Boot Sector 1: Display an Error and Stop (Runs at 42B3H) |
| 6CBDH | Image of Boot Sector 1: Display a Text (Runs at 42BDH) |
| 6CC9H | Image of Boot Sector 1: Read a Sector Through the Driver (Runs at 42C9H) |
| 6CD7H | Image of Boot Sector 1: Multiply Two Bytes (Runs at 42D7H) |
| 6CE6H | Image of Boot Sector 1: Texts (42E6H-42FFH) |
| 6D00H | The Buffer at 6D00H (Not in the File) |
| 6E00H | The Front End: the Banner, the System Information Sector |
| 6E3EH | The Drive and the Parameters |
| 6E9BH | NAME and MPW Follow QUERY, the Drive's Table |
| 6EDBH | The Diskette Name, the Date, the Master Password |
| 6F6EH | The Density |
| 6FF3H | The Sides and the Cylinders |
| 704BH | The Bootstrap Step Rate, SYSTEM |
| 70CFH | The Allocation Table Image, the Target Diskette |
| 711AH | Check the Target Diskette |
| 71EEH | A Number From Digits |
| 7201H | Check and Hash the Master Password |
| 723EH | Does a Diskette Turn? |
| 7265H | Not in the File: the Saved Table and the Cylinders of the Drives |
| 7277H | Two Supervisor Requests |
| 727DH | The Master Password, a Text |
| 72A8H | The Table of the Parameters |
| 7341H | The Front End's Texts |
Memory FORMAT Uses
| Address | Contents |
|---|---|
| 0033H, 0040H, 0049H, 0060H | ROM: display the character in Register A; the line input (Register Pair HL the buffer, Register B the length, the CARRY FLAG for BREAK; it ends the reply with 0DH); wait for a key; the delay, Register Pair BC counted down. |
| 4012H | The interrupt vector (ROM 0038H jumps here): C3H, the JP to 4518H. FORMAT stores C9H (RET) here while it writes the tracks (6010H) and puts the byte back (6446H). |
| 402DH, 4030H, 4409H | @EXIT (the end, Register Pair HL = 0000H), @ABORT and @ERROR (a disk error or error 2CH, bit 6 set for the short message). |
| 4040H | TIMER$, the tick counter (40 a second): the half second of the test whether a diskette turns. |
| 4049H-404AH | HIGH$: the track must end below it (715BH). |
| 4200H-42FFH | The system's sector buffer: the system information sector of drive 0 is read here (6E11H); its drive tables at 4220H (after a boot through a disk driver) or 4270H give the default step rate (+03H of drive 0) and each drive's highest cylinder (+06H). |
| 430FH | SFLAG$: bit 5 a JCL job runs (no question can be answered). |
| 442FH | MFLAG$: bit 0 the system was booted through a disk driver. |
| 4467H, 447BH, 4470H, 4476H | @DSPLY, @LOGOT, @DATE (the date as MM/DD/YY into the allocation table) and @PARAM. |
| 4700H-474FH | DCT$: the target drive's table is copied from here (47A5H, 6EC6H); FORMAT never writes it. |
| 4777H | RDSECT: the read of the system information sector. |
| 47A5H | The address of drive Register C's table: Register Pair HL = 4700H + the drive x 10. |
| 4B6CH | MULTEA: Register A = Register A x Register E (8 bits). |
| RST 28H, 84H and E4H | SYS2/SYS: 84H loads it, E4H the hash of the master password (its 4E27H). |
| 45FBH | SYS0/SYS's floppy disk driver, called through the working table (functions 00H, 01H, 04H, 05H, 07H, 09H, 0AH, 0CH, 0DH, 0EH, 0FH). |
Variables
The entry points of FORMAT, then the data of the file, the operands it changes, and the memory outside the file that it uses, by address.
Entry Points
| Address | Contents |
|---|---|
| 6E00H | The start of FORMAT, the transfer address of the file: the front end. |
| 6000H | The engine, entered from 71EBH with Index Register IY = 6564H. |
| 6013H | Build the track from the template (the SYSTEM pass enters here again). |
| 6095H | Format every cylinder. |
| 612EH | Verify every cylinder. |
| 6241H | Choose the directory cylinder (624AH after the verify). |
| 629EH | Write the boot sectors, the allocation table, the system information sector and the directory. |
| 641AH | The end through @EXIT. |
| 6434H | Format aborted! (6437H another text) and @ABORT. |
| 6440H | Put back the interrupt vector, ask for the system diskette, Restore. |
| 6460H | The calls to the driver: 6460H function 00H, 6463H 01H, 6467H 04H, 646BH 05H, 646FH 07H, 6473H 0FH, 6477H 0CH, 647BH 0DH, 647FH 0EH, 6483H 09H, 6487H 0AH; 6489H the common part. |
| 6497H | Verify a sector with the deleted data mark. |
| 64A7H | Report a disk error and end; 64B1H error 2CH. |
| 64B5H | Two digits of a number (Register C, Register B). |
| 64C2H | Display a question and read up to 3 characters; 64C9H up to 8; 64CEH into the buffer at Register Pair HL. |
| 64E9H | Write two digits over the last two on the screen. |
| 64FBH | Put a track descriptor into effect with the default cylinders; 650AH without them. |
| 71EEH | A number from digits. |
| 7201H | Check and hash the master password. |
| 723EH | Does a diskette turn? |
| 7277H | The requests 84H (7277H) and E4H (727AH). |
Data in the File
| Address Size | Contents |
|---|---|
| 6524H 1 byte | DEFB 5EH 6524H, BOOT/SYS +00H, the attribute: 5EH, bit 6 a system file, bit 4 in use, bit 3 invisible, bits 2-0 access level 6 (execute only without the password). |
| 6525H 1 byte | DEFB 00H 6525H, BOOT/SYS +01H: 00H, no flags and no month (the record is not dated). |
| 6526H 1 byte | DEFB 00H 6526H, BOOT/SYS +02H: 00H, the day and the year of the date, none. |
| 6527H 1 byte | DEFB 00H 6527H, BOOT/SYS +03H: 00H, the end of file byte: the last sector is full. |
| 6528H 1 byte | DEFB 00H 6528H, BOOT/SYS +04H: 00H, the record length: 256 bytes. |
| 6529H-6530H 8 bytes | DEFM "BOOT " 6529H-6530H, BOOT/SYS +05H-+0CH: the name BOOT, padded with spaces to 8 bytes. |
| 6531H-6533H 3 bytes | DEFM "SYS" 6531H-6533H, BOOT/SYS +0DH-+0FH: the extension SYS. |
| 6534H-6535H 2 bytes | DEFW 01AEH 6534H-6535H, BOOT/SYS +10H-+11H: 01AEH, the hash of the file's password (4296H would be no password); SYS2/SYS's @OPEN compares it. |
| 6536H-6537H 2 bytes | DEFW 0000H 6536H-6537H, BOOT/SYS +12H-+13H: 0000H, the time and the year of the date stamp, none. |
| 6538H-6539H 2 bytes | DEFW 0005H 6538H-6539H, BOOT/SYS +14H-+15H: 0005H, the ending record number: 5 sectors, cylinder 0 sectors 0-4. |
| 653AH 1 byte | DEFB 00H 653AH, BOOT/SYS +16H: 00H, the cylinder of the first extent: cylinder 0. |
| 653BH 1 byte | DEFB 00H 653BH, BOOT/SYS +17H: 00H, the first extent's first granule (bits 7-5: granule 0) and its granules less one (bits 4-0: one granule). |
| 653CH-6541H 6 bytes | DEFB FFH x 6 653CH-6541H, BOOT/SYS +18H-+1DH: the three other extents, FFH (no extent). |
| 6542H 1 byte | DEFB FFH 6542H, BOOT/SYS +1EH: FFH, no link to an extension record. |
| 6543H 1 byte | DEFB FFH 6543H, BOOT/SYS +1FH: FFH, the number of an extension record, none. |
| 6544H 1 byte | DEFB 5DH 6544H, DIR/SYS +00H, the attribute: 5DH, bit 6 a system file, bit 4 in use, bit 3 invisible, bits 2-0 access level 5 (read only without the password). |
| 6545H 1 byte | DEFB 00H 6545H, DIR/SYS +01H: 00H, no flags and no month. |
| 6546H 1 byte | DEFB 00H 6546H, DIR/SYS +02H: 00H, the day and the year of the date, none. |
| 6547H 1 byte | DEFB 00H 6547H, DIR/SYS +03H: 00H, the end of file byte: the last sector is full. |
| 6548H 1 byte | DEFB 00H 6548H, DIR/SYS +04H: 00H, the record length: 256 bytes. |
| 6549H-6550H 8 bytes | DEFM "DIR " 6549H-6550H, DIR/SYS +05H-+0CH: the name DIR, padded with spaces to 8 bytes. |
| 6551H-6553H 3 bytes | DEFM "SYS" 6551H-6553H, DIR/SYS +0DH-+0FH: the extension SYS. |
| 6554H-6555H 2 bytes | DEFW 01AEH 6554H-6555H, DIR/SYS +10H-+11H: 01AEH, the hash of the file's password, the same as BOOT/SYS. |
| 6556H-6557H 2 bytes | DEFW 4296H 6556H-6557H, DIR/SYS +12H-+13H: 4296H, the hash of eight spaces. DATECONV/CMD treats a record with 4296H here as one without a date stamp. |
| 6558H-6559H 2 bytes | DEFW 000AH 6558H-6559H, DIR/SYS +14H-+15H: the ending record number, 000AH in the file; 63BEH stores the sectors of the directory cylinder (at most 34) in the low byte. |
| 655AH 1 byte | DEFB 11H 655AH, DIR/SYS +16H: the cylinder of the first extent, 11H (17) in the file; 62A8H and 63D1H store the directory cylinder. |
| 655BH 1 byte | DEFB 01H 655BH, DIR/SYS +17H: the first extent's first granule (bits 7-5) and granules less one (bits 4-0), 01H in the file; 63CBH stores granule 0 and the granules of the cylinder less one. |
| 655CH-6561H 6 bytes | DEFB FFH x 6 655CH-6561H, DIR/SYS +18H-+1DH: the three other extents, FFH (no extent). |
| 6562H 1 byte | DEFB FFH 6562H, DIR/SYS +1EH: FFH, no link to an extension record. |
| 6563H 1 byte | DEFB FFH 6563H, DIR/SYS +1FH: FFH, the number of an extension record, none. |
| 6564H-656DH 10 bytes | DEFS 10 6564H-656DH: not in the file. The working copy of the target drive's drive code table: the front end copies the drive's table here (6EC9H) and changes it for the format chosen; the engine reaches the driver through it (6495H). |
| 656EH 1 byte | DEFB 03H 656EH: the bootstrap step rate, 0-3: 03H in the file, the value the front end chooses stored by 70B9H; 62B4H and 62E1H put it into the two boot sectors. |
| 656FH-6570H 2 bytes | DEFS 2 656FH-6570H: not in the file. 656FH the sectors on a cylinder (6023H, 6238H), 6570H the sectors on a track (6018H); 61BBH-61C7H keep both across the second pass over cylinder 0. |
| 6571H-6576H 6 bytes | DEFW 6589H, 2409H, 0D35H 6571H-6576H: 5 inch single density. Template 6589H; +07H 09H (10 sectors on a track, one head), +08H 24H (2 granules on a track, 5 sectors to a granule); 0D35H (3381) bytes of memory, 20 more than the 3105 bytes of the track and the 256 bytes of FFH after it. |
| 6577H-657CH 6 bytes | DEFW 65C9H, 4511H, 196AH 6577H-657CH: 5 inch double density. Template 65C9H; +07H 11H (18 sectors on a track), +08H 45H (3 granules on a track, 6 sectors to a granule); 196AH (6506) bytes of memory, 84 fewer than the 6334 bytes of the track and the 256 bytes of FFH after it (19BEH) that 6013H writes. |
| 657DH-6582H 6 bytes | DEFW 6623H, 270FH, 1558H 657DH-6582H: 8 inch single density. Template 6623H; +07H 0FH (16 sectors on a track), +08H 27H (2 granules on a track, 8 sectors to a granule); 1558H (5464) bytes of memory, 32 more than the 5176 bytes of the track and the 256 bytes of FFH. |
| 6583H-6588H 6 bytes | DEFW 6668H, 491DH, 29B1H 6583H-6588H: 8 inch double density. Template 6668H; +07H 1DH (30 sectors on a track), +08H 49H (3 granules on a track, 10 sectors to a granule); 29B1H (10673) bytes of memory, 60 more than the 10357 bytes of the track and the 256 bytes of FFH. |
| 6589H 1 byte | DEFB 0AH 6589H, template +00H: 0AH, 10 sectors on a track (6016H). |
| 658AH 1 byte | DEFB 07H 658AH, template +01H: 07H, the skew: each cylinder starts the order of the sectors 7 places further on (6026H). |
| 658BH-6594H 10 bytes | DEFB 00H, 05H, 01H, 06H, 02H, 07H, 03H, 08H, 04H, 09H 658BH-6594H: the order of the sectors on the track, with an interleave of 2: each sector number lies two places after the one before. |
| 6595H-659CH 8 bytes | DEFB F6H x 8 6595H-659CH: F6H (minus 10) eight times, the skew plus 1: a pointer that runs past the last sector number moves back 10 places (60C2H-60CBH). |
| 659DH-659EH 2 bytes | DEFB 0EH, FFH 659DH-659EH: 14 bytes of FFH, the gap at the start of the track after the index pulse. |
| 659FH 1 byte | DEFB F1H 659FH: F1H, the start of the part built once for each of the 10 sectors. |
| 65A0H-65A1H 2 bytes | DEFB 06H, 00H 65A0H-65A1H: 6 bytes of 00H before the ID field. |
| 65A2H-65A3H 2 bytes | DEFB 01H, FEH 65A2H-65A3H: 1 byte FEH, the ID address mark. |
| 65A4H 1 byte | DEFB F3H 65A4H: F3H, the address of the next byte of the track goes into the table at 6D00H: the ID field's cylinder byte. |
| 65A5H-65A6H 2 bytes | DEFB 03H, 00H 65A5H-65A6H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 65A7H-65A8H 2 bytes | DEFB 01H, 01H 65A7H-65A8H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 65A9H-65AAH 2 bytes | DEFB 01H, F7H 65A9H-65AAH: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 65ABH-65ACH 2 bytes | DEFB 01H, FFH 65ABH-65ACH: 1 byte FFH, the start of the gap after the ID field. |
| 65ADH-65AEH 2 bytes | DEFB 0BH, FFH 65ADH-65AEH: 11 bytes of FFH, the rest of the gap after the ID field. |
| 65AFH-65B0H 2 bytes | DEFB 06H, 00H 65AFH-65B0H: 6 bytes of 00H before the data field. |
| 65B1H-65B2H 2 bytes | DEFB 01H, FBH 65B1H-65B2H: 1 byte FBH, the data address mark. |
| 65B3H-65B4H 2 bytes | DEFB 00H, E5H 65B3H-65B4H: 256 bytes of E5H (a count of 00H), the data of the sector. |
| 65B5H-65B6H 2 bytes | DEFB 01H, F7H 65B5H-65B6H: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 65B7H-65B8H 2 bytes | DEFB 01H, FFH 65B7H-65B8H: 1 byte FFH, the start of the gap after the data field. |
| 65B9H-65BAH 2 bytes | DEFB 0DH, FFH 65B9H-65BAH: 13 bytes of FFH, the rest of the gap after the data field. |
| 65BBH 1 byte | DEFB F2H 65BBH: F2H, the end of the part built for each sector. |
| 65BCH-65BDH 2 bytes | DEFB 47H, FFH 65BCH-65BDH: 71 bytes of FFH, the gap at the end of the track. |
| 65BEH 1 byte | DEFB F4H 65BEH: F4H, the end of the template; 6085H finishes the track there. |
| 65BFH-65C8H 10 bytes | DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H 65BFH-65C8H: the sectors in the order the verify pass reads them (6155H): every second sector around the track, positions 0, 2, 4 and so on, then 1, 3, 5 and so on, so each read has the time of one sector before the next. |
| 65C9H 1 byte | DEFB 12H 65C9H, template +00H: 12H, 18 sectors on a track (6016H). |
| 65CAH 1 byte | DEFB 0DH 65CAH, template +01H: 0DH, the skew: each cylinder starts the order of the sectors 13 places further on (6026H). |
| 65CBH-65DCH 18 bytes | DEFB 00H, 06H, 0CH, 01H, 07H, 0DH, 02H, 08H, 0EH, 03H, 09H, 0FH, 04H, 0AH, 10H, 05H, 0BH, 11H 65CBH-65DCH: the order of the 18 sectors on the track (an interleave of 3). |
| 65DDH-65EAH 14 bytes | DEFB EEH x 14 65DDH-65EAH: EEH (minus 18) fourteen times, the skew plus 1: a pointer that runs past the last sector number moves back 18 places (60C2H-60CBH). |
| 65EBH-65ECH 2 bytes | DEFB 20H, 4EH 65EBH-65ECH: 32 bytes of 4EH, the gap at the start of the track. |
| 65EDH 1 byte | DEFB F1H 65EDH: F1H, the start of the part built once for each of the 18 sectors. |
| 65EEH-65EFH 2 bytes | DEFB 0CH, 00H 65EEH-65EFH: 12 bytes of 00H before the ID field. |
| 65F0H-65F1H 2 bytes | DEFB 03H, F5H 65F0H-65F1H: 3 bytes F5H: the controller writes the sync byte A1H with a missing clock bit before the address mark. |
| 65F2H-65F3H 2 bytes | DEFB 01H, FEH 65F2H-65F3H: 1 byte FEH, the ID address mark. |
| 65F4H 1 byte | DEFB F3H 65F4H: F3H, the address of the next byte of the track goes into the table at 6D00H: the ID field's cylinder byte. |
| 65F5H-65F6H 2 bytes | DEFB 03H, 00H 65F5H-65F6H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 65F7H-65F8H 2 bytes | DEFB 01H, 01H 65F7H-65F8H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 65F9H-65FAH 2 bytes | DEFB 01H, F7H 65F9H-65FAH: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 65FBH-65FCH 2 bytes | DEFB 16H, 4EH 65FBH-65FCH: 22 bytes of 4EH, the gap after the ID field. |
| 65FDH-65FEH 2 bytes | DEFB 0CH, 00H 65FDH-65FEH: 12 bytes of 00H before the data field. |
| 65FFH-6600H 2 bytes | DEFB 03H, F5H 65FFH-6600H: 3 bytes F5H, the sync bytes A1H before the data address mark. |
| 6601H-6602H 2 bytes | DEFB 01H, FBH 6601H-6602H: 1 byte FBH, the data address mark. |
| 6603H-6606H 4 bytes | DEFB F5H, 80H, 6DH, B6H 6603H-6606H: F5H: the pair after the count is put that many times, 80H (128) pairs 6DH B6H, the 256 bytes of the sector's data. |
| 6607H-6608H 2 bytes | DEFB 01H, F7H 6607H-6608H: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 6609H-660AH 2 bytes | DEFB 01H, 4EH 6609H-660AH: 1 byte 4EH, the start of the gap after the data field. |
| 660BH-660CH 2 bytes | DEFB 17H, 4EH 660BH-660CH: 23 bytes of 4EH, the rest of the gap after the data field. |
| 660DH 1 byte | DEFB F2H 660DH: F2H, the end of the part built for each sector. |
| 660EH-660FH 2 bytes | DEFB B6H, 4EH 660EH-660FH: 182 bytes of 4EH, the gap at the end of the track. |
| 6610H 1 byte | DEFB F4H 6610H: F4H, the end of the template; 6085H finishes the track there. |
| 6611H-6622H 18 bytes | DEFB 00H, 0CH, 07H, 02H, 0EH, 09H, 04H, 10H, 0BH, 06H, 01H, 0DH, 08H, 03H, 0FH, 0AH, 05H, 11H 6611H-6622H: the sectors in the order the verify pass reads them (6155H): every second sector around the track, positions 0, 2, 4 and so on, then 1, 3, 5 and so on, so each read has the time of one sector before the next. |
| 6623H 1 byte | DEFB 10H 6623H, template +00H: 10H, 16 sectors on a track (6016H). |
| 6624H 1 byte | DEFB 02H 6624H, template +01H: 02H, the skew: each cylinder starts the order of the sectors 2 places further on (6026H). |
| 6625H-6634H 16 bytes | DEFB 0AH, 05H, 00H, 0BH, 06H, 01H, 0CH, 07H, 02H, 0DH, 08H, 03H, 0EH, 09H, 04H, 0FH 6625H-6634H: the order of the 16 sectors on the track (an interleave of 3). |
| 6635H-6637H 3 bytes | DEFB F0H x 3 6635H-6637H: F0H (minus 16) three times, the skew plus 1: a pointer that runs past the last sector number moves back 16 places (60C2H-60CBH). |
| 6638H-6639H 2 bytes | DEFB 28H, FFH 6638H-6639H: 40 bytes of FFH, the gap at the start of the track. |
| 663AH 1 byte | DEFB F1H 663AH: F1H, the start of the part built once for each of the 16 sectors. |
| 663BH-663CH 2 bytes | DEFB 06H, 00H 663BH-663CH: 6 bytes of 00H before the ID field. |
| 663DH-663EH 2 bytes | DEFB 01H, FEH 663DH-663EH: 1 byte FEH, the ID address mark. |
| 663FH 1 byte | DEFB F3H 663FH: F3H, the address of the next byte of the track goes into the table at 6D00H: the ID field's cylinder byte. |
| 6640H-6641H 2 bytes | DEFB 03H, 00H 6640H-6641H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 6642H-6643H 2 bytes | DEFB 01H, 01H 6642H-6643H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 6644H-6645H 2 bytes | DEFB 01H, F7H 6644H-6645H: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 6646H-6647H 2 bytes | DEFB 0BH, FFH 6646H-6647H: 11 bytes of FFH, the gap after the ID field. |
| 6648H-6649H 2 bytes | DEFB 06H, 00H 6648H-6649H: 6 bytes of 00H before the data field. |
| 664AH-664BH 2 bytes | DEFB 01H, FBH 664AH-664BH: 1 byte FBH, the data address mark. |
| 664CH-664DH 2 bytes | DEFB 00H, E5H 664CH-664DH: 256 bytes of E5H (a count of 00H), the data of the sector. |
| 664EH-664FH 2 bytes | DEFB 01H, F7H 664EH-664FH: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 6650H-6651H 2 bytes | DEFB 01H, FFH 6650H-6651H: 1 byte FFH, the start of the gap after the data field. |
| 6652H-6653H 2 bytes | DEFB 14H, FFH 6652H-6653H: 20 bytes of FFH, the rest of the gap after the data field. |
| 6654H 1 byte | DEFB F2H 6654H: F2H, the end of the part built for each sector. |
| 6655H-6656H 2 bytes | DEFB D0H, FFH 6655H-6656H: 208 bytes of FFH, the gap at the end of the track. |
| 6657H 1 byte | DEFB F4H 6657H: F4H, the end of the template; 6085H finishes the track there. |
| 6658H-6667H 16 bytes | DEFB 0AH, 00H, 06H, 0CH, 02H, 08H, 0EH, 04H, 05H, 0BH, 01H, 07H, 0DH, 03H, 09H, 0FH 6658H-6667H: the sectors in the order the verify pass reads them (6155H): every second sector around the track, positions 0, 2, 4 and so on, then 1, 3, 5 and so on, so each read has the time of one sector before the next. |
| 6668H 1 byte | DEFB 1EH 6668H, template +00H: 1EH, 30 sectors on a track (6016H). |
| 6669H 1 byte | DEFB 03H 6669H, template +01H: 03H, the skew: each cylinder starts the order of the sectors 3 places further on (6026H). |
| 666AH-6687H 30 bytes | DEFB 00H, 06H, 0CH, 12H, 18H, 01H, 07H, 0DH, 13H, 19H, 02H, 08H, 0EH, 14H, 1AH, 03H, 09H, 0FH, 15H, 1BH, 04H, 0AH, 10H, 16H, 1CH, 05H, 0BH, 11H, 17H, 1DH 666AH-6687H: the order of the 30 sectors on the track (an interleave of 5). |
| 6688H-668BH 4 bytes | DEFB E2H x 4 6688H-668BH: E2H (minus 30) four times, the skew plus 1: a pointer that runs past the last sector number moves back 30 places (60C2H-60CBH). |
| 668CH-668DH 2 bytes | DEFB 14H, 4EH 668CH-668DH: 20 bytes of 4EH, the gap at the start of the track. |
| 668EH 1 byte | DEFB F1H 668EH: F1H, the start of the part built once for each of the 30 sectors. |
| 668FH-6690H 2 bytes | DEFB 0CH, 00H 668FH-6690H: 12 bytes of 00H before the ID field. |
| 6691H-6692H 2 bytes | DEFB 03H, F5H 6691H-6692H: 3 bytes F5H: the controller writes the sync byte A1H with a missing clock bit before the address mark. |
| 6693H-6694H 2 bytes | DEFB 01H, FEH 6693H-6694H: 1 byte FEH, the ID address mark. |
| 6695H 1 byte | DEFB F3H 6695H: F3H, the address of the next byte of the track goes into the table at 6D00H: the ID field's cylinder byte. |
| 6696H-6697H 2 bytes | DEFB 03H, 00H 6696H-6697H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 6698H-6699H 2 bytes | DEFB 01H, 01H 6698H-6699H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 669AH-669BH 2 bytes | DEFB 01H, F7H 669AH-669BH: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 669CH-669DH 2 bytes | DEFB 16H, 4EH 669CH-669DH: 22 bytes of 4EH, the gap after the ID field. |
| 669EH-669FH 2 bytes | DEFB 0CH, 00H 669EH-669FH: 12 bytes of 00H before the data field. |
| 66A0H-66A1H 2 bytes | DEFB 03H, F5H 66A0H-66A1H: 3 bytes F5H, the sync bytes A1H before the data address mark. |
| 66A2H-66A3H 2 bytes | DEFB 01H, FBH 66A2H-66A3H: 1 byte FBH, the data address mark. |
| 66A4H-66A7H 4 bytes | DEFB F5H, 80H, 6DH, B6H 66A4H-66A7H: F5H: the pair after the count is put that many times, 80H (128) pairs 6DH B6H, the 256 bytes of the sector's data. |
| 66A8H-66A9H 2 bytes | DEFB 01H, F7H 66A8H-66A9H: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 66AAH-66ABH 2 bytes | DEFB 01H, FFH 66AAH-66ABH: 1 byte FFH after the data field's CRC (the other templates of double density put 4EH here). |
| 66ACH-66ADH 2 bytes | DEFB 11H, 4EH 66ACH-66ADH: 17 bytes of 4EH, the gap after the data field. |
| 66AEH 1 byte | DEFB F2H 66AEH: F2H, the end of the part built for each sector. |
| 66AFH-66B0H 2 bytes | DEFB 00H, 4EH 66AFH-66B0H: 256 bytes of 4EH (a count of 00H), the first part of the gap at the end of the track. |
| 66B1H-66B2H 2 bytes | DEFB 3DH, 4EH 66B1H-66B2H: 61 bytes of 4EH, the rest of the gap at the end of the track. |
| 66B3H 1 byte | DEFB F4H 66B3H: F4H, the end of the template; 6085H finishes the track there. |
| 66B4H-66D1H 30 bytes | DEFB 00H, 0CH, 18H, 07H, 13H, 02H, 0EH, 1AH, 09H, 15H, 04H, 10H, 1CH, 0BH, 17H, 06H, 12H, 01H, 0DH, 19H, 08H, 14H, 03H, 0FH, 1BH, 0AH, 16H, 05H, 11H, 1DH 66B4H-66D1H: the sectors in the order the verify pass reads them (6155H): every second sector around the track, positions 0, 2, 4 and so on, then 1, 3, 5 and so on, so each read has the time of one sector before the next. |
| 66D2H 1 byte | DEFB 1DH 66D2H: 1DH, the cursor to the start of its line: the start of the text of 6095H. |
| 66D3H-66E8H 22 bytes | DEFM "Formatting cylinder " 66D3H-66E8H: Formatting cylinder and three spaces; 64E9H writes the cylinder number over the last two. |
| 66E9H 1 byte | DEFB 03H 66E9H: 03H, the end of the text: the cursor stays after the spaces. |
| 66EAH 1 byte | DEFB 1DH 66EAH: 1DH, the cursor to the start of its line: the start of the text of 6136H. |
| 66EBH-6700H 22 bytes | DEFM "Verifying cylinder " 66EBH-6700H: Verifying, two spaces, cylinder and three spaces, as long as the text above; 64E9H writes the cylinder number over the last two. |
| 6701H 1 byte | DEFB 03H 6701H: 03H, the end of the text: the cursor stays after the spaces. |
| 6702H-6705H 4 bytes | DEFM "* " 6702H-6705H: an asterisk and three spaces, displayed after the number of a cylinder that failed the verify (61EDH). |
| 6706H 1 byte | DEFB 03H 6706H: 03H, the end of the text: the next cylinder number goes two places before its end. |
| 6707H-6713H 13 bytes | DEFM "Formatting..." 6707H-6713H: Formatting..., displayed before the driver's function 0CH (6215H). |
| 6714H 1 byte | DEFB 0DH 6714H: 0DH, the end of the line and of the text. |
| 6715H-6739H 37 bytes | DEFM "No cylinders available for directory!" 6715H-6739H: the text 627EH points to when no cylinder can take the directory; the JP 6434H after it displays Format aborted! instead. |
| 673AH 1 byte | DEFB 0DH 673AH: 0DH, the end of the line and of the text. |
| 673BH-675FH 37 bytes | DEFM "Directory will be placed on cylinder " 673BH-675FH: Directory will be placed on cylinder and a space, displayed by 6292H. |
| 6760H-6761H 2 bytes | DEFM "00" 6760H-6761H: two digits, 00 in the file: 628EH stores the directory cylinder here. |
| 6762H 1 byte | DEFB 0DH 6762H: 0DH, the end of the line and of the text. |
| 676FH 1 byte | DEFB 0AH 676FH: 0AH, a new line: the start of the text of 6197H. |
| 6770H-6784H 21 bytes | DEFM " Re-format track 0..." 6770H-6784H: a space and Re-format track 0..., displayed before the second pass over cylinder 0 in single density. |
| 6785H 1 byte | DEFB 0DH 6785H: 0DH, the end of the line and of the text. |
| 6786H 1 byte | DEFB 0AH 6786H: 0AH, a new line: the start of the text of 6298H. |
| 6787H-67A6H 32 bytes | DEFM "Initializing SYSTEM information " 6787H-67A6H: Initializing SYSTEM information and a space; the periods and plus signs of the sectors written follow on the line. |
| 67A7H 1 byte | DEFB 03H 67A7H: 03H, the end of the text: the cursor stays at its end. |
| 67A8H 1 byte | DEFB 0AH 67A8H: 0AH, a new line: the start of the text of 6451H. |
| 67A9H-67CCH 36 bytes | DEFM "Load SYSTEM diskette and hit <ENTER>" 67A9H-67CCH: Load SYSTEM diskette and hit <ENTER>, displayed after a format of drive 0. |
| 67CDH 1 byte | DEFB 0DH 67CDH: 0DH, the end of the line and of the text. |
| 67CEH 1 byte | DEFB 0AH 67CEH: 0AH, a new line: the start of the text of 641DH. |
| 67CFH-67E1H 19 bytes | DEFM "Formatting complete" 67CFH-67E1H: Formatting complete, displayed and written to the job log by @LOGOT at the end. |
| 67E2H 1 byte | DEFB 0DH 67E2H: 0DH, the end of the line and of the text. |
| 67E3H 1 byte | DEFB 0AH 67E3H: 0AH, a new line: the start of the text of 6423H. |
| 67E4H-680AH 39 bytes | DEFM "Note: Realtime clock no longer accurate" 67E4H-680AH: Note: Realtime clock no longer accurate, since the clock interrupt was shut out while the tracks were written. |
| 680BH 1 byte | DEFB 0DH 680BH: 0DH, the end of the line and of the text. |
| 680CH-681AH 15 bytes | DEFM "Format aborted!" 680CH-681AH: Format aborted!, the text of 6434H, displayed and written to the job log. |
| 681BH 1 byte | DEFB 0DH 681BH: 0DH, the end of the line and of the text. |
| 681CH-6839H 30 bytes | DEFM "Can't, Diskette not formatted!" 681CH-6839H: the text of 62C6H, for a diskette whose cylinder 0, sector 0 cannot be read when only the system information is to be written. |
| 683AH 1 byte | DEFB 0DH 683AH: 0DH, the end of the line and of the text. |
| 683BH-685AH 32 bytes | DEFB 00H x 32 683BH-685AH: 32 bytes of 00H at the end of the block. No code addresses them. |
| 685BH-68FFH 165 bytes | DEFS 165 685BH-68FFH: not in the file, and no code of FORMAT uses it. |
| 6900H-6901H 2 bytes | DEFW 6BBCH 6900H-6901H: 6BBCH, the Seek command byte of boot sector 0's image (42BCH when it runs), read by 62B8H. |
| 6902H-6903H 2 bytes | DEFW 6C10H 6902H-6903H: 6C10H, the step rate byte of boot sector 1's image (4210H when it runs), read by 62E5H. |
| 6904H-69FFH 252 bytes | DEFS 252 6904H-69FFH: not in the file, and no code of FORMAT uses it. |
| 6A00H-6ACAH 203 bytes | DEFS 203 6A00H-6ACAH: not in the file. The allocation table image, +00H-+CAH: 6A00H-6A5FH one byte for each cylinder, a bit set for each granule not free (the front end fills it, 70E6H; the verify sets FFH for a bad cylinder, 61F7H); 6A60H-6ABFH the lock out table (61DAH copies the allocation bytes there); 6AC0H-6ACAH what memory holds. |
| 6ACBH 1 byte | DEFB 53H 6ACBH, the allocation table +CBH: 53H, written to the diskette as it is. |
| 6ACCH 1 byte | DEFB 00H 6ACCH, +CCH: the number of cylinders less 35, 00H in the file, stored by 6315H. |
| 6ACDH 1 byte | DEFB 00H 6ACDH, +CDH: the configuration byte, 00H in the file, stored by 6335H (bit 7 and bit 3 always, bit 6 double density, bit 5 two sides, bit 4 cylinder 0 single density, bits 2-0 the granules on a track less one). |
| 6ACEH-6ACFH 2 bytes | DEFW 0000H 6ACEH-6ACFH, +CEH-+CFH: the hash of the master password, 0000H in the file, stored by the front end (6F6CH). |
| 6AD0H-6AD7H 8 bytes | DEFM " " 6AD0H-6AD7H, +D0H-+D7H: the diskette name, eight spaces in the file, stored by the front end (6EEAH, 6F14H). |
| 6AD8H-6ADFH 8 bytes | DEFM "MM/DD/YY" 6AD8H-6ADFH, +D8H-+DFH: the date the diskette is formatted, MM/DD/YY in the file, stored by the front end (6F19H). |
| 6AE0H 1 byte | DEFB 0DH 6AE0H, +E0H: 0DH, the AUTO command of the diskette: none. |
| 6AE1H-6AFFH 31 bytes | DEFM " " 6AE1H-6AFFH, +E1H-+FFH: 31 spaces, the rest of the AUTO command field. |
| 6BE4H-6BE6H 3 bytes | DEFB 1CH, 1FH, 03H The text displayed by 420EH at the start: 1CH moves the cursor to the top left, 1FH clears to the end of the screen, 03H ends the text. |
| 6BE7H-6BE8H 2 bytes | DEFB 17H, E8H Start of the No System text (422CH): 17H switches the screen to 32 characters per line, E8H displays 40 spaces (E8H less C0H), which puts the message on the second line, 8 columns in. |
| 6BE9H-6BF1H 9 bytes | DEFM "No System" The message displayed when the directory record of SYS0/SYS is not in use (4224H-422CH). |
| 6BF2H 1 byte | DEFB 03H End of the No System text: 429EH stops at this byte and does not display it. |
| 6BF3H-6BF4H 2 bytes | DEFB 17H, E8H Start of the Disk Error text (4294H): 17H switches the screen to 32 characters per line, E8H displays 40 spaces, which puts the message on the second line, 8 columns in. |
| 6BF5H-6BFEH 10 bytes | DEFM "Disk Error" The message displayed when a sector cannot be read in two tries (4222H, 4286H). |
| 6BFFH 1 byte | DEFB 03H End of the Disk Error text, and the last byte of sector 0. |
| 6CE6H-6CE7H 2 bytes | DEFB 17H, E8H Start of the No System text (424AH): 17H switches the screen to 32 characters per line, E8H displays 40 spaces (E8H less C0H), which puts the message on the second line, 8 columns in. |
| 6CE8H-6CF0H 9 bytes | DEFM "No System" The message displayed when the directory record of SYS0/SYS is not in use (4245H-424AH). |
| 6CF1H 1 byte | DEFB 03H End of the No System text: 42BDH stops at this byte and does not display it. |
| 6CF2H-6CF3H 2 bytes | DEFB 17H, E8H Start of the Disk Error text (42B3H): 32 characters per line, then 40 spaces. |
| 6CF4H-6CFDH 10 bytes | DEFM "Disk Error" The message displayed when the driver cannot read a sector of SYS0/SYS (42A5H). |
| 6CFEH 1 byte | DEFB 03H End of the Disk Error text: 42BDH stops at this byte and does not display it. |
| 6CFFH 1 byte | DEFB FFH The last byte of sector 1, FFH. No code of this sector uses it. |
| 6D00H-6DFFH 256 bytes | DEFS 256 6D00H-6DFFH: not in the file. While a track is built, the address of each sector's ID field in the track (6039H, 607DH), ended by 0000H; the replies to the questions (64CBH, 6E82H); the sector read from the target diskette (716FH-71BBH); then the sectors FORMAT writes: the system information sector, the hash index table, the directory records and the empty directory sectors (634BH-6418H). |
| 7265H-726EH 10 bytes | DEFS 10 7265H-726EH: not in the file. The copy of the working drive code table taken at 7123H and put back at 71E6H. |
| 726FH-7276H 8 bytes | DEFS 8 726FH-7276H: not in the file. The highest cylinder of drives 0-7 from the system information sector (6E35H); 6EC1H takes the target drive's. |
| 727DH-7284H 8 bytes | DEFM " " 727DH-7284H: the master password, eight spaces in the file: filled from the command line, the reply or PASSWORD (6F2CH-6F63H), then checked and hashed (7201H). |
| 7285H 1 byte | DEFB 20H 7285H: a space after the buffer. The ROM's line input puts its 0DH here after a reply of 8 characters (6F4EH). |
| 7286H-72A6H 33 bytes | DEFM "Can only SYSTEM a 5" / DEFB 22H / DEFM " DDEN floppy!" 7286H-72A6H: the text of 722CH, for SYSTEM with a format other than 5 inch double density. |
| 72A7H 1 byte | DEFB 0DH 72A7H: 0DH, the end of the line and of the text. |
| 72A8H-72AFH 8 bytes | DEFM "NAME " / DEFW 6EDCH 72A8H-72AFH: NAME, the diskette name: the operand of LD HL,0000H at 6EDBH. |
| 72B0H-72B7H 8 bytes | DEFM "N " / DEFW 6EDCH 72B0H-72B7H: N, the short form of NAME: 6EDCH. |
| 72B8H-72BFH 8 bytes | DEFM "MPW " / DEFW 6F1FH 72B8H-72BFH: MPW, the master password: the operand of LD HL,0000H at 6F1EH. |
| 72C0H-72C7H 8 bytes | DEFM "M " / DEFW 6F1FH 72C0H-72C7H: M, the short form of MPW: 6F1FH. |
| 72C8H-72CFH 8 bytes | DEFM "SDEN " / DEFW 6E5FH 72C8H-72CFH: SDEN, single density: the operand of LD DE,0000H at 6E5EH. |
| 72D0H-72D7H 8 bytes | DEFM "DDEN " / DEFW 6E64H 72D0H-72D7H: DDEN, double density: the operand of LD DE,0000H at 6E63H. |
| 72D8H-72DFH 8 bytes | DEFM "SIDES " / DEFW 6E69H 72D8H-72DFH: SIDES=n, the sides: the operand of LD DE,0000H at 6E68H. |
| 72E0H-72E7H 8 bytes | DEFM "CYL " / DEFW 6E6EH 72E0H-72E7H: CYL=n, the cylinders: the operand of LD DE,0000H at 6E6DH. |
| 72E8H-72EFH 8 bytes | DEFM "C " / DEFW 6E6EH 72E8H-72EFH: C, the short form of CYL: 6E6EH. |
| 72F0H-72F7H 8 bytes | DEFM "STEP " / DEFW 6E73H 72F0H-72F7H: STEP=n, the bootstrap step rate: the operand of LD DE,FF00H at 6E72H. |
| 72F8H-72FFH 8 bytes | DEFM "ABS " / DEFW 71C4H 72F8H-72FFH: ABS, no question for a diskette that holds data: the operand of LD DE,0000H at 71C3H. |
| 7300H-7307H 8 bytes | DEFM "A " / DEFW 71C4H 7300H-7307H: A, the short form of ABS: 71C4H. |
| 7308H-730FH 8 bytes | DEFM "QUERY " / DEFW 6FACH 7308H-730FH: QUERY, ask the questions (FFFFH) or not (0000H): the operand of LD DE,FFFFH at 6FABH. |
| 7310H-7317H 8 bytes | DEFM "Q " / DEFW 6FACH 7310H-7317H: Q, the short form of QUERY: 6FACH. |
| 7318H-731FH 8 bytes | DEFM "SYSTEM" / DEFW 620FH 7318H-731FH: SYSTEM, cylinder 0 in single density on a double density diskette, or only the system information: the operand of LD HL,0000H at 620EH. |
| 7320H-7327H 8 bytes | DEFM "WAIT " / DEFW 6126H 7320H-7327H: WAIT=n, a wait after each step: the operand of LD BC,0000H at 6125H. |
| 7328H-732FH 8 bytes | DEFM "W " / DEFW 6126H 7328H-732FH: W, the short form of WAIT: 6126H. |
| 7330H-7337H 8 bytes | DEFM "DIR " / DEFW 6256H 7330H-7337H: DIR=n, the cylinder of the directory: the operand of LD BC,0000H at 6255H. |
| 7338H-733FH 8 bytes | DEFM "D " / DEFW 6256H 7338H-733FH: D, the short form of DIR: 6256H. |
| 7340H 1 byte | DEFB 00H 7340H: 00H, the end of the table: @PARAM stops here. |
| 7341H-7342H 2 bytes | DEFB 1CH, 1FH 7341H-7342H: 1CH, the cursor to the top left, and 1FH, clear to the end of the screen: the start of the banner (6E01H). |
| 7343H-7376H 52 bytes | DEFM "FORMAT - LDOS Disk Formatter Program - Version 5.3.1" 7343H-7376H: the name and the version of the program. |
| 7377H 1 byte | DEFB 0AH 7377H: 0AH, a new line: the copyright goes on the next line. |
| 7378H-73A8H 49 bytes | DEFM "Copyright 1991 MISOSYS, Inc., All rights reserved" 7378H-73A8H: the copyright line of the program, Copyright 1991 MISOSYS, Inc. |
| 73A9H-73AAH 2 bytes | DEFB 0AH, 0DH 73A9H-73AAH: 0AH, a new line, and 0DH, the end of the banner. |
| 73ABH-73D3H 41 bytes | DEFM "Insufficient memory for specified format!" 73ABH-73D3H: the text of 7161H, when HIGH$ leaves no room for the track. |
| 73D4H 1 byte | DEFB 0DH 73D4H: 0DH, the end of the line and of the text. |
| 73D5H-73F0H 28 bytes | DEFM "Which drive is to be used ? " 73D5H-73F0H: the question of 6E7CH, when no :d is on the command line. |
| 73F1H 1 byte | DEFB 03H 73F1H: 03H, the end of the question: the cursor stays for the reply. |
| 73F2H-7401H 16 bytes | DEFM "Diskette name ? " 73F2H-7401H: the question of 6F05H, for the diskette name. |
| 7402H 1 byte | DEFB 03H 7402H: 03H, the end of the question: the cursor stays for the reply. |
| 7403H-7414H 18 bytes | DEFM "Master password ? " 7403H-7414H: the question of 6F43H, for the master password. |
| 7415H 1 byte | DEFB 03H 7415H: 03H, the end of the question: the cursor stays for the reply. |
| 7416H-743BH 38 bytes | DEFM "Special non-standard format desired ? " 7416H-743BH: a question that no code of the file displays. |
| 743CH 1 byte | DEFB 03H 743CH: 03H, the end of the question that no code displays. |
| 743DH-7452H 22 bytes | DEFM "Number of cylinders ? " 743DH-7452H: the question of 7024H, for a 5 inch floppy. |
| 7453H 1 byte | DEFB 03H 7453H: 03H, the end of the question: the cursor stays for the reply. |
| 7454H-7487H 52 bytes | DEFM "Boot strap stepping rate <6, 12, 20, 30/40 msecs> ? " 7454H-7487H: the question of 705DH, for a 5 inch drive. |
| 7488H 1 byte | DEFB 03H 7488H: 03H, the end of the question: the cursor stays for the reply. |
| 7489H-74BAH 50 bytes | DEFM "Bootstrap stepping rate <3, 6, 10, 15/20 msecs> ? " 7489H-74BAH: the question of 7087H, for an 8 inch drive. |
| 74BBH 1 byte | DEFB 03H 74BBH: 03H, the end of the question: the cursor stays for the reply. |
| 74BCH-74D9H 30 bytes | DEFM "Enter number of sides <1,2> ? " 74BCH-74D9H: the question of 6FF9H, for the number of sides. |
| 74DAH 1 byte | DEFB 03H 74DAH: 03H, the end of the question: the cursor stays for the reply. |
| 74DBH-74FBH 33 bytes | DEFM "Single or Double density <S,D> ? " 74DBH-74FBH: the question of 6FBFH, for the density. |
| 74FCH 1 byte | DEFB 03H 74FCH: 03H, the end of the question: the cursor stays for the reply. |
| 74FDH-750CH 16 bytes | DEFM "Drive not ready!" 74FDH-750CH: the text of 7131H, when the controller's status shows NOT READY. |
| 750DH 1 byte | DEFB 0DH 750DH: 0DH, the end of the line and of the text. |
| 750EH-7522H 21 bytes | DEFM "Write protected disk!" 750EH-7522H: the text of 7146H, for a write protected diskette or drive. |
| 7523H 1 byte | DEFB 0DH 7523H: 0DH, the end of the line and of the text. |
| 7524H-7537H 20 bytes | DEFM "Drive not in system!" 7524H-7537H: the text of 7139H, when the head is not on track 0 after a Restore. |
| 7538H 1 byte | DEFB 0DH 7538H: 0DH, the end of the line and of the text. |
| 7539H-7561H 41 bytes | DEFM "Load destination diskette and hit <ENTER>" 7539H-7561H: the text of 7100H, for drive 0 and when no diskette turns. |
| 7562H 1 byte | DEFB 0DH 7562H: 0DH, the end of the line and of the text. |
| 7563H 1 byte | DEFB 0AH 7563H: 0AH, a new line: the start of the text of 7235H. |
| 7564H-757BH 24 bytes | DEFM "Invalid Master Password!" 7564H-757BH: the text of 7235H, for a password with other characters than letters and digits. |
| 757CH-757DH 2 bytes | DEFB 0AH, 0DH 757CH-757DH: 0AH, a new line, and 0DH, the end of the text. |
| 757EH-7593H 22 bytes | DEFM "Disk contains data -- " 757EH-7593H: the text of 717BH, followed on the line by one of the four texts below. |
| 7594H 1 byte | DEFB 03H 7594H: 03H, the end of the text: the cursor stays at its end. |
| 7595H-75A7H 19 bytes | DEFM "Non-standard format" 7595H-75A7H: the text of 7181H, for a diskette whose directory cylinder is not below the highest cylinder. |
| 75A8H 1 byte | DEFB 0DH 75A8H: 0DH, the end of the line and of the text. |
| 75A9H-75BCH 20 bytes | DEFM "Unreadable directory" 75A9H-75BCH: the text of 719BH, for a directory sector 0 without the deleted data mark. |
| 75BDH 1 byte | DEFB 0DH 75BDH: 0DH, the end of the line and of the text. |
| 75BEH-75D6H 25 bytes | DEFM "Non-initialized directory" 75BEH-75D6H: the text of 71A0H, for a directory whose date has no slash. |
| 75D7H 1 byte | DEFB 0DH 75D7H: 0DH, the end of the line and of the text. |
| 75D8H-75DCH 5 bytes | DEFM "Name=" 75D8H-75DCH: Name=, the start of the text of 71BDH. |
| 75DDH-75E4H 8 bytes | DEFM "XXXXXXXX" 75DDH-75E4H: eight X in the file; 71B3H copies the diskette's name here. |
| 75E5H-75EBH 7 bytes | DEFM " Date=" 75E5H-75EBH: two spaces and Date=, between the name and the date. |
| 75ECH-75F3H 8 bytes | DEFM "MM/DD/YY" 75ECH-75F3H: MM/DD/YY in the file; 71BBH copies the diskette's date here. |
| 75F4H 1 byte | DEFB 0DH 75F4H: 0DH, the end of the line and of the text. |
| 75F5H-761CH 40 bytes | DEFM "*** The target drive is a hard disk! ***" 75F5H-761CH: the first line of the text of 61FCH. |
| 761DH 1 byte | DEFB 0AH 761DH: 0AH, a new line between the two lines of the text. |
| 761EH-7642H 37 bytes | DEFM "Are you sure you want to format it ? " 761EH-7642H: the question of 61FCH and, on its own, of 71D1H. |
| 7643H 1 byte | DEFB 03H 7643H: 03H, the end of the question: the cursor stays for the reply. |
| 7644H-764BH 8 bytes | DEFM "LDOSDISK" 7644H-764BH: LDOSDISK, the default diskette name (6EE6H). The 1992 manual (M-40-060) gives DOSDISK. |
| 764CH-7653H 8 bytes | DEFM "PASSWORD" 764CH-7653H: PASSWORD, the default master password (6F29H). |
| 7654H-7673H 32 bytes | DEFB 00H x 32 7654H-7673H: 32 bytes of 00H at the end of the file. No code addresses them. |
Operands Changed While It Runs
| Address Size | Contents |
|---|---|
| 6014H-6015H 2 bytes | The operand of LD DE,0000H at 6013H: the address of the template (650EH). |
| 60A5H-60A6H 2 bytes | The operand of LD BC,0000H at 60A4H: the place in the order of the sectors where the next cylinder starts (602BH, 60D2H, 6103H). |
| 60FDH 1 byte | The operand of LD A,00H at 60FCH: the skew (6028H). |
| 610DH 1 byte | The opcode of JR Z,612EH: 18H (JR) for the second pass over cylinder 0 (61B1H). |
| 6126H-6127H 2 bytes | The operand of LD BC,0000H at 6125H: WAIT=n, stored by @PARAM. |
| 6156H-6157H 2 bytes | The operand of LD BC,0000H at 6155H: the list of the sectors in the order of the verify (6085H). |
| 615AH 1 byte | The operand of ADD A,00H at 6159H: 00H for side 0, the sectors on a track for side 1 (6152H, 6176H). |
| 6164H 1 byte | The operand of LD A,00H at 6163H: the sectors of the cylinder verified (614FH, 6166H). |
| 6184H-6185H 2 bytes | JR NZ,611EH; 18H 3EH (JR 61C4H) for the second pass over cylinder 0 (61B8H). |
| 61C5H-61C6H 2 bytes | The operand of LD HL,0000H at 61C4H: the sectors on a cylinder and on a track of the main format (61BEH). |
| 620FH-6210H 2 bytes | The operand of LD HL,0000H at 620EH: SYSTEM, FFFFH when given. |
| 6256H-6257H 2 bytes | The operand of LD BC,0000H at 6255H: DIR=n. |
| 6334H 1 byte | The operand of OR 00H at 6333H: 10H (cylinder 0 single density) after the SYSTEM pass (61ACH). |
| 63C2H 1 byte | The operand of LD A,00H at 63C1H: the granules on a track less one (632DH). |
| 6441H 1 byte | The operand of LD A,00H at 6440H: the byte of 4012H (600BH), 00H until the engine runs. |
| 648CH 1 byte | The operand of LD C,FFH at 648BH: the target drive (6E51H, 6E98H), FFH until it is known. |
| 6558H, 655AH, 655BH 1 byte each | The ending record number (63BEH), the cylinder (62A8H, 63D1H) and the granules (63CBH) of DIR/SYS's record. |
| 6760H-6761H 2 bytes | The two digits of the directory cylinder in the text at 673BH (628EH). |
| 6B02H, 6BBCH 1 byte each | Boot sector 0: the directory cylinder (62B1H) and the Seek command with the step rate (62BFH). |
| 6C02H, 6C10H 1 byte each | Boot sector 1: the directory cylinder (62DEH) and the step rate (62ECH). |
| 6E5FH-6E60H, 6E64H-6E65H 2 bytes each | The operands of LD DE,0000H at 6E5EH and 6E63H: SDEN and DDEN, FFFFH when given. |
| 6E69H-6E6AH, 6E6EH-6E6FH 2 bytes each | The operands of LD DE,0000H at 6E68H and 6E6DH: SIDES=n and CYL=n. |
| 6E73H-6E74H 2 bytes | The operand of LD DE,FF00H at 6E72H: STEP=n; 6E73H the default rate (6E29H), 6E74H FFH until STEP is given. |
| 6EDCH-6EDDH 2 bytes | The operand of LD HL,0000H at 6EDBH: NAME (@PARAM, or the QUERY value from 6EA6H). |
| 6F1FH-6F20H 2 bytes | The operand of LD HL,0000H at 6F1EH: MPW (@PARAM, or the QUERY value from 6EB1H). |
| 6FA7H 1 byte | The operand of LD A,00H at 6FA6H: not 0 when SDEN, DDEN, SIDES, CYL or STEP was given (6E77H). |
| 6FACH-6FADH 2 bytes | The operand of LD DE,FFFFH at 6FABH: QUERY, 0000H for Q=N. |
| 6FDAH-6FDBH, 6FEAH-6FEBH 2 bytes each | The operands of LD HL,0000H at 6FD9H and 6FE9H: the double and the single density descriptor of the drive's size (6F88H, 6F83H). |
| 7031H 1 byte | The operand of LD A,00H at 7030H: the default cylinders of the drive (6EC3H). |
| 7156H-7157H 2 bytes | The operand of LD DE,0000H at 7155H: the memory the track takes (651FH). |
| 71C4H-71C5H 2 bytes | The operand of LD DE,0000H at 71C3H: ABS, FFFFH when given. |
| 75DDH-75E4H, 75ECH-75F3H 8 bytes each | The name and the date of a diskette that holds data, in the text at 75D8H (71B3H, 71BBH). |
Memory Outside the File That FORMAT Uses
| Address Size | Contents |
|---|---|
| 6000H-6009H 10 bytes | After the format the first bytes of the engine hold a copy of the working table (618FH), with the directory cylinder at 6009H (6288H); 6302H copies it back. |
| 6564H-656DH 10 bytes | The working drive code table, Index Register IY: +00H-+02H the JP to the driver, +03H the flags (bits 1-0 step rate, bit 3 hard disk, bit 4 side 1, bit 5 8 inch, bit 6 double density, bit 7 write protect), +04H (bits 3-0 the select lines, bit 4 no track writing, bit 5 two sides, bit 6 the controller can do double density), +05H the cylinder the head is on, +06H the highest cylinder, +07H the highest sector and the heads less one, +08H the granules and the sectors of a granule less one, +09H the directory cylinder. |
| 656FH-6570H 2 bytes | The sectors on a cylinder and on a track of the format. |
| 6A00H-6ACAH 203 bytes | The allocation table image: 6A00H-6A5FH a byte for each cylinder (70E6H), FFH after the last; 6A60H-6ABFH the lock out table; 6AC0H-6ACAH FFH. |
| 6D00H-6DFFH 256 bytes | The address of each sector's ID field in the track (6039H), ended by 0000H; afterwards the buffer of the replies and of the sectors written (634BH-6418H) and read (7167H-71BBH). |
| 6E00H- up to 10673 bytes | The track built by 6013H, over the front end, and 256 bytes of FFH after it. |
| 7265H-726EH 10 bytes | The working table saved during the checks of the diskette (7123H, 71E6H). |
| 726FH-7276H 8 bytes | The highest cylinder of drives 0-7 from the system information sector (6E35H). |
Disassembly
6000H - The Format Engine: Entry
The front end ends with JP 6000H (71EBH) after it has put the drive code table of the target drive, with every choice made, into the working copy at 6564H-656DH and pointed Index Register IY at it. A drive whose table has bit 4 of +04H set gets no tracks written (61FCH). For every other drive the clock interrupt is shut out: the byte at 4012H, the JP of the interrupt vector, becomes a RET until 6440H puts it back.
6013H - Expand the Track Template
The template (one of four, 6589H-66D2H, chosen by 650AH) is a byte stream that describes one track: byte 0 the sectors on a track, byte 1 the skew from one cylinder to the next, then the table of the order of the sectors on the track (the skew plus 1 plus the sectors on a track bytes), then the codes that build the track. 01H-F0H (and F6H-FFH, 00H = 256) put the next byte that many times into the track; F1H starts the part repeated once for every sector, F2H ends it; F3H notes where the next sector's ID field is (cylinder, side, sector); F5H puts a pair of bytes the count after it times; F4H ends the template. The track is built from 6E00H up, over the front end, which has finished; the address of every ID field goes into the table at 6D00H. The SYSTEM parameter comes back here (61C1H) for cylinder 0.
6095H - Format Every Cylinder
The track in the buffer at 6E00H is complete except for the cylinder, side and sector bytes of each ID field. For each cylinder, from the one the head is on (cylinder 0 after the Restore at 71E8H) to the highest (+06H of the table), and for each side, the ID fields are filled in, the track is written, and the head steps in one cylinder. The order of the sectors comes from the table of the template; Register Pair BC moves on through it from side to side and cylinder to cylinder, so each cylinder starts its order further on by the skew, and by one place more on a drive with two sides.
60D6H - Write the Track, the Second Side, Step In
The track goes to the drive through the driver's Write Track (function 0FH). On a drive with two sides the same buffer is written again on side 1, its ID fields filled in again: the side byte 01H, and the sector numbers from one place further on in the order table (60F5H). Then the pointer into the table of the sector order moves on by the skew, and, until the highest cylinder is written, the head steps in one cylinder and the loop goes round again at 609BH through the wait at 611EH.
612EH - Verify Every Cylinder
Every sector of every cylinder is read back with the driver's Verify (function 0AH), in the order of the list after the template's F4H code (6085H): every second sector around the track, so that each read has the time of one sector before the next comes under the head. Register D is the cylinder; the driver seeks it for each sector. A cylinder with a sector that is not found or fails its CRC is marked with an asterisk on the screen and gets FFH in its byte of the allocation table at 6A00H (no granule free); any other error ends the format.
61E3H - A Sector Failed the Verify
Register A holds the driver's error number for the read (0AH Verify): 05H, the sector's ID field was not found, and 04H, a CRC error, mean the surface is bad and the cylinder is locked out; any other error number ends the format through @ERROR.
61FCH - A Drive Without Track Writing: the Hard Disk Question
The entry at 6004H comes here when bit 4 of +04H of the drive's table is set. A drive with bit 3 of +03H set (a hard disk) is formatted only when the operator answers Y. Without SYSTEM the drive's driver gets function 0CH; with SYSTEM nothing is done to the surface. Then the sectors on a cylinder are worked out from the table, and the run joins the choice of the directory cylinder: at 6241H for a hard disk, through the lock out table copy at 61CFH for any other drive.
6241H - Choose the Directory Cylinder
The directory goes on the cylinder given by DIR=n when it is below the highest cylinder, else on the middle cylinder; when that cylinder's byte of the allocation table is FFH (locked out), the cylinders on either side are tried in turn, one up, one down, two up, two down and so on. The search gives up when it reaches the highest cylinder or cylinder 0. The cylinder chosen goes into +09H of the working table and of the copy at 6000H, into the text 673BH and, at 629EH on, into the first extent of DIR/SYS and both boot sectors.
629EH - The Boot Sectors: Cylinder 0, Sectors 0 and 1
Granule 0 of cylinder 0 (the boot sectors and the system information) and the whole directory cylinder are marked used in the allocation table. Each boot sector image gets the directory cylinder at its +02H (4202H, the operand of CP at 4201H) and the bootstrap step rate (656EH): sector 0 in bits 1-0 of its Seek command (6BBCH, the 1BH of LD (HL),1BH at 42BBH), sector 1 at 6C10H (the operand of OR 03H at 420FH, 4210H). Sector 0 is verified before anything is written: a drive that was never formatted (the paths that write no tracks) ends here.
62FFH - The Allocation Table: Cylinder 0, Sectors 2 and 3
The table saved at 6000H-6009H by 618FH is put back into the working copy (the second pass over cylinder 0 changed its density and geometry), keeping the cylinder the head is on. On the path from 6004H nothing was saved there: the LDIR then copies the engine's own first nine bytes (FDH CBH 04H 66H C2H FCH 61H F3H 3AH) and the directory cylinder (6009H), and the next call through JP (IY) at 6495H runs those bytes as code. Then +CCH and +CDH of the allocation table image at 6A00H are built from the table, the image is written to cylinder 0, sector 3, and a system information sector of 53H and 255 bytes of 00H to sector 2.
6364H - The Directory Cylinder
Every sector of the directory cylinder is written with the deleted data mark (the driver's function 0EH) and read back by 6497H, which accepts only error 06H, the deleted data mark. Sector 0 gets the allocation table, sector 1 the hash index table with the bytes A2H (BOOT/SYS) and C4H (DIR/SYS), sector 2 the record of BOOT/SYS, sector 3 the record of DIR/SYS, every other sector 256 bytes of 00H. A plus sign is displayed for each of the first two sectors and a period for each sector after them.
641AH - The End: Formatting Complete
The interrupt vector is put back, the operator is asked for the system diskette when drive 0 was formatted, and the program returns to LDOS through @EXIT with Register Pair HL = 0000H.
642FH - A Period, the Abort, and Putting Back the Interrupt Vector
642FH displays a period. 6434H displays Format aborted! (6437H another text at Register Pair HL), writes it to the job log, puts back the interrupt vector and ends at @ABORT. 6440H puts back the byte at 4012H that 600BH saved, asks for the system diskette when drive 0 was the target, and restores the head of the target drive to cylinder 0.
6460H - Calls to the Drive's Driver
FORMAT calls the driver of the target drive itself, through the working drive code table at Index Register IY (6564H), whose first three bytes are the JP to the driver (C3H and the driver address) or, for a drive that is not present, RET (C9H). Each entry loads a function number into Register A and goes to 6489H, which puts the function into Register B and the drive into Register C, as the driver wants them (SYS0/SYS's floppy driver, 45FBH). Register Pair BC is kept; Register D (the cylinder), Register E (the sector) and Register Pair HL (the buffer) go to the driver as they are. The driver returns the Z FLAG and Register A = 00H on success, else Register A = the error number.
6497H - Verify a Directory Sector, the Error Exits, Small Helpers
6497H reads back a sector written with the deleted data mark: the read gives error 06H for that mark, which here is success; a read without an error means the mark is missing. 64A7H reports a disk error and ends the program; 64B1H gives error 2CH. 64B5H turns a number into two digits, 64C2H and 64C9H read a reply from the keyboard, 64E9H writes two digits over the last two on the screen, 64FBH and 650AH put a track descriptor into effect.
6524H - The Directory Records of BOOT/SYS and DIR/SYS
The two 32 byte directory records FORMAT writes: BOOT/SYS as record 0 (directory sector 2, 6393H-63AFH) and DIR/SYS as record 1 (sector 3, 63D4H-63F0H). Their hash index table bytes are A2H and C4H (637AH-637DH). Before DIR/SYS is written, its ending record number (+14H) and its first extent (+16H-+17H) are filled in from the directory cylinder and the geometry (62A8H, 63BEH, 63CBH, 63D1H).
6564H - The Working Drive Code Table and the Counts
6564H-656DH, not in the file, is the working copy of the target drive's drive code table (Index Register IY all through the engine); 656EH the bootstrap step rate; 656FH-6570H, not in the file, the sectors on a cylinder and on a track of the format.
6571H - The Four Track Descriptors
Six bytes each: the address of the template, the values for +07H and +08H of the drive code table, and the bytes of memory the track takes above 6E00H. The front end picks the pair for the drive's size (6571H for 5 inch, 657DH for 8 inch), the first of a pair for single density and the second for double density; 64FBH or 650AH put it into effect.
6589H - Template: 5 Inch, Single Density
10 sectors of 256 bytes, skew 7. The order of the sectors on the track, then the stream that 6013H expands: a gap of FFH bytes, then for each sector 6 bytes of 00H, the ID address mark FEH, the cylinder, side and sector (filled in by 60B2H), the size 01H (256 bytes), F7H (the controller writes the two CRC bytes), a gap, 6 bytes of 00H, the data address mark FBH, 256 bytes of E5H, F7H and a gap; then FFH to the end of the track. The track is 3105 bytes.
65C9H - Template: 5 Inch, Double Density
18 sectors of 256 bytes, skew 13. The stream: a gap of 4EH bytes, then for each sector 12 bytes of 00H, three F5H (the controller writes the sync byte A1H), the ID address mark FEH, the cylinder, side and sector, the size 01H, F7H (the two CRC bytes), a gap of 4EH, 12 bytes of 00H, three F5H, the data address mark FBH, 128 pairs 6DH B6H as the data, F7H and a gap; then 4EH to the end of the track. The track is 6334 bytes.
6623H - Template: 8 Inch, Single Density
16 sectors of 256 bytes, skew 2. The same fields as the 5 inch single density template (6589H) with longer gaps. The track is 5176 bytes.
6668H - Template: 8 Inch, Double Density
30 sectors of 256 bytes, skew 3. The same fields as the 5 inch double density template (65C9H) with other gaps. The track is 10357 bytes.
66D2H - The Engine's Texts (1)
The texts of the format, the verify and the directory. 03H ends a text with the cursor left at its end, 0DH ends the line, 0AH starts a new line, 1DH moves the cursor to the start of its line.
6763H - Restore and Side 0
Called by 61A3H before the second pass over cylinder 0: the head goes back to cylinder 0 and side 0 is chosen. Four NOPs follow the RES.
676FH - The Engine's Texts (2)
The texts of the second pass over cylinder 0, of the system information, of the end and of the errors, and 32 bytes of 00H that end the block.
685BH - Memory Not in the File, the Boot Sector Pointers, the Allocation Table Image
685BH-68FFH and 6904H-69FFH are not used. 6900H-6903H point to the step rate byte of each boot sector image. 6A00H-6AFFH is the image of the allocation table, with the offsets of the sector: 6A00H-6ACAH is built at run time and not in the file; 6ACBH-6AFFH holds the fields after it.
6B00H - Image of Boot Sector 0 (Runs at 4200H)
The 256 bytes 6B00H-6BFFH are the boot sector FORMAT writes to cylinder 0, sector 0 (62CCH-62D5H), with the directory cylinder stored at its +02H (6B02H, 62B1H) and the bootstrap step rate in bits 1-0 of its Seek command (6BBCH, 62B8H-62BFH). The rows show the code as it runs: the ROM reads the sector into 4200H-42FFH at a reset and jumps to 4200H, so every address in the comments is 2900H below the address of the row (4200H for 6B00H). It finds SYS0/SYS through its directory record (sector 4 of the directory cylinder), reads its first extent into 5100H-51FFH, copies each load block to its address and jumps to the transfer address, working the floppy disk controller through its registers at 37ECH-37EFH.
6B2EH - Image of Boot Sector 0: Locate SYS0/SYS (Runs at 422EH)
Byte 16H of the directory record is the cylinder of the file's first extent and byte 17H holds its first granule (bits 7-5) and the number of granules less one (bits 4-0). This code works the first granule into a sector number, 5 sectors to a granule, and sets up the alternate register set, which does all the reading from here on: Register Pair DE' holds the cylinder and sector of the next sector to read and Register Pair BC' the pointer into the buffer. Only the first extent is used, read as consecutive sectors.
6B42H - Image of Boot Sector 0: Load SYS0/SYS Record by Record (Runs at 4242H)
SYS0/SYS is a load module: records of a type byte, a length byte and the data. Type 01H is a load block (two address bytes, then the length less 2 data bytes; a length of 02H gives 256), type 02H is the transfer address, and every other type is passed over by its length. The bytes come one at a time from the buffer through 4279H, which reads the next sector when the buffer is used up.
6B79H - Image of Boot Sector 0: Fetch the Next Byte (Runs at 4279H)
Returns the next byte of the file in Register A. Works in the alternate register set: Register Pair BC' points into the buffer at 5100H and Register Pair DE' holds the cylinder and sector of the next sector to read. When Register C' wraps to 00H the buffer is used up and the next sector is read into it first. The main registers of the caller are not changed.
6B94H - Image of Boot Sector 0: Display an Error and Stop (Runs at 4294H)
Disk Error is shown when a sector cannot be read, No System (entered at 4297H with Register Pair HL = 42E7H) when the directory record of SYS0/SYS is free. Both wait for a line from the keyboard and then stop the computer; only RESET restarts it.
6B9EH - Image of Boot Sector 0: Display a Text (Runs at 429EH)
Displays the bytes at Register Pair HL through the ROM until the end byte 03H. Register Pair HL is kept.
6BACH - Image of Boot Sector 0: Read a Sector, Two Tries (Runs at 42ACH)
Reads cylinder Register D, sector Register E of drive 0 into the buffer at Register Pair BC. The first try is the CALL 42B4H; when it fails, the code falls into 42B4H for a second try, which returns straight to the caller. On return the Z FLAG is set if the sector was read, and Register Pair HL holds the buffer address.
| 1771 FDC Command: 1BH (00011011) | Function Description | ||||||||
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 | Summary of Bits | |
| 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | Command=Seek (bits 7-4 = 0001) h = 1: head load and settle delay V = 0: no verify r1 r0 = 11: 40 ms stepping rate | |
| 1771 FDC Command: 88H (10001000) | Function Description | ||||||||
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 | Summary of Bits | |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | Command=Read Sector (bits 7-5 = 100) m = 0: one sector b = 1: IBM sector length E = 0: no head load delay | |
| 1771 FDC Command: D0H (11010000) | Function Description | ||||||||
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 | Summary of Bits | |
| 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | Command=Force Interrupt (bits 7-4 = 1101) I3-I0 = 0000: end the command, no interrupt | |
6BE4H - Image of Boot Sector 0: Texts (42E4H-42FFH)
The three texts this sector displays through 429EH, each ended by 03H.
6C00H - Image of Boot Sector 1 (Runs at 4200H)
The 256 bytes 6C00H-6CFFH are the boot sector FORMAT writes to cylinder 0, sector 1 (62F0H-62F9H), with the directory cylinder at its +02H (6C02H, 62DEH) and the bootstrap step rate at 6C10H (the operand of OR 03H at 420FH, 62E5H-62ECH). The rows show the code as it runs at 4200H-42FFH: every address in the comments is 2A00H below the address of the row. It is the boot sector for a computer whose own boot code reads the diskette through a disk driver and enters it with Index Register IY pointing at drive 0's drive code table, whose first three bytes are a JP to the driver; every read goes through that driver (JP (IY) at 42D5H) with function 09H. SYS0/SYS's reset (4E4FH-4E61H) sees that Index Register IY is not 0000H, copies the 10 bytes at IY to drive 0's table at 4700H and sets bit 0 of 442FH.
6C4CH - Image of Boot Sector 1: Locate SYS0/SYS (Runs at 424CH)
The first extent of SYS0/SYS (bytes 16H-17H of its directory record) gives the cylinder and the first granule. Here the sectors per granule come from the drive code table (bits 4-0 of byte +08H, plus 1), and the granule number is multiplied by them through 42D7H. The read position is set up in the alternate register set, as in sector 0.
6C66H - Image of Boot Sector 1: Load SYS0/SYS Record by Record (Runs at 4266H)
The same loader as sector 0 (4242H): type 01H records are copied to their load address, type 02H gives the transfer address, any other type is passed over by its length. The bytes come from 429DH.
6C9DH - Image of Boot Sector 1: Fetch the Next Byte (Runs at 429DH)
Returns the next byte of SYS0/SYS in Register A, working in the alternate register set (Register Pair BC' = buffer pointer, Register Pair DE' = next cylinder and sector). When Register C' wraps to 00H the next sector is read through the driver; the sector number wraps at the sectors per cylinder stored at 42ABH.
6CB3H - Image of Boot Sector 1: Display an Error and Stop (Runs at 42B3H)
Disk Error when the driver cannot read a sector of SYS0/SYS; No System (entered at 42B6H with Register Pair HL = 42E6H) when its directory record is free. Then the computer waits for a line from the keyboard and stops.
6CBDH - Image of Boot Sector 1: Display a Text (Runs at 42BDH)
Displays the bytes at Register Pair HL through the ROM until the end byte 03H; Register Pair HL is left pointing at the 03H.
6CC9H - Image of Boot Sector 1: Read a Sector Through the Driver (Runs at 42C9H)
Reads cylinder Register D, sector Register E of drive 0 into the buffer at Register Pair BC by calling the disk driver through the drive code table at Index Register IY with function 09H. The driver's Z FLAG (set = read) and Register A (the error) come back to the caller; Register Pair HL is kept.
6CD7H - Image of Boot Sector 1: Multiply Two Bytes (Runs at 42D7H)
Returns in Register A the low 8 bits of Register A times Register E, by shift and add. Register D is left holding the first factor and Register E is shifted to 00H; Register Pair BC is kept.
6CE6H - Image of Boot Sector 1: Texts (42E6H-42FFH)
The two messages of this sector, each ended by 03H, and the last byte of the sector.
6D00H - The Buffer at 6D00H (Not in the File)
256 bytes the program uses for three things in turn.
6E00H - The Front End: the Banner, the System Information Sector
The transfer address. LDOS runs FORMAT with Register Pair HL pointing to the command line after the program name. The front end, 6E00H-7264H, asks for or reads every choice, puts the target drive's drive code table into 6564H and goes to the engine (71EBH); the engine then builds its tracks over the front end from 6E00H up. First the banner, a request that loads SYS2/SYS, and the system information sector of drive 0 (cylinder 0, sector 2) into 4200H: from its block of drive code tables (4220H after a boot through a disk driver, bit 0 of 442FH set, else 4270H) the default bootstrap step rate (drive 0's +03H, bits 1-0) and each drive's highest cylinder (+06H) are taken.
6E3EH - The Drive and the Parameters
The command line may start with :d, the drive (0-7); then @PARAM reads the parameters (the table at 72A8H), which store their values into the operands of the instructions that read them. Without :d the drive is asked for and the parameters on the line are not read. The values of SDEN, DDEN, SIDES, CYL and STEP are ORed together into 6FA7H: not 0 when any of them was given, which means no question is asked.
6E9BH - NAME and MPW Follow QUERY, the Drive's Table
When NAME or MPW was not given, its operand gets the QUERY value: FFFFH (the default, or Q=Y) means ask, 0000H (Q=N) means take the default. The drive's default cylinders go to 7031H; the drive's table is copied to the working table at 6564H, Index Register IY points to it, and the driver's function 00H tests that the drive is present.
6EDBH - The Diskette Name, the Date, the Master Password
NAME: 0000H takes LDOSDISK (7644H), FFFFH asks (Diskette name ?), else the address of a text on the command line. The name goes into the allocation table image at 6AD0H (+D0H) in upper case, the date of today at 6AD8H (+D8H). MPW the same way: PASSWORD (764CH) or the question Master password ? or the text; it goes to 727DH, is checked (letters and digits, the first a letter) and its hash goes to 6ACEH (+CEH).
6F6EH - The Density
A drive with bit 4 of +04H set gets no questions (70CFH). For the others the track descriptors of the drive's size are chosen (6571H for 5 inch, 657DH for 8 inch, bit 5 of +03H). The default is single density, or double density when the drive's controller can do it (bit 6 of +04H); one side; the default cylinders. Without any of SDEN, DDEN, SIDES, CYL or STEP, and with QUERY not 0000H, the questions are asked; with Q=N none is, and the defaults are used. The density question is asked only when the controller can do double density.
6FF3H - The Sides and the Cylinders
SIDES=2 (or the reply 2) sets bit 5 of +04H. The number of cylinders is asked for (or taken from CYL=n) only for a 5 inch floppy (bits 5 and 3 of +03H clear); a reply of 0 or ENTER takes the default, and 96 or more is refused: the question is asked again, and CYL=n of 96 or more gives error 2CH.
704BH - The Bootstrap Step Rate, SYSTEM
The step rate is asked for in milliseconds, with the values of a 5 inch drive (6, 12, 20, 30 or 40) or an 8 inch drive (3, 6, 10, 15 or 20), and turned into 0-3; ENTER, Q=N and the parameters take STEP or the default from the system information sector (6E29H). SYSTEM is refused unless the format is 5 inch double density.
70CFH - The Allocation Table Image, the Target Diskette
Each cylinder's byte of the allocation table image (6A00H up to the highest cylinder) gets a bit set for every granule the cylinder does not have: FFH shifted left once for each granule of a cylinder (the granules on a track, twice that with two sides). The bytes after it up to 6ACAH, the lock out table among them, get FFH. For drive 0 the operator is asked to put in the diskette to be formatted; a JCL job cannot answer, so it ends there.
711AH - Check the Target Diskette
The working table is saved at 7265H, since the checks move the head and change +05H. After a Restore the controller's status must show the drive ready and the head on track 0, a diskette must turn (723EH) and must not be write protected, and HIGH$ must leave room for the track. A drive with bit 4 of +04H set skips these. Then, when cylinder 0, sector 0 can be read (in the density of the new format), the diskette's name and date are shown from its directory, and the operator must answer Y unless ABS was given; a JCL job ends there. The saved table is put back, the head restored, and the engine starts at 6000H.
71EEH - A Number From Digits
Register Pair HL points to a reply; the decimal digits at its start are turned into a number in Register A (the low 8 bits), ending at the first character that is not a digit. Register Pair HL comes back past that character.
7201H - Check and Hash the Master Password
Register Pair DE points to the 8 characters of the password. The first must be a letter A-Z, each of the others a letter or a digit 0-9, and once a space comes every character after it must be a space. A password that fails gives Invalid Master Password! and Format aborted!. A good one is hashed by SYS2/SYS (request E4H): Register Pair HL = the hash.
723EH - Does a Diskette Turn?
The controller's status bit 1 (INDEX) is 1 while the index hole is under the sensor. The routine waits for it to be 0, then 1, then 0 again, each within the deadline of TIMER$ (4040H) plus 20 ticks (half a second). It returns the Z FLAG when the hole passed; at the deadline 7261H drops the return address of the poll and returns to the caller of 723EH with the NZ FLAG.
7265H - Not in the File: the Saved Table and the Cylinders of the Drives
Two areas the front end fills.
7277H - Two Supervisor Requests
Each loads a request code into Register A and does RST 28H. The supervisor's dispatcher (4BCDH) drops the return address the RST pushed, so the RET at the end of the system file goes back to the caller of the CALL: neither needs a RET of its own. Both codes name SYS2/SYS (low four bits 4: file 2 plus 2).
727DH - The Master Password, a Text
The buffer of the master password and the text of 722CH.
72A8H - The Table of the Parameters
The table @PARAM reads (6E58H): for each parameter its name, 6 characters padded with spaces, and the address of the operand that takes its value; the short forms point to the same operands. 00H ends it. The operands: 0000H in the file (not given), FFFFH for a parameter given alone (or Y), 0000H for N, the number for =n, the address of the text for a quoted text.
7341H - The Front End's Texts
The banner, the questions (ended by 03H: the cursor stays for the reply), the error texts (ended by 0DH), the defaults LDOSDISK and PASSWORD, and 32 bytes of 00H.