LDOS 5.3.1 for the Model III - FORMAT/CMD Disassembled
Page Customization
Page Index
FORMAT/CMD
Other Navigation
Introduction/Summary
LDOS 5.3.1 FORMAT/CMD Disassembly - The Diskette Formatter (Model III)
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 4845 bytes: a copyright record, 23 load blocks with 4698 bytes in 6000H-7565H (with gaps that are not in the file), and the transfer address 6D00H. The program has two parts. The front end (6D00H-7162H) reads the parameters and the replies, copies the target drive's drive code table to 6505H and changes the copy, checks the diskette and jumps to the engine (70E9H). The engine (6000H-6504H) builds each track from a template into the memory from 6D00H 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 (6401H), 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 (6D36H). Each parameter's value goes into the operand of the instruction that reads it (the table at 719DH).
| 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 (6DE0H). |
| 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 (70FFH). |
| 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 (6E73H). |
| 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), 6D17H). |
| ABS (A) | A diskette that holds data is formatted without the question Are you sure you want to format it ? (70C1H). |
| 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 | Accepted only for a hard disk (bit 3 of +03H); for any other drive FORMAT ends with Can't "SYSTEM" a floppy! before it writes anything (6DCDH). On a drive whose table has bit 4 of +04H set only the system information is written; the memory is not checked and the contents of the diskette are not looked at (7044H, 7067H). The Model I file instead writes cylinder 0 of a 5 inch double density floppy again in single density. |
| 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 (61F8H). |
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 or 30 for a 5 inch drive (the question names these; 40 is taken too), 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, 713CH), not write protected, and HIGH$ must leave room for the track above 6D00H. 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 (705FH).
The Track Templates
Four descriptors (6512H) 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 |
|---|---|---|---|---|
| 652AH | 5 inch, single density | 10 | 2, 7 | 3105 bytes; 2 granules of 5 sectors on a track; data E5H. |
| 656AH | 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. |
| 65C4H | 8 inch, single density | 16 | 3, 2 | 5176 bytes; 2 granules of 8 sectors; data E5H. |
| 6609H | 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 | A copy of the boot sector, from 6A00H, with the directory cylinder and the step rate. |
| 0, 1 | The boot sector, from 6B00H, the same bytes: the sector the Model III ROM reads into 4300H and runs at a reset (the BOOT/SYS page shows it as it is on the system diskette). |
| 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 (6900H-69FFH): 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 (64C5H) and DIR/SYS (64E5H). |
| 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 (6438H). 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 (61B3H). 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. SYSTEM is given only for a hard disk (6DD7H). Then the system information is written.
About This Page
The Model III file is the Model I file of the same release with the engine and its tables moved down (the allocation table image is at 6900H, the Model I file's 6A00H; the buffer at 6C00H, the Model I file's 6D00H; the front end at 6D00H, the Model I file's 6E00H) and these changes in the code: there is no second pass over cylinder 0 in single density, so SYSTEM is refused for every floppy (6DCDH) and the configuration byte never gets bit 4; with SYSTEM the memory check and the look at the old contents are left out (7044H, 7067H); for a hard disk the directory search starts from the directory cylinder of the drive's own table (61F8H); both boot sector images hold the Model III boot sector, which runs at 4300H, and each gets the bootstrap step rate in its Seek command at +95H (6252H); the system information sector's drive tables are always taken from its second block at 4370H (6D17H); the date comes from the ROM's @DATE at 3033H (6E20H); the half second of the index test is 15 of the Model III's 30 ticks (713FH); the default bootstrap step rate in the file is 00H (650FH) and the 5 inch question names 30 ms as the slowest rate. The calls into the system use the Model III addresses: @LOGOT 428AH, @PARAM 4454H, SFLAG$ 442BH, HIGH$ 4411H, TIMER$ 4288H, MULTEA 4B6BH and the sector buffer 4300H. The ROM routines it calls (0033H, 0040H, 0049H, 0060H, 3033H) are those of the Model III ROM, version 3.1; 0060H is a JP 01FBH to the delay loop there.
Every byte of the file has its row; the rows of the two boot sector images (6A00H-6BFFH) show their code as it runs at 4300H, 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 63D5H at 6238H displays Format aborted! and not the text at 66B6H; Number of cylinders ? takes at most 95; the default name is LDOSDISK; the question Special non-standard format desired ? (730BH) is not used; the bootstrap step rate stays 00H 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 6D00H. 6505H-650EH, 6510H-6511H, 67D9H-67FFH, 6804H-69CAH, 6C00H-6CFFH and 7163H-7174H 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-6504H | 5 bytes |
| 650FH-650FH | 1 bytes |
| 6512H-6611H | 256 bytes |
| 6612H-6711H | 256 bytes |
| 6712H-67D8H | 199 bytes |
| 6800H-6803H | 4 bytes |
| 69CBH-69FFH | 53 bytes |
| 6D00H-6DFFH | 256 bytes |
| 6E00H-6EFFH | 256 bytes |
| 6F00H-6FFFH | 256 bytes |
| 7000H-70FFH | 256 bytes |
| 7100H-7162H | 99 bytes |
| 7175H-7274H | 256 bytes |
| 7275H-7374H | 256 bytes |
| 7375H-7474H | 256 bytes |
| 7475H-7565H | 241 bytes |
| 6A00H-6AFFH | 256 bytes |
| 6B00H-6BFFH | 256 bytes |
The Parts of the File
| Address | Contents |
|---|---|
| 6000H-64C4H | The engine: the track expander (6013H), the format of every cylinder (6095H), the verify (612EH), the directory cylinder (61F8H), the system information (6252H-63B9H), the end (63BBH), the calls to the driver (6401H) and its helpers. |
| 64C5H-6672H | The records of BOOT/SYS and DIR/SYS, the working drive code table (not in the file), the four track descriptors and templates. |
| 6673H-69FFH | The engine's texts, the pointers at 6800H and the allocation table image (6900H-69FFH). |
| 6A00H-6BFFH | The images of boot sectors 0 and 1 (run at 4300H). |
| 6C00H-6CFFH | Not in the file: the table of the ID fields of the track, then the buffer of the replies and of the sectors written. |
| 6D00H-7162H | The front end; from 6000H on the engine builds the tracks here, up to 6D00H plus the memory size of the descriptor. |
| 7163H-7565H | 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 |
| 619AH | A Sector Failed the Verify |
| 61B3H | A Drive Without Track Writing: the Hard Disk Question |
| 61F8H | Choose the Directory Cylinder |
| 6252H | The Boot Sectors: Cylinder 0, Sectors 0 and 1 |
| 62B3H | The Allocation Table: Cylinder 0, Sector 3; the System Information: Sector 2 |
| 6305H | The Directory Cylinder |
| 63BBH | The End: Formatting Complete |
| 63D0H | A Period, the Abort, and Putting Back the Interrupt Vector |
| 6401H | Calls to the Drive's Driver |
| 6438H | Verify a Directory Sector, the Error Exits, Small Helpers |
| 64C5H | The Directory Records of BOOT/SYS and DIR/SYS |
| 6505H | The Working Drive Code Table and the Counts |
| 6512H | The Four Track Descriptors |
| 652AH | Template: 5 Inch, Single Density |
| 656AH | Template: 5 Inch, Double Density |
| 65C4H | Template: 8 Inch, Single Density |
| 6609H | Template: 8 Inch, Double Density |
| 6673H | The Engine's Texts (1) |
| 6704H | The Engine's Texts (2) |
| 67D9H | Memory Not in the File, the Boot Sector Pointers, the Allocation Table Image |
| 6A00H | Image of Boot Sector 0 (Runs at 4300H) |
| 6A2AH | Image of Boot Sector 0: Load SYS0/SYS Record by Record (Runs at 432AH) |
| 6A4EH | Image of Boot Sector 0: Fetch a Record Length and Address (Runs at 434EH) |
| 6A5DH | Image of Boot Sector 0: Fetch the Next Byte of SYS0/SYS (Runs at 435DH) |
| 6A74H | Image of Boot Sector 0: Read a Sector, Five Tries (Runs at 4374H) |
| 6A80H | Image of Boot Sector 0: Display Disk error or No system and Restart (Runs at 4380H) |
| 6A8EH | Image of Boot Sector 0: Seek and Read One Sector (Runs at 438EH) |
| 6AD3H | Image of Boot Sector 0: End of Read (NMI) (Runs at 43D3H) |
| 6ADFH | Image of Boot Sector 0: Send a Command to the Controller (Runs at 43DFH) |
| 6AE6H | Image of Boot Sector 0: The Two Messages (Runs at 43E6H) |
| 6B00H | Image of Boot Sector 1 (Runs at 4300H) |
| 6B2AH | Image of Boot Sector 1: Load SYS0/SYS Record by Record (Runs at 432AH) |
| 6B4EH | Image of Boot Sector 1: Fetch a Record Length and Address (Runs at 434EH) |
| 6B5DH | Image of Boot Sector 1: Fetch the Next Byte of SYS0/SYS (Runs at 435DH) |
| 6B74H | Image of Boot Sector 1: Read a Sector, Five Tries (Runs at 4374H) |
| 6B80H | Image of Boot Sector 1: Display Disk error or No system and Restart (Runs at 4380H) |
| 6B8EH | Image of Boot Sector 1: Seek and Read One Sector (Runs at 438EH) |
| 6BD3H | Image of Boot Sector 1: End of Read (NMI) (Runs at 43D3H) |
| 6BDFH | Image of Boot Sector 1: Send a Command to the Controller (Runs at 43DFH) |
| 6BE6H | Image of Boot Sector 1: The Two Messages (Runs at 43E6H) |
| 6C00H | The Buffer at 6C00H (Not in the File) |
| 6D00H | The Front End: the Banner, the System Information Sector |
| 6D36H | The Drive and the Parameters |
| 6D93H | NAME and MPW Follow QUERY, the Drive's Table |
| 6DE0H | The Diskette Name, the Date, the Master Password |
| 6E73H | The Density |
| 6EF8H | The Sides and the Cylinders |
| 6F50H | The Bootstrap Step Rate |
| 6FC1H | The Allocation Table Image, the Target Diskette |
| 700CH | Check the Target Diskette |
| 70ECH | A Number From Digits |
| 70FFH | Check and Hash the Master Password |
| 713CH | Does a Diskette Turn? |
| 7163H | Not in the File: the Saved Table and the Cylinders of the Drives |
| 7175H | Two Supervisor Requests |
| 717BH | The Master Password, a Text |
| 719DH | The Table of the Parameters |
| 7236H | 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 44A5H. FORMAT stores C9H (RET) here while it writes the tracks (6010H) and puts the byte back (63E7H). |
| 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). |
| 4288H | TIMER$, the tick counter (30 a second on the Model III): the half second of the test whether a diskette turns. |
| 4411H-4412H | HIGH$: the track must end below it (7053H). |
| 4300H-43FFH | The system's sector buffer: the system information sector of drive 0 is read here (6D11H); its drive tables in the second block at 4370H give the default step rate (+03H of drive 0) and each drive's highest cylinder (+06H). |
| 442BH | SFLAG$: bit 5 a JCL job runs (no question can be answered). |
| 4467H, 428AH, 4454H | @DSPLY, @LOGOT and @PARAM. |
| 3033H | ROM: @DATE, the date as MM/DD/YY into the allocation table (6E20H); the Model I file calls the LDOS vector 4470H. |
| 4700H-474FH | DCT$: the target drive's table is copied from here (47A5H, 6DBEH); 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. |
| 4B6BH | 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). |
| 4583H | 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 |
|---|---|
| 6D00H | The start of FORMAT, the transfer address of the file: the front end. |
| 6000H | The engine, entered from 70E9H with Index Register IY = 6505H. |
| 6013H | Build the track from the template. |
| 6095H | Format every cylinder. |
| 612EH | Verify every cylinder. |
| 61F8H | Choose the directory cylinder (6201H after the verify). |
| 6252H | Write the boot sectors, the allocation table, the system information sector and the directory. |
| 63BBH | The end through @EXIT. |
| 63D5H | Format aborted! (63D8H another text) and @ABORT. |
| 63E1H | Put back the interrupt vector, ask for the system diskette, Restore. |
| 6401H | The calls to the driver: 6401H function 00H, 6404H 01H, 6408H 04H, 640CH 05H, 6410H 07H, 6414H 0FH, 6418H 0CH, 641CH 0DH, 6420H 0EH, 6424H 09H, 6428H 0AH; 642AH the common part. |
| 6438H | Verify a sector with the deleted data mark. |
| 6448H | Report a disk error and end; 6452H error 2CH. |
| 6456H | Two digits of a number (Register C, Register B). |
| 6463H | Display a question and read up to 3 characters; 646AH up to 8; 646FH into the buffer at Register Pair HL. |
| 648AH | Write two digits over the last two on the screen. |
| 649CH | Put a track descriptor into effect with the default cylinders; 64ABH without them. |
| 70ECH | A number from digits. |
| 70FFH | Check and hash the master password. |
| 713CH | Does a diskette turn? |
| 7175H | The requests 84H (7175H) and E4H (7178H). |
Data in the File
| Address Size | Contents |
|---|---|
| 64C5H 1 byte | DEFB 5EH 64C5H, 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). |
| 64C6H 1 byte | DEFB 00H 64C6H, BOOT/SYS +01H: 00H, no flags and no month (the record is not dated). |
| 64C7H 1 byte | DEFB 00H 64C7H, BOOT/SYS +02H: 00H, the day and the year of the date, none. |
| 64C8H 1 byte | DEFB 00H 64C8H, BOOT/SYS +03H: 00H, the end of file byte: the last sector is full. |
| 64C9H 1 byte | DEFB 00H 64C9H, BOOT/SYS +04H: 00H, the record length: 256 bytes. |
| 64CAH-64D1H 8 bytes | DEFM "BOOT " 64CAH-64D1H, BOOT/SYS +05H-+0CH: the name BOOT, padded with spaces to 8 bytes. |
| 64D2H-64D4H 3 bytes | DEFM "SYS" 64D2H-64D4H, BOOT/SYS +0DH-+0FH: the extension SYS. |
| 64D5H-64D6H 2 bytes | DEFW 01AEH 64D5H-64D6H, BOOT/SYS +10H-+11H: 01AEH, the hash of the file's password (4296H would be no password); SYS2/SYS's @OPEN compares it. |
| 64D7H-64D8H 2 bytes | DEFW 0000H 64D7H-64D8H, BOOT/SYS +12H-+13H: 0000H, the time and the year of the date stamp, none. |
| 64D9H-64DAH 2 bytes | DEFW 0005H 64D9H-64DAH, BOOT/SYS +14H-+15H: 0005H, the ending record number: 5 sectors, cylinder 0 sectors 0-4. |
| 64DBH 1 byte | DEFB 00H 64DBH, BOOT/SYS +16H: 00H, the cylinder of the first extent: cylinder 0. |
| 64DCH 1 byte | DEFB 00H 64DCH, 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). |
| 64DDH-64E2H 6 bytes | DEFB FFH x 6 64DDH-64E2H, BOOT/SYS +18H-+1DH: the three other extents, FFH (no extent). |
| 64E3H 1 byte | DEFB FFH 64E3H, BOOT/SYS +1EH: FFH, no link to an extension record. |
| 64E4H 1 byte | DEFB FFH 64E4H, BOOT/SYS +1FH: FFH, the number of an extension record, none. |
| 64E5H 1 byte | DEFB 5DH 64E5H, 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). |
| 64E6H 1 byte | DEFB 00H 64E6H, DIR/SYS +01H: 00H, no flags and no month. |
| 64E7H 1 byte | DEFB 00H 64E7H, DIR/SYS +02H: 00H, the day and the year of the date, none. |
| 64E8H 1 byte | DEFB 00H 64E8H, DIR/SYS +03H: 00H, the end of file byte: the last sector is full. |
| 64E9H 1 byte | DEFB 00H 64E9H, DIR/SYS +04H: 00H, the record length: 256 bytes. |
| 64EAH-64F1H 8 bytes | DEFM "DIR " 64EAH-64F1H, DIR/SYS +05H-+0CH: the name DIR, padded with spaces to 8 bytes. |
| 64F2H-64F4H 3 bytes | DEFM "SYS" 64F2H-64F4H, DIR/SYS +0DH-+0FH: the extension SYS. |
| 64F5H-64F6H 2 bytes | DEFW 01AEH 64F5H-64F6H, DIR/SYS +10H-+11H: 01AEH, the hash of the file's password, the same as BOOT/SYS. |
| 64F7H-64F8H 2 bytes | DEFW 4296H 64F7H-64F8H, DIR/SYS +12H-+13H: 4296H, the hash of eight spaces. DATECONV/CMD treats a record with 4296H here as one without a date stamp. |
| 64F9H-64FAH 2 bytes | DEFW 000AH 64F9H-64FAH, DIR/SYS +14H-+15H: the ending record number, 000AH in the file; 635FH stores the sectors of the directory cylinder (at most 34) in the low byte. |
| 64FBH 1 byte | DEFB 11H 64FBH, DIR/SYS +16H: the cylinder of the first extent, 11H (17) in the file; 625CH and 6372H store the directory cylinder. |
| 64FCH 1 byte | DEFB 01H 64FCH, DIR/SYS +17H: the first extent's first granule (bits 7-5) and granules less one (bits 4-0), 01H in the file; 636CH stores granule 0 and the granules of the cylinder less one. |
| 64FDH-6502H 6 bytes | DEFB FFH x 6 64FDH-6502H, DIR/SYS +18H-+1DH: the three other extents, FFH (no extent). |
| 6503H 1 byte | DEFB FFH 6503H, DIR/SYS +1EH: FFH, no link to an extension record. |
| 6504H 1 byte | DEFB FFH 6504H, DIR/SYS +1FH: FFH, the number of an extension record, none. |
| 6505H-650EH 10 bytes | DEFS 10 6505H-650EH: not in the file. The working copy of the target drive's drive code table: the front end copies the drive's table here (6DC1H) and changes it for the format chosen; the engine reaches the driver through it (6436H). |
| 650FH 1 byte | DEFB 00H 650FH: the bootstrap step rate, 0-3: 00H in the file, the value the front end chooses stored by 6FBEH; 6268H and 6295H put it into bits 1-0 of the Seek command of the two boot sectors. |
| 6510H-6511H 2 bytes | DEFS 2 6510H-6511H: not in the file. 6510H the sectors on a cylinder (6023H, 61EFH), 6511H the sectors on a track (6018H). |
| 6512H-6517H 6 bytes | DEFW 652AH, 2409H, 0D35H 6512H-6517H: 5 inch single density. Template 652AH; +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. |
| 6518H-651DH 6 bytes | DEFW 656AH, 4511H, 196AH 6518H-651DH: 5 inch double density. Template 656AH; +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. |
| 651EH-6523H 6 bytes | DEFW 65C4H, 270FH, 1558H 651EH-6523H: 8 inch single density. Template 65C4H; +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. |
| 6524H-6529H 6 bytes | DEFW 6609H, 491DH, 29B1H 6524H-6529H: 8 inch double density. Template 6609H; +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. |
| 652AH 1 byte | DEFB 0AH 652AH, template +00H: 0AH, 10 sectors on a track (6016H). |
| 652BH 1 byte | DEFB 07H 652BH, template +01H: 07H, the skew: each cylinder starts the order of the sectors 7 places further on (6026H). |
| 652CH-6535H 10 bytes | DEFB 00H, 05H, 01H, 06H, 02H, 07H, 03H, 08H, 04H, 09H 652CH-6535H: the order of the sectors on the track, with an interleave of 2: each sector number lies two places after the one before. |
| 6536H-653DH 8 bytes | DEFB F6H x 8 6536H-653DH: F6H (minus 10) eight times, the skew plus 1: a pointer that runs past the last sector number moves back 10 places (60C2H-60CBH). |
| 653EH-653FH 2 bytes | DEFB 0EH, FFH 653EH-653FH: 14 bytes of FFH, the gap at the start of the track after the index pulse. |
| 6540H 1 byte | DEFB F1H 6540H: F1H, the start of the part built once for each of the 10 sectors. |
| 6541H-6542H 2 bytes | DEFB 06H, 00H 6541H-6542H: 6 bytes of 00H before the ID field. |
| 6543H-6544H 2 bytes | DEFB 01H, FEH 6543H-6544H: 1 byte FEH, the ID address mark. |
| 6545H 1 byte | DEFB F3H 6545H: F3H, the address of the next byte of the track goes into the table at 6C00H: the ID field's cylinder byte. |
| 6546H-6547H 2 bytes | DEFB 03H, 00H 6546H-6547H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 6548H-6549H 2 bytes | DEFB 01H, 01H 6548H-6549H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 654AH-654BH 2 bytes | DEFB 01H, F7H 654AH-654BH: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 654CH-654DH 2 bytes | DEFB 01H, FFH 654CH-654DH: 1 byte FFH, the start of the gap after the ID field. |
| 654EH-654FH 2 bytes | DEFB 0BH, FFH 654EH-654FH: 11 bytes of FFH, the rest of the gap after the ID field. |
| 6550H-6551H 2 bytes | DEFB 06H, 00H 6550H-6551H: 6 bytes of 00H before the data field. |
| 6552H-6553H 2 bytes | DEFB 01H, FBH 6552H-6553H: 1 byte FBH, the data address mark. |
| 6554H-6555H 2 bytes | DEFB 00H, E5H 6554H-6555H: 256 bytes of E5H (a count of 00H), the data of the sector. |
| 6556H-6557H 2 bytes | DEFB 01H, F7H 6556H-6557H: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 6558H-6559H 2 bytes | DEFB 01H, FFH 6558H-6559H: 1 byte FFH, the start of the gap after the data field. |
| 655AH-655BH 2 bytes | DEFB 0DH, FFH 655AH-655BH: 13 bytes of FFH, the rest of the gap after the data field. |
| 655CH 1 byte | DEFB F2H 655CH: F2H, the end of the part built for each sector. |
| 655DH-655EH 2 bytes | DEFB 47H, FFH 655DH-655EH: 71 bytes of FFH, the gap at the end of the track. |
| 655FH 1 byte | DEFB F4H 655FH: F4H, the end of the template; 6085H finishes the track there. |
| 6560H-6569H 10 bytes | DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H 6560H-6569H: 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. |
| 656AH 1 byte | DEFB 12H 656AH, template +00H: 12H, 18 sectors on a track (6016H). |
| 656BH 1 byte | DEFB 0DH 656BH, template +01H: 0DH, the skew: each cylinder starts the order of the sectors 13 places further on (6026H). |
| 656CH-657DH 18 bytes | DEFB 00H, 06H, 0CH, 01H, 07H, 0DH, 02H, 08H, 0EH, 03H, 09H, 0FH, 04H, 0AH, 10H, 05H, 0BH, 11H 656CH-657DH: the order of the 18 sectors on the track (an interleave of 3). |
| 657EH-658BH 14 bytes | DEFB EEH x 14 657EH-658BH: EEH (minus 18) fourteen times, the skew plus 1: a pointer that runs past the last sector number moves back 18 places (60C2H-60CBH). |
| 658CH-658DH 2 bytes | DEFB 20H, 4EH 658CH-658DH: 32 bytes of 4EH, the gap at the start of the track. |
| 658EH 1 byte | DEFB F1H 658EH: F1H, the start of the part built once for each of the 18 sectors. |
| 658FH-6590H 2 bytes | DEFB 0CH, 00H 658FH-6590H: 12 bytes of 00H before the ID field. |
| 6591H-6592H 2 bytes | DEFB 03H, F5H 6591H-6592H: 3 bytes F5H: the controller writes the sync byte A1H with a missing clock bit before the address mark. |
| 6593H-6594H 2 bytes | DEFB 01H, FEH 6593H-6594H: 1 byte FEH, the ID address mark. |
| 6595H 1 byte | DEFB F3H 6595H: F3H, the address of the next byte of the track goes into the table at 6C00H: the ID field's cylinder byte. |
| 6596H-6597H 2 bytes | DEFB 03H, 00H 6596H-6597H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 6598H-6599H 2 bytes | DEFB 01H, 01H 6598H-6599H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 659AH-659BH 2 bytes | DEFB 01H, F7H 659AH-659BH: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 659CH-659DH 2 bytes | DEFB 16H, 4EH 659CH-659DH: 22 bytes of 4EH, the gap after the ID field. |
| 659EH-659FH 2 bytes | DEFB 0CH, 00H 659EH-659FH: 12 bytes of 00H before the data field. |
| 65A0H-65A1H 2 bytes | DEFB 03H, F5H 65A0H-65A1H: 3 bytes F5H, the sync bytes A1H before the data address mark. |
| 65A2H-65A3H 2 bytes | DEFB 01H, FBH 65A2H-65A3H: 1 byte FBH, the data address mark. |
| 65A4H-65A7H 4 bytes | DEFB F5H, 80H, 6DH, B6H 65A4H-65A7H: F5H: the pair after the count is put that many times, 80H (128) pairs 6DH B6H, the 256 bytes of the sector's data. |
| 65A8H-65A9H 2 bytes | DEFB 01H, F7H 65A8H-65A9H: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 65AAH-65ABH 2 bytes | DEFB 01H, 4EH 65AAH-65ABH: 1 byte 4EH, the start of the gap after the data field. |
| 65ACH-65ADH 2 bytes | DEFB 17H, 4EH 65ACH-65ADH: 23 bytes of 4EH, the rest of the gap after the data field. |
| 65AEH 1 byte | DEFB F2H 65AEH: F2H, the end of the part built for each sector. |
| 65AFH-65B0H 2 bytes | DEFB B6H, 4EH 65AFH-65B0H: 182 bytes of 4EH, the gap at the end of the track. |
| 65B1H 1 byte | DEFB F4H 65B1H: F4H, the end of the template; 6085H finishes the track there. |
| 65B2H-65C3H 18 bytes | DEFB 00H, 0CH, 07H, 02H, 0EH, 09H, 04H, 10H, 0BH, 06H, 01H, 0DH, 08H, 03H, 0FH, 0AH, 05H, 11H 65B2H-65C3H: 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. |
| 65C4H 1 byte | DEFB 10H 65C4H, template +00H: 10H, 16 sectors on a track (6016H). |
| 65C5H 1 byte | DEFB 02H 65C5H, template +01H: 02H, the skew: each cylinder starts the order of the sectors 2 places further on (6026H). |
| 65C6H-65D5H 16 bytes | DEFB 0AH, 05H, 00H, 0BH, 06H, 01H, 0CH, 07H, 02H, 0DH, 08H, 03H, 0EH, 09H, 04H, 0FH 65C6H-65D5H: the order of the 16 sectors on the track (an interleave of 3). |
| 65D6H-65D8H 3 bytes | DEFB F0H x 3 65D6H-65D8H: F0H (minus 16) three times, the skew plus 1: a pointer that runs past the last sector number moves back 16 places (60C2H-60CBH). |
| 65D9H-65DAH 2 bytes | DEFB 28H, FFH 65D9H-65DAH: 40 bytes of FFH, the gap at the start of the track. |
| 65DBH 1 byte | DEFB F1H 65DBH: F1H, the start of the part built once for each of the 16 sectors. |
| 65DCH-65DDH 2 bytes | DEFB 06H, 00H 65DCH-65DDH: 6 bytes of 00H before the ID field. |
| 65DEH-65DFH 2 bytes | DEFB 01H, FEH 65DEH-65DFH: 1 byte FEH, the ID address mark. |
| 65E0H 1 byte | DEFB F3H 65E0H: F3H, the address of the next byte of the track goes into the table at 6C00H: the ID field's cylinder byte. |
| 65E1H-65E2H 2 bytes | DEFB 03H, 00H 65E1H-65E2H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 65E3H-65E4H 2 bytes | DEFB 01H, 01H 65E3H-65E4H: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 65E5H-65E6H 2 bytes | DEFB 01H, F7H 65E5H-65E6H: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 65E7H-65E8H 2 bytes | DEFB 0BH, FFH 65E7H-65E8H: 11 bytes of FFH, the gap after the ID field. |
| 65E9H-65EAH 2 bytes | DEFB 06H, 00H 65E9H-65EAH: 6 bytes of 00H before the data field. |
| 65EBH-65ECH 2 bytes | DEFB 01H, FBH 65EBH-65ECH: 1 byte FBH, the data address mark. |
| 65EDH-65EEH 2 bytes | DEFB 00H, E5H 65EDH-65EEH: 256 bytes of E5H (a count of 00H), the data of the sector. |
| 65EFH-65F0H 2 bytes | DEFB 01H, F7H 65EFH-65F0H: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 65F1H-65F2H 2 bytes | DEFB 01H, FFH 65F1H-65F2H: 1 byte FFH, the start of the gap after the data field. |
| 65F3H-65F4H 2 bytes | DEFB 14H, FFH 65F3H-65F4H: 20 bytes of FFH, the rest of the gap after the data field. |
| 65F5H 1 byte | DEFB F2H 65F5H: F2H, the end of the part built for each sector. |
| 65F6H-65F7H 2 bytes | DEFB D0H, FFH 65F6H-65F7H: 208 bytes of FFH, the gap at the end of the track. |
| 65F8H 1 byte | DEFB F4H 65F8H: F4H, the end of the template; 6085H finishes the track there. |
| 65F9H-6608H 16 bytes | DEFB 0AH, 00H, 06H, 0CH, 02H, 08H, 0EH, 04H, 05H, 0BH, 01H, 07H, 0DH, 03H, 09H, 0FH 65F9H-6608H: 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. |
| 6609H 1 byte | DEFB 1EH 6609H, template +00H: 1EH, 30 sectors on a track (6016H). |
| 660AH 1 byte | DEFB 03H 660AH, template +01H: 03H, the skew: each cylinder starts the order of the sectors 3 places further on (6026H). |
| 660BH-6628H 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 660BH-6628H: the order of the 30 sectors on the track (an interleave of 5). |
| 6629H-662CH 4 bytes | DEFB E2H x 4 6629H-662CH: E2H (minus 30) four times, the skew plus 1: a pointer that runs past the last sector number moves back 30 places (60C2H-60CBH). |
| 662DH-662EH 2 bytes | DEFB 14H, 4EH 662DH-662EH: 20 bytes of 4EH, the gap at the start of the track. |
| 662FH 1 byte | DEFB F1H 662FH: F1H, the start of the part built once for each of the 30 sectors. |
| 6630H-6631H 2 bytes | DEFB 0CH, 00H 6630H-6631H: 12 bytes of 00H before the ID field. |
| 6632H-6633H 2 bytes | DEFB 03H, F5H 6632H-6633H: 3 bytes F5H: the controller writes the sync byte A1H with a missing clock bit before the address mark. |
| 6634H-6635H 2 bytes | DEFB 01H, FEH 6634H-6635H: 1 byte FEH, the ID address mark. |
| 6636H 1 byte | DEFB F3H 6636H: F3H, the address of the next byte of the track goes into the table at 6C00H: the ID field's cylinder byte. |
| 6637H-6638H 2 bytes | DEFB 03H, 00H 6637H-6638H: 3 bytes of 00H, the cylinder, side and sector of the ID field, filled in for each cylinder by 60B2H-60CDH. |
| 6639H-663AH 2 bytes | DEFB 01H, 01H 6639H-663AH: 1 byte 01H, the size code of the ID field: 256 bytes. |
| 663BH-663CH 2 bytes | DEFB 01H, F7H 663BH-663CH: 1 byte F7H: the controller writes the two CRC bytes of the ID field. |
| 663DH-663EH 2 bytes | DEFB 16H, 4EH 663DH-663EH: 22 bytes of 4EH, the gap after the ID field. |
| 663FH-6640H 2 bytes | DEFB 0CH, 00H 663FH-6640H: 12 bytes of 00H before the data field. |
| 6641H-6642H 2 bytes | DEFB 03H, F5H 6641H-6642H: 3 bytes F5H, the sync bytes A1H before the data address mark. |
| 6643H-6644H 2 bytes | DEFB 01H, FBH 6643H-6644H: 1 byte FBH, the data address mark. |
| 6645H-6648H 4 bytes | DEFB F5H, 80H, 6DH, B6H 6645H-6648H: F5H: the pair after the count is put that many times, 80H (128) pairs 6DH B6H, the 256 bytes of the sector's data. |
| 6649H-664AH 2 bytes | DEFB 01H, F7H 6649H-664AH: 1 byte F7H: the controller writes the two CRC bytes of the data field. |
| 664BH-664CH 2 bytes | DEFB 01H, FFH 664BH-664CH: 1 byte FFH after the data field's CRC (the other templates of double density put 4EH here). |
| 664DH-664EH 2 bytes | DEFB 11H, 4EH 664DH-664EH: 17 bytes of 4EH, the gap after the data field. |
| 664FH 1 byte | DEFB F2H 664FH: F2H, the end of the part built for each sector. |
| 6650H-6651H 2 bytes | DEFB 00H, 4EH 6650H-6651H: 256 bytes of 4EH (a count of 00H), the first part of the gap at the end of the track. |
| 6652H-6653H 2 bytes | DEFB 3DH, 4EH 6652H-6653H: 61 bytes of 4EH, the rest of the gap at the end of the track. |
| 6654H 1 byte | DEFB F4H 6654H: F4H, the end of the template; 6085H finishes the track there. |
| 6655H-6672H 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 6655H-6672H: 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. |
| 6673H 1 byte | DEFB 1DH 6673H: 1DH, the cursor to the start of its line: the start of the text of 6095H. |
| 6674H-6689H 22 bytes | DEFM "Formatting cylinder " 6674H-6689H: Formatting cylinder and three spaces; 648AH writes the cylinder number over the last two. |
| 668AH 1 byte | DEFB 03H 668AH: 03H, the end of the text: the cursor stays after the spaces. |
| 668BH 1 byte | DEFB 1DH 668BH: 1DH, the cursor to the start of its line: the start of the text of 6136H. |
| 668CH-66A1H 22 bytes | DEFM "Verifying cylinder " 668CH-66A1H: Verifying, two spaces, cylinder and three spaces, as long as the text above; 648AH writes the cylinder number over the last two. |
| 66A2H 1 byte | DEFB 03H 66A2H: 03H, the end of the text: the cursor stays after the spaces. |
| 66A3H-66A6H 4 bytes | DEFM "* " 66A3H-66A6H: an asterisk and three spaces, displayed after the number of a cylinder that failed the verify (61A4H). |
| 66A7H 1 byte | DEFB 03H 66A7H: 03H, the end of the text: the next cylinder number goes two places before its end. |
| 66A8H-66B4H 13 bytes | DEFM "Formatting..." 66A8H-66B4H: Formatting..., displayed before the driver's function 0CH (61CCH). |
| 66B5H 1 byte | DEFB 0DH 66B5H: 0DH, the end of the line and of the text. |
| 66B6H-66DAH 37 bytes | DEFM "No cylinders available for directory!" 66B6H-66DAH: the text 6235H points to when no cylinder can take the directory; the JP 63D5H after it displays Format aborted! instead. |
| 66DBH 1 byte | DEFB 0DH 66DBH: 0DH, the end of the line and of the text. |
| 66DCH-6700H 37 bytes | DEFM "Directory will be placed on cylinder " 66DCH-6700H: Directory will be placed on cylinder and a space, displayed by 6246H. |
| 6701H-6702H 2 bytes | DEFM "00" 6701H-6702H: two digits, 00 in the file: 6242H stores the directory cylinder here. |
| 6703H 1 byte | DEFB 0DH 6703H: 0DH, the end of the line and of the text. |
| 6704H 1 byte | DEFB 0AH 6704H: 0AH, a new line: the start of the text of 624CH. |
| 6705H-6724H 32 bytes | DEFM "Initializing SYSTEM information " 6705H-6724H: Initializing SYSTEM information and a space; the periods and plus signs of the sectors written follow on the line. |
| 6725H 1 byte | DEFB 03H 6725H: 03H, the end of the text: the cursor stays at its end. |
| 6726H 1 byte | DEFB 0AH 6726H: 0AH, a new line: the start of the text of 63F2H. |
| 6727H-674AH 36 bytes | DEFM "Load SYSTEM diskette and hit <ENTER>" 6727H-674AH: Load SYSTEM diskette and hit <ENTER>, displayed after a format of drive 0. |
| 674BH 1 byte | DEFB 0DH 674BH: 0DH, the end of the line and of the text. |
| 674CH 1 byte | DEFB 0AH 674CH: 0AH, a new line: the start of the text of 63BEH. |
| 674DH-675FH 19 bytes | DEFM "Formatting complete" 674DH-675FH: Formatting complete, displayed and written to the job log by @LOGOT at the end. |
| 6760H 1 byte | DEFB 0DH 6760H: 0DH, the end of the line and of the text. |
| 6761H 1 byte | DEFB 0AH 6761H: 0AH, a new line: the start of the text of 63C4H. |
| 6762H-6788H 39 bytes | DEFM "Note: Realtime clock no longer accurate" 6762H-6788H: Note: Realtime clock no longer accurate, since the clock interrupt was shut out while the tracks were written. |
| 6789H 1 byte | DEFB 0DH 6789H: 0DH, the end of the line and of the text. |
| 678AH-6798H 15 bytes | DEFM "Format aborted!" 678AH-6798H: Format aborted!, the text of 63D5H, displayed and written to the job log. |
| 6799H 1 byte | DEFB 0DH 6799H: 0DH, the end of the line and of the text. |
| 679AH-67B7H 30 bytes | DEFM "Can't, Diskette not formatted!" 679AH-67B7H: the text of 627AH, for a diskette whose cylinder 0, sector 0 cannot be read when only the system information is to be written. |
| 67B8H 1 byte | DEFB 0DH 67B8H: 0DH, the end of the line and of the text. |
| 67B9H-67D8H 32 bytes | DEFB 00H x 32 67B9H-67D8H: 32 bytes of 00H at the end of the block. No code addresses them. |
| 67D9H-67FFH 39 bytes | DEFS 39 67D9H-67FFH: not in the file, and no code of FORMAT uses it. |
| 6800H-6801H 2 bytes | DEFW 6A95H 6800H-6801H: 6A95H, +95H of the image of boot sector 0, the operand of its Seek command LD A,18H (4395H when the sector runs), read by 626CH. |
| 6802H-6803H 2 bytes | DEFW 6B95H 6802H-6803H: 6B95H, +95H of the image of boot sector 1, the operand of its Seek command LD A,18H (4395H when the sector runs), read by 6299H. |
| 6804H-68FFH 252 bytes | DEFS 252 6804H-68FFH: not in the file, and no code of FORMAT uses it. |
| 6900H-69CAH 203 bytes | DEFS 203 6900H-69CAH: not in the file. The allocation table image, +00H-+CAH: 6900H-695FH one byte for each cylinder, a bit set for each granule not free (the front end fills it, 6FD8H; the verify sets FFH for a bad cylinder, 61AEH); 6960H-69BFH the lock out table (6191H copies the allocation bytes there); 69C0H-69CAH what memory holds. |
| 69CBH 1 byte | DEFB 53H 69CBH, the allocation table +CBH: 53H, written to the diskette as it is. |
| 69CCH 1 byte | DEFB 00H 69CCH, +CCH: the number of cylinders less 35, 00H in the file, stored by 62B8H. |
| 69CDH 1 byte | DEFB 00H 69CDH, +CDH: the configuration byte, 00H in the file, stored by 62D6H (bit 7 and bit 3 always, bit 6 double density, bit 5 two sides, bit 4 (cylinder 0 single density) never set by this file, bits 2-0 the granules on a track less one). |
| 69CEH-69CFH 2 bytes | DEFW 0000H 69CEH-69CFH, +CEH-+CFH: the hash of the master password, 0000H in the file, stored by the front end (6E71H). |
| 69D0H-69D7H 8 bytes | DEFM " " 69D0H-69D7H, +D0H-+D7H: the diskette name, eight spaces in the file, stored by the front end (6DEFH, 6E19H). |
| 69D8H-69DFH 8 bytes | DEFM "MM/DD/YY" 69D8H-69DFH, +D8H-+DFH: the date the diskette is formatted, MM/DD/YY in the file, stored by the front end (6E1EH). |
| 69E0H 1 byte | DEFB 0DH 69E0H, +E0H: 0DH, the AUTO command of the diskette: none. |
| 69E1H-69FFH 31 bytes | DEFM " " 69E1H-69FFH, +E1H-+FFH: 31 spaces, the rest of the AUTO command field. |
| 6AE6H-6AE7H 2 bytes | DEFB 17H, E8H The start of the Disk error message: 17H turns the display to 32 characters a line and E8H is a space compression code that moves the cursor on by 40 spaces. |
| 6AE8H-6AF1H 10 bytes | DEFM "Disk error" The ten characters Disk error, displayed by 4387H when a sector cannot be read in five tries. |
| 6AF2H-6AF3H 2 bytes | DEFB 1FH, 03H The end of the Disk error message: 1FH clears from the cursor to the end of the screen and 03H ends the text for the ROM routine at 021BH. |
| 6AF4H-6AF5H 2 bytes | DEFB 17H, E8H The start of the No system message, at 43F4H, the operand of the LD IX at 4383H and of the LD HL read from 4384H: 17H selects 32 characters a line and E8H moves the cursor on by 40 spaces. |
| 6AF6H-6AFEH 9 bytes | DEFM "No system" The nine characters No system, displayed when the directory entry of SYS0/SYS is not in use. |
| 6AFFH 1 byte | DEFB 03H The end byte of the No system message for the ROM routine at 021BH, and the last byte of the boot sector. |
| 6BE6H-6BE7H 2 bytes | DEFB 17H, E8H The start of the Disk error message: 17H turns the display to 32 characters a line and E8H is a space compression code that moves the cursor on by 40 spaces. |
| 6BE8H-6BF1H 10 bytes | DEFM "Disk error" The ten characters Disk error, displayed by 4387H when a sector cannot be read in five tries. |
| 6BF2H-6BF3H 2 bytes | DEFB 1FH, 03H The end of the Disk error message: 1FH clears from the cursor to the end of the screen and 03H ends the text for the ROM routine at 021BH. |
| 6BF4H-6BF5H 2 bytes | DEFB 17H, E8H The start of the No system message, at 43F4H, the operand of the LD IX at 4383H and of the LD HL read from 4384H: 17H selects 32 characters a line and E8H moves the cursor on by 40 spaces. |
| 6BF6H-6BFEH 9 bytes | DEFM "No system" The nine characters No system, displayed when the directory entry of SYS0/SYS is not in use. |
| 6BFFH 1 byte | DEFB 03H The end byte of the No system message for the ROM routine at 021BH, and the last byte of the boot sector. |
| 6C00H-6CFFH 256 bytes | DEFS 256 6C00H-6CFFH: 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 (646CH, 6D7AH); the sector read from the target diskette (706DH-70B9H); then the sectors FORMAT writes: the system information sector, the hash index table, the directory records and the empty directory sectors (62ECH-63B9H). |
| 7163H-716CH 10 bytes | DEFS 10 7163H-716CH: not in the file. The copy of the working drive code table taken at 7015H and put back at 70E4H. |
| 716DH-7174H 8 bytes | DEFS 8 716DH-7174H: not in the file. The highest cylinder of drives 0-7 from the system information sector (6D2DH); 6DB9H takes the target drive's. |
| 717BH-7182H 8 bytes | DEFM " " 717BH-7182H: the master password, eight spaces in the file: filled from the command line, the reply or PASSWORD (6E31H-6E68H), then checked and hashed (70FFH). |
| 7183H 1 byte | DEFB 20H 7183H: a space after the buffer. The ROM's line input puts its 0DH here after a reply of 8 characters (6E53H). |
| 7184H-719BH 24 bytes | DEFM "Can't " / DEFB 22H / DEFM "SYSTEM" / DEFB 22H / DEFM " a floppy!" 7184H-719BH: the text of 712AH, Can't "SYSTEM" a floppy!, for SYSTEM given for a drive that is not a hard disk (6DD7H). |
| 719CH 1 byte | DEFB 0DH 719CH: 0DH, the end of the line and of the text. |
| 719DH-71A4H 8 bytes | DEFM "NAME " / DEFW 6DE1H 719DH-71A4H: NAME, the diskette name: the operand of LD HL,0000H at 6DE0H. |
| 71A5H-71ACH 8 bytes | DEFM "N " / DEFW 6DE1H 71A5H-71ACH: N, the short form of NAME: 6DE1H. |
| 71ADH-71B4H 8 bytes | DEFM "MPW " / DEFW 6E24H 71ADH-71B4H: MPW, the master password: the operand of LD HL,0000H at 6E23H. |
| 71B5H-71BCH 8 bytes | DEFM "M " / DEFW 6E24H 71B5H-71BCH: M, the short form of MPW: 6E24H. |
| 71BDH-71C4H 8 bytes | DEFM "SDEN " / DEFW 6D57H 71BDH-71C4H: SDEN, single density: the operand of LD DE,0000H at 6D56H. |
| 71C5H-71CCH 8 bytes | DEFM "DDEN " / DEFW 6D5CH 71C5H-71CCH: DDEN, double density: the operand of LD DE,0000H at 6D5BH. |
| 71CDH-71D4H 8 bytes | DEFM "SIDES " / DEFW 6D61H 71CDH-71D4H: SIDES=n, the sides: the operand of LD DE,0000H at 6D60H. |
| 71D5H-71DCH 8 bytes | DEFM "CYL " / DEFW 6D66H 71D5H-71DCH: CYL=n, the cylinders: the operand of LD DE,0000H at 6D65H. |
| 71DDH-71E4H 8 bytes | DEFM "C " / DEFW 6D66H 71DDH-71E4H: C, the short form of CYL: 6D66H. |
| 71E5H-71ECH 8 bytes | DEFM "STEP " / DEFW 6D6BH 71E5H-71ECH: STEP=n, the bootstrap step rate: the operand of LD DE,FF00H at 6D6AH. |
| 71EDH-71F4H 8 bytes | DEFM "ABS " / DEFW 70C2H 71EDH-71F4H: ABS, no question for a diskette that holds data: the operand of LD DE,0000H at 70C1H. |
| 71F5H-71FCH 8 bytes | DEFM "A " / DEFW 70C2H 71F5H-71FCH: A, the short form of ABS: 70C2H. |
| 71FDH-7204H 8 bytes | DEFM "QUERY " / DEFW 6EB1H 71FDH-7204H: QUERY, ask the questions (FFFFH) or not (0000H): the operand of LD DE,FFFFH at 6EB0H. |
| 7205H-720CH 8 bytes | DEFM "Q " / DEFW 6EB1H 7205H-720CH: Q, the short form of QUERY: 6EB1H. |
| 720DH-7214H 8 bytes | DEFM "SYSTEM" / DEFW 61C6H 720DH-7214H: SYSTEM, only the system information, for a hard disk (refused for a floppy, 6DD7H): the operand of LD HL,0000H at 61C5H. |
| 7215H-721CH 8 bytes | DEFM "WAIT " / DEFW 6126H 7215H-721CH: WAIT=n, a wait after each step: the operand of LD BC,0000H at 6125H. |
| 721DH-7224H 8 bytes | DEFM "W " / DEFW 6126H 721DH-7224H: W, the short form of WAIT: 6126H. |
| 7225H-722CH 8 bytes | DEFM "DIR " / DEFW 620DH 7225H-722CH: DIR=n, the cylinder of the directory: the operand of LD BC,0000H at 620CH. |
| 722DH-7234H 8 bytes | DEFM "D " / DEFW 620DH 722DH-7234H: D, the short form of DIR: 620DH. |
| 7235H 1 byte | DEFB 00H 7235H: 00H, the end of the table: @PARAM stops here. |
| 7236H-7237H 2 bytes | DEFB 1CH, 1FH 7236H-7237H: 1CH, the cursor to the top left, and 1FH, clear to the end of the screen: the start of the banner (6D01H). |
| 7238H-726BH 52 bytes | DEFM "FORMAT - LDOS Disk Formatter Program - Version 5.3.1" 7238H-726BH: the name and the version of the program. |
| 726CH 1 byte | DEFB 0AH 726CH: 0AH, a new line: the copyright goes on the next line. |
| 726DH-729DH 49 bytes | DEFM "Copyright 1991 MISOSYS, Inc., All rights reserved" 726DH-729DH: the copyright line of the program, Copyright 1991 MISOSYS, Inc. |
| 729EH-729FH 2 bytes | DEFB 0AH, 0DH 729EH-729FH: 0AH, a new line, and 0DH, the end of the banner. |
| 72A0H-72C8H 41 bytes | DEFM "Insufficient memory for specified format!" 72A0H-72C8H: the text of 7059H, when HIGH$ leaves no room for the track. |
| 72C9H 1 byte | DEFB 0DH 72C9H: 0DH, the end of the line and of the text. |
| 72CAH-72E5H 28 bytes | DEFM "Which drive is to be used ? " 72CAH-72E5H: the question of 6D74H, when no :d is on the command line. |
| 72E6H 1 byte | DEFB 03H 72E6H: 03H, the end of the question: the cursor stays for the reply. |
| 72E7H-72F6H 16 bytes | DEFM "Diskette name ? " 72E7H-72F6H: the question of 6E0AH, for the diskette name. |
| 72F7H 1 byte | DEFB 03H 72F7H: 03H, the end of the question: the cursor stays for the reply. |
| 72F8H-7309H 18 bytes | DEFM "Master password ? " 72F8H-7309H: the question of 6E48H, for the master password. |
| 730AH 1 byte | DEFB 03H 730AH: 03H, the end of the question: the cursor stays for the reply. |
| 730BH-7330H 38 bytes | DEFM "Special non-standard format desired ? " 730BH-7330H: a question that no code of the file displays. |
| 7331H 1 byte | DEFB 03H 7331H: 03H, the end of the question that no code displays. |
| 7332H-7347H 22 bytes | DEFM "Number of cylinders ? " 7332H-7347H: the question of 6F29H, for a 5 inch floppy. |
| 7348H 1 byte | DEFB 03H 7348H: 03H, the end of the question: the cursor stays for the reply. |
| 7349H-7379H 49 bytes | DEFM "Boot strap stepping rate <6, 12, 20, 30 msecs> ? " 7349H-7379H: the question of 6F62H, for a 5 inch drive. It names 30 as the slowest rate, the slowest the Model III's DEVICE table knows for a 5 inch drive; the Model I text reads 30/40. |
| 737AH 1 byte | DEFB 03H 737AH: 03H, the end of the question: the cursor stays for the reply. |
| 737BH-73ACH 50 bytes | DEFM "Bootstrap stepping rate <3, 6, 10, 15/20 msecs> ? " 737BH-73ACH: the question of 6F8CH, for an 8 inch drive. |
| 73ADH 1 byte | DEFB 03H 73ADH: 03H, the end of the question: the cursor stays for the reply. |
| 73AEH-73CBH 30 bytes | DEFM "Enter number of sides <1,2> ? " 73AEH-73CBH: the question of 6EFEH, for the number of sides. |
| 73CCH 1 byte | DEFB 03H 73CCH: 03H, the end of the question: the cursor stays for the reply. |
| 73CDH-73EDH 33 bytes | DEFM "Single or Double density <S,D> ? " 73CDH-73EDH: the question of 6EC4H, for the density. |
| 73EEH 1 byte | DEFB 03H 73EEH: 03H, the end of the question: the cursor stays for the reply. |
| 73EFH-73FEH 16 bytes | DEFM "Drive not ready!" 73EFH-73FEH: the text of 7023H, when the controller's status shows NOT READY. |
| 73FFH 1 byte | DEFB 0DH 73FFH: 0DH, the end of the line and of the text. |
| 7400H-7414H 21 bytes | DEFM "Write protected disk!" 7400H-7414H: the text of 7038H, for a write protected diskette or drive. |
| 7415H 1 byte | DEFB 0DH 7415H: 0DH, the end of the line and of the text. |
| 7416H-7429H 20 bytes | DEFM "Drive not in system!" 7416H-7429H: the text of 702BH, when the head is not on track 0 after a Restore. |
| 742AH 1 byte | DEFB 0DH 742AH: 0DH, the end of the line and of the text. |
| 742BH-7453H 41 bytes | DEFM "Load destination diskette and hit <ENTER>" 742BH-7453H: the text of 6FF2H, for drive 0 and when no diskette turns. |
| 7454H 1 byte | DEFB 0DH 7454H: 0DH, the end of the line and of the text. |
| 7455H 1 byte | DEFB 0AH 7455H: 0AH, a new line: the start of the text of 7133H. |
| 7456H-746DH 24 bytes | DEFM "Invalid Master Password!" 7456H-746DH: the text of 7133H, for a password with other characters than letters and digits. |
| 746EH-746FH 2 bytes | DEFB 0AH, 0DH 746EH-746FH: 0AH, a new line, and 0DH, the end of the text. |
| 7470H-7485H 22 bytes | DEFM "Disk contains data -- " 7470H-7485H: the text of 7079H, followed on the line by one of the four texts below. |
| 7486H 1 byte | DEFB 03H 7486H: 03H, the end of the text: the cursor stays at its end. |
| 7487H-7499H 19 bytes | DEFM "Non-standard format" 7487H-7499H: the text of 707FH, for a diskette whose directory cylinder is not below the highest cylinder. |
| 749AH 1 byte | DEFB 0DH 749AH: 0DH, the end of the line and of the text. |
| 749BH-74AEH 20 bytes | DEFM "Unreadable directory" 749BH-74AEH: the text of 7099H, for a directory sector 0 without the deleted data mark. |
| 74AFH 1 byte | DEFB 0DH 74AFH: 0DH, the end of the line and of the text. |
| 74B0H-74C8H 25 bytes | DEFM "Non-initialized directory" 74B0H-74C8H: the text of 709EH, for a directory whose date has no slash. |
| 74C9H 1 byte | DEFB 0DH 74C9H: 0DH, the end of the line and of the text. |
| 74CAH-74CEH 5 bytes | DEFM "Name=" 74CAH-74CEH: Name=, the start of the text of 70BBH. |
| 74CFH-74D6H 8 bytes | DEFM "XXXXXXXX" 74CFH-74D6H: eight X in the file; 70B1H copies the diskette's name here. |
| 74D7H-74DDH 7 bytes | DEFM " Date=" 74D7H-74DDH: two spaces and Date=, between the name and the date. |
| 74DEH-74E5H 8 bytes | DEFM "MM/DD/YY" 74DEH-74E5H: MM/DD/YY in the file; 70B9H copies the diskette's date here. |
| 74E6H 1 byte | DEFB 0DH 74E6H: 0DH, the end of the line and of the text. |
| 74E7H-750EH 40 bytes | DEFM "*** The target drive is a hard disk! ***" 74E7H-750EH: the first line of the text of 61B3H. |
| 750FH 1 byte | DEFB 0AH 750FH: 0AH, a new line between the two lines of the text. |
| 7510H-7534H 37 bytes | DEFM "Are you sure you want to format it ? " 7510H-7534H: the question of 61B3H and, on its own, of 70CFH. |
| 7535H 1 byte | DEFB 03H 7535H: 03H, the end of the question: the cursor stays for the reply. |
| 7536H-753DH 8 bytes | DEFM "LDOSDISK" 7536H-753DH: LDOSDISK, the default diskette name (6DEBH). The 1992 manual (M-40-060) gives DOSDISK. |
| 753EH-7545H 8 bytes | DEFM "PASSWORD" 753EH-7545H: PASSWORD, the default master password (6E2EH). |
| 7546H-7565H 32 bytes | DEFB 00H x 32 7546H-7565H: 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 (64AFH). |
| 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). |
| 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). |
| 61C6H-61C7H 2 bytes | The operand of LD HL,0000H at 61C5H: SYSTEM, FFFFH when given; 6DCDH, 7044H and 7067H read its low byte. |
| 620DH-620EH 2 bytes | The operand of LD BC,0000H at 620CH: DIR=n. |
| 6363H 1 byte | The operand of LD A,00H at 6362H: the granules on a track less one (62D0H). |
| 63E2H 1 byte | The operand of LD A,00H at 63E1H: the byte of 4012H (600BH), 00H until the engine runs. |
| 642DH 1 byte | The operand of LD C,FFH at 642CH: the target drive (6D49H, 6D90H), FFH until it is known. |
| 64F9H, 64FBH, 64FCH 1 byte each | The ending record number (635FH), the cylinder (625CH, 6372H) and the granules (636CH) of DIR/SYS's record. |
| 6701H-6702H 2 bytes | The two digits of the directory cylinder in the text at 66DCH (6242H). |
| 6A02H, 6A95H 1 byte each | Boot sector 0: the directory cylinder (6265H) and the Seek command with the step rate (6273H). |
| 6B02H, 6B95H 1 byte each | Boot sector 1: the directory cylinder (6292H) and the Seek command with the step rate (62A0H). |
| 6D57H-6D58H, 6D5CH-6D5DH 2 bytes each | The operands of LD DE,0000H at 6D56H and 6D5BH: SDEN and DDEN, FFFFH when given. |
| 6D61H-6D62H, 6D66H-6D67H 2 bytes each | The operands of LD DE,0000H at 6D60H and 6D65H: SIDES=n and CYL=n. |
| 6D6BH-6D6CH 2 bytes | The operand of LD DE,FF00H at 6D6AH: STEP=n; 6D6BH the default rate (6D21H), 6D6CH FFH until STEP is given. |
| 6DE1H-6DE2H 2 bytes | The operand of LD HL,0000H at 6DE0H: NAME (@PARAM, or the QUERY value from 6D9EH). |
| 6E24H-6E25H 2 bytes | The operand of LD HL,0000H at 6E23H: MPW (@PARAM, or the QUERY value from 6DA9H). |
| 6EACH 1 byte | The operand of LD A,00H at 6EABH: not 0 when SDEN, DDEN, SIDES, CYL or STEP was given (6D6FH). |
| 6EB1H-6EB2H 2 bytes | The operand of LD DE,FFFFH at 6EB0H: QUERY, 0000H for Q=N. |
| 6EDFH-6EE0H, 6EEFH-6EF0H 2 bytes each | The operands of LD HL,0000H at 6EDEH and 6EEEH: the double and the single density descriptor of the drive's size (6E8DH, 6E88H). |
| 6F36H 1 byte | The operand of LD A,00H at 6F35H: the default cylinders of the drive (6DBBH). |
| 704EH-704FH 2 bytes | The operand of LD DE,0000H at 704DH: the memory the track takes (64C0H). |
| 70C2H-70C3H 2 bytes | The operand of LD DE,0000H at 70C1H: ABS, FFFFH when given. |
| 74CFH-74D6H, 74DEH-74E5H 8 bytes each | The name and the date of a diskette that holds data, in the text at 74CAH (70B1H, 70B9H). |
Memory Outside the File That FORMAT Uses
| Address Size | Contents |
|---|---|
| 6505H-650EH 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. |
| 6510H-6511H 2 bytes | The sectors on a cylinder and on a track of the format. |
| 6900H-69CAH 203 bytes | The allocation table image: 6900H-695FH a byte for each cylinder (6FD8H), FFH after the last; 6960H-69BFH the lock out table; 69C0H-69CAH FFH. |
| 6C00H-6CFFH 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 (62ECH-63B9H) and read (705FH-70B9H). |
| 6D00H- up to 10673 bytes | The track built by 6013H, over the front end, and 256 bytes of FFH after it. |
| 7163H-716CH 10 bytes | The working table saved during the checks of the diskette (7015H, 70E4H). |
| 716DH-7174H 8 bytes | The highest cylinder of drives 0-7 from the system information sector (6D2DH). |
Disassembly
6000H - The Format Engine: Entry
The front end ends with JP 6000H (70E9H) after it has put the drive code table of the target drive, with every choice made, into the working copy at 6505H-650EH and pointed Index Register IY at it. A drive whose table has bit 4 of +04H set gets no tracks written (61B3H). For every other drive the clock interrupt is shut out: the byte at 4012H, the JP of the interrupt vector, becomes a RET until 63E1H puts it back.
6013H - Expand the Track Template
The template (one of four, 652AH-6673H, chosen by 64ABH) 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 6D00H up, over the front end, which has finished; the address of every ID field goes into the table at 6C00H.
6095H - Format Every Cylinder
The track in the buffer at 6D00H 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 70E6H) 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 6900H (no granule free); any other error ends the format.
619AH - 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.
61B3H - 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 61F8H for a hard disk, through the lock out table copy at 6186H for any other drive.
61F8H - Choose the Directory Cylinder
Register L starts as the highest cylinder (6201H, the path of a floppy after the verify) or, for a hard disk, as the directory cylinder of the drive's own table (+09H) when that is below the highest cylinder. The directory goes on the cylinder given by DIR=n when it is below Register L, else on the middle cylinder, (Register L + 1) / 2; 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, into the text 66DCH and, at 6252H on, into the first extent of DIR/SYS and both boot sectors.
6252H - 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. Both boot sector images (6A00H and 6B00H) hold the same Model III boot sector, the sector 1 of BOOT/SYS: the Model III ROM reads cylinder 0, sector 1 into 4300H and runs it, and sector 0 is a copy byte for byte. Each image gets the directory cylinder at its +02H (6A02H, 6B02H: 4302H, the operand of CP at 4301H when it runs) and the bootstrap step rate (650FH) in bits 1-0 of its Seek command at +95H (6A95H, 6B95H: 4395H, the operand of LD A,18H at 4394H), through the pointers at 6800H and 6802H. Sector 0 is verified before anything is written: a drive that was never formatted (the paths that write no tracks) ends here.
62B3H - The Allocation Table: Cylinder 0, Sector 3; the System Information: Sector 2
+CCH and +CDH of the allocation table image at 6900H are built from the working 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. The Model III file has no second pass over cylinder 0 and keeps no copy of the table, so the configuration byte has no single density cylinder 0 bit (bit 4 stays 0).
6305H - 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 6438H, 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.
63BBH - 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.
63D0H - A Period, the Abort, and Putting Back the Interrupt Vector
63D0H displays a period. 63D5H displays Format aborted! (63D8H another text at Register Pair HL), writes it to the job log, puts back the interrupt vector and ends at @ABORT. 63E1H 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.
6401H - 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 (6505H), 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 642AH, which puts the function into Register B and the drive into Register C, as the driver wants them (SYS0/SYS's floppy driver, 4583H). 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.
6438H - Verify a Directory Sector, the Error Exits, Small Helpers
6438H 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. 6448H reports a disk error and ends the program; 6452H gives error 2CH. 6456H turns a number into two digits, 6463H and 646AH read a reply from the keyboard, 648AH writes two digits over the last two on the screen, 649CH and 64ABH put a track descriptor into effect.
64C5H - 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, 6334H-6350H) and DIR/SYS as record 1 (sector 3, 6375H-6391H). Their hash index table bytes are A2H and C4H (631BH-631EH). 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 (625CH, 635FH, 636CH, 6372H).
6505H - The Working Drive Code Table and the Counts
6505H-650EH, not in the file, is the working copy of the target drive's drive code table (Index Register IY all through the engine); 650FH the bootstrap step rate; 6510H-6511H, not in the file, the sectors on a cylinder and on a track of the format.
6512H - 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 6D00H. The front end picks the pair for the drive's size (6512H for 5 inch, 651EH for 8 inch), the first of a pair for single density and the second for double density; 649CH or 64ABH put it into effect.
652AH - 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.
656AH - 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.
65C4H - Template: 8 Inch, Single Density
16 sectors of 256 bytes, skew 2. The same fields as the 5 inch single density template (652AH) with longer gaps. The track is 5176 bytes.
6609H - Template: 8 Inch, Double Density
30 sectors of 256 bytes, skew 3. The same fields as the 5 inch double density template (656AH) with other gaps. The track is 10357 bytes.
6673H - 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.
6704H - The Engine's Texts (2)
The texts of the system information, of the end and of the errors, and 32 bytes of 00H that end the block. The Model I file has one more text before them, the line of its second pass over cylinder 0 in single density, which the Model III file does not make.
67D9H - Memory Not in the File, the Boot Sector Pointers, the Allocation Table Image
67D9H-67FFH and 6804H-68FFH are not used. 6800H-6803H point to the Seek command byte of each boot sector image. 6900H-69FFH is the image of the allocation table, with the offsets of the sector: 6900H-69CAH is built at run time and not in the file; 69CBH-69FFH holds the fields after it.
6A00H - Image of Boot Sector 0 (Runs at 4300H)
The 256 bytes 6A00H-6AFFH are the sector FORMAT writes to cylinder 0, sector 0 (6280H-6289H). They are the Model III boot sector, byte for byte the same as the image of boot sector 1 at 6B00H and as sector 1 of BOOT/SYS, but for +02H (6A02H: 11H in the file, the directory cylinder, stored by 6265H) and +95H (6A95H: the Seek command 18H, whose bits 1-0 6273H sets to the bootstrap step rate; BOOT/SYS of the system diskette has 14H and 1BH there). The Model III ROM boots from sector 1, so sector 0 is a copy that no reset runs. The rows show the code as it would run at 4300H: the addresses in the comments are run addresses, 4300H plus the offset in the image, and the branches are linked to the rows of this image.
6A2AH - Image of Boot Sector 0: Load SYS0/SYS Record by Record (Runs at 432AH)
SYS0/SYS is a load module: each record is a type byte, a length byte and that many bytes. Type 01H is a load block (the load address, then the data), type 02H the transfer address; any other type is passed over. Register B counts the bytes of a record and Register Pair HL holds the load address.
6A4EH - Image of Boot Sector 0: Fetch a Record Length and Address (Runs at 434EH)
Fetches the length byte and the two address bytes of a load block or transfer record. Register B returns the length less 2 (the data bytes that follow the address) and Register Pair HL the address.
6A5DH - Image of Boot Sector 0: Fetch the Next Byte of SYS0/SYS (Runs at 435DH)
Returns the next byte of SYS0/SYS in Register A. The alternate registers keep the reading position: Register Pair HL' the pointer into the buffer at 5100H-51FFH and Register Pair DE' the cylinder and sector of the next sector to read. When the pointer passes 51FFH, the next sector is read first.
6A74H - Image of Boot Sector 0: Read a Sector, Five Tries (Runs at 4374H)
Reads cylinder Register D, sector Register E into the buffer at 5100H, trying up to five times. On return Register A holds the controller status masked with 1CH and the Z FLAG is set if the read succeeded; Register Pair DE is kept.
6A80H - Image of Boot Sector 0: Display Disk error or No system and Restart (Runs at 4380H)
Entered at 4380H when a sector cannot be read in five tries, and at 4384H (inside the LD IX at 4383H) when the directory entry of SYS0/SYS is not in use. Displays the message, waits for a line from the keyboard and restarts the computer.
6A8EH - Image of Boot Sector 0: Seek and Read One Sector (Runs at 438EH)
Seeks cylinder Register D and reads sector Register E into 5100H-51FFH through ports F0H-F4H. The controller's data request holds the CPU in wait states for each byte, and the interrupt at the end of the command arrives as an NMI at 43D3H, which returns to the caller with the status in Register A. Register Pair DE is kept.
6AD3H - Image of Boot Sector 0: End of Read (NMI) (Runs at 43D3H)
Reached through the NMI vector at 4049H (JP 43D3H, set at 43A8H-43B2H) when the Read Sector command ends. The stack holds the address the NMI interrupted (43D1H), Register Pair DE pushed at 43B6H and the return address into 4374H.
6ADFH - Image of Boot Sector 0: Send a Command to the Controller (Runs at 43DFH)
Sends the command in Register A to port F0H, then waits a short time for the status to be valid. Register B returns 00H.
6AE6H - Image of Boot Sector 0: The Two Messages (Runs at 43E6H)
The texts 4387H displays through the ROM routine at 021BH, each ending in 03H.
6B00H - Image of Boot Sector 1 (Runs at 4300H)
The 256 bytes 6B00H-6BFFH are the sector FORMAT writes to cylinder 0, sector 1 (62A1H-62ADH), the sector the Model III ROM reads into 4300H-43FFH at a reset and jumps to. It reads sector 4 of the directory cylinder (the directory entry of SYS0/SYS) into 5100H, checks that the entry is in use, works out from its first extent where SYS0/SYS starts and loads SYS0/SYS record by record until the transfer record sends it to SYS0/SYS. +02H (6B02H) gets the directory cylinder (6292H) and bits 1-0 of the Seek command at +95H (6B95H) the bootstrap step rate (62A0H). The rows show the code as it runs at 4300H: the addresses in the comments are run addresses, 4300H plus the offset in the image, and the branches are linked to the rows of this image.
6B2AH - Image of Boot Sector 1: Load SYS0/SYS Record by Record (Runs at 432AH)
SYS0/SYS is a load module: each record is a type byte, a length byte and that many bytes. Type 01H is a load block (the load address, then the data), type 02H the transfer address; any other type is passed over. Register B counts the bytes of a record and Register Pair HL holds the load address.
6B4EH - Image of Boot Sector 1: Fetch a Record Length and Address (Runs at 434EH)
Fetches the length byte and the two address bytes of a load block or transfer record. Register B returns the length less 2 (the data bytes that follow the address) and Register Pair HL the address.
6B5DH - Image of Boot Sector 1: Fetch the Next Byte of SYS0/SYS (Runs at 435DH)
Returns the next byte of SYS0/SYS in Register A. The alternate registers keep the reading position: Register Pair HL' the pointer into the buffer at 5100H-51FFH and Register Pair DE' the cylinder and sector of the next sector to read. When the pointer passes 51FFH, the next sector is read first.
6B74H - Image of Boot Sector 1: Read a Sector, Five Tries (Runs at 4374H)
Reads cylinder Register D, sector Register E into the buffer at 5100H, trying up to five times. On return Register A holds the controller status masked with 1CH and the Z FLAG is set if the read succeeded; Register Pair DE is kept.
6B80H - Image of Boot Sector 1: Display Disk error or No system and Restart (Runs at 4380H)
Entered at 4380H when a sector cannot be read in five tries, and at 4384H (inside the LD IX at 4383H) when the directory entry of SYS0/SYS is not in use. Displays the message, waits for a line from the keyboard and restarts the computer.
6B8EH - Image of Boot Sector 1: Seek and Read One Sector (Runs at 438EH)
Seeks cylinder Register D and reads sector Register E into 5100H-51FFH through ports F0H-F4H. The controller's data request holds the CPU in wait states for each byte, and the interrupt at the end of the command arrives as an NMI at 43D3H, which returns to the caller with the status in Register A. Register Pair DE is kept.
6BD3H - Image of Boot Sector 1: End of Read (NMI) (Runs at 43D3H)
Reached through the NMI vector at 4049H (JP 43D3H, set at 43A8H-43B2H) when the Read Sector command ends. The stack holds the address the NMI interrupted (43D1H), Register Pair DE pushed at 43B6H and the return address into 4374H.
6BDFH - Image of Boot Sector 1: Send a Command to the Controller (Runs at 43DFH)
Sends the command in Register A to port F0H, then waits a short time for the status to be valid. Register B returns 00H.
6BE6H - Image of Boot Sector 1: The Two Messages (Runs at 43E6H)
The texts 4387H displays through the ROM routine at 021BH, each ending in 03H.
6C00H - The Buffer at 6C00H (Not in the File)
256 bytes the program uses for three things in turn.
6D00H - 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, 6D00H-7162H, asks for or reads every choice, puts the target drive's drive code table into 6505H and goes to the engine (70E9H); the engine then builds its tracks over the front end from 6D00H up. First the banner, a request that loads SYS2/SYS, and the system information sector of drive 0 (cylinder 0, sector 2) into 4300H: from its block of drive code tables (always the second block, at 4370H: the Model I file takes the first block, 4320H, after a boot through a disk driver) the default bootstrap step rate (drive 0's +03H, bits 1-0) and each drive's highest cylinder (+06H) are taken.
6D36H - The Drive and the Parameters
The command line may start with :d, the drive (0-7); then @PARAM reads the parameters (the table at 719DH), 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 6EACH: not 0 when any of them was given, which means no question is asked.
6D93H - 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 6F36H; the drive's table is copied to the working table at 6505H, Index Register IY points to it, SYSTEM is refused for a drive that is not a hard disk (6DCDH-6DD7H), and the driver's function 00H tests that the drive is present.
6DE0H - The Diskette Name, the Date, the Master Password
NAME: 0000H takes LDOSDISK (7536H), FFFFH asks (Diskette name ?), else the address of a text on the command line. The name goes into the allocation table image at 69D0H (+D0H) in upper case, the date of today at 69D8H (+D8H). MPW the same way: PASSWORD (753EH) or the question Master password ? or the text; it goes to 717BH, is checked (letters and digits, the first a letter) and its hash goes to 69CEH (+CEH).
6E73H - The Density
A drive with bit 4 of +04H set gets no questions (6FC1H). For the others the track descriptors of the drive's size are chosen (6512H for 5 inch, 651EH 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.
6EF8H - 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.
6F50H - The Bootstrap Step Rate
The step rate is asked for in milliseconds, with the values of a 5 inch drive (6, 12, 20 or 30, the rates the question names; 40 is taken too, as rate 3) 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 (6D21H). The Model I file refuses SYSTEM here unless the format is 5 inch double density; the Model III file has refused SYSTEM for every floppy already (6DD7H).
6FC1H - The Allocation Table Image, the Target Diskette
Each cylinder's byte of the allocation table image (6900H 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 69CAH, 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.
700CH - Check the Target Diskette
The working table is saved at 7163H, 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 (713CH) and must not be write protected, and HIGH$ must leave room for the track (not looked at with SYSTEM, 7044H). 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 (or SYSTEM, 7067H) was given; a JCL job ends there. The saved table is put back, the head restored, and the engine starts at 6000H.
70ECH - 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.
70FFH - 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.
713CH - 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$ (4288H) plus 15 ticks (half a second at the 30 ticks a second of the Model III). It returns the Z FLAG when the hole passed; at the deadline 715FH drops the return address of the poll and returns to the caller of 713CH with the NZ FLAG.
7163H - Not in the File: the Saved Table and the Cylinders of the Drives
Two areas the front end fills.
7175H - Two Supervisor Requests
Each loads a request code into Register A and does RST 28H. The supervisor's dispatcher (4BCCH) 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).
717BH - The Master Password, a Text
The buffer of the master password and the text of 712AH.
719DH - The Table of the Parameters
The table @PARAM reads (6D50H): 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.
7236H - 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.