LDOS 5.3.1 for the Model III - BOOT/SYS Disassembled

Page Customization

Introduction/Summary

LDOS 5.3.1 BOOT/SYS Disassembly - The Boot Sector and the System Information Sector (Model III)

BOOT/SYS is the first file of an LDOS 5.3.1 Model III system diskette: cylinder 0, sectors 0-4, 1280 bytes. It is not a load module. Sector 1 is the boot sector the ROM reads and runs, sector 0 is a byte for byte copy of it, sector 2 is the system information sector SYS0/SYS reads at start-up, sector 3 holds an old granule allocation table image and sector 4 the format fill.

When the computer is reset with a diskette in drive 0, the ROM reads cylinder 0, sector 1 into 4300H-43FFH and jumps to 4300H. The boot sector reads sector 4 of the directory cylinder (the cylinder named by its own byte 02H, 14H, cylinder 20) into 5100H-51FFH. The first 32 bytes of that sector are the directory entry of SYS0/SYS; if bit 4 of its attribute byte is clear the entry is not in use and the boot displays No system. Otherwise the starting cylinder and granule of the first extent (bytes 16H-17H of the entry) give the first sector of SYS0/SYS (granule times 6), and the boot reads SYS0/SYS a sector at a time through the same buffer, copying each load block (type 01H) to its address, passing over records of other types, until the transfer record (type 02H) sends it to SYS0/SYS at 4E00H with the interrupts still off. A sector that cannot be read in five tries displays Disk error. Either message waits for ENTER and restarts the computer through RST 00H.

Sector 0 is shown at its file offsets 0000H-00FFH, sector 1 at 4300H-43FFH, where it runs, sector 2 at 4300H-43FFH, where SYS0/SYS reads it, and sectors 3 and 4 at their file offsets. Rows of sectors 1 and 2 carry ids that name the sector (s1-4300H, s2-4300H).

How the Boot Sector Reads a Sector

The boot sector works the floppy disk controller through ports F0H-F4H. The data bytes are taken with the CPU held in wait states and the end of the command arrives as an NMI:

StepWhat the code does
Select81H (drive 0, double density) to port F4H (4391H)
SeekThe cylinder to the data port F3H and the Seek command 1BH to port F0H, then a wait for BUSY to go off (4394H-439FH); bits 1-0 of the command, byte 95H of the sector, are the bootstrap stepping rate
SectorThe sector to port F2H and 81H to port F4H again (43A1H)
NMIJP 43D3H stored at the NMI vector 4049H (43A8H), which the ROM's NMI handler (0066H, 3039H, 351CH) jumps to when no reset is pending
ReadThe Read Sector command 80H to port F0H, C0H to the NMI mask port E4H, a wait for the first DATA REQUEST, one INI, then 255 more with C1H (wait state generation) at port F4H before each (43B7H-43CFH)
EndA wait at 43D1H until the NMI; 43D3H drops the NMI's return address, takes back Register Pair DE, sends 00H to port E4H and 81H to port F4H and returns the status from port F0H (43D3H)
TriesThe status masked with 1CH (RECORD NOT FOUND, CRC ERROR, LOST DATA) must be 0; five tries (4374H)

The Five Sectors

SectorContents
0The same 256 bytes as sector 1. FORMAT/CMD carries the sector as images at 6A00H and 6B00H, which differ from it only in byte 02H (the directory cylinder) and byte 95H (the stepping rate operand). The ROM does not read sector 0.
1The boot sector, run at 4300H.
2The system information sector: the S mark, the configuration byte, the days of the months, two blocks of eight drive code table entries, the date and time prompt switches and the names of the days and months. SYS0/SYS reads it into 4300H at start-up (4E91H-4E98H).
3A granule allocation table for an empty 40 cylinder diskette named LDOS-513, dated 09/29/86; not this diskette's table. Not read during the boot.
4The format fill, 6DH B6H repeated.

Variables

Memory and Ports Outside BOOT/SYS

Address
Size
Contents
4049H-404BH
3 bytes
NMI Vector
The ROM's NMI handler jumps to 4049H. The boot sector stores JP 43D3H there before each read (43A8H-43B2H) and leaves it set when it jumps to SYS0/SYS.
5100H-51FFH
256 bytes
Sector Buffer
The directory entry of SYS0/SYS (sector 4 of the directory cylinder: attribute 5100H, first extent 5116H-5117H), then each sector of SYS0/SYS in turn.
Stack
8 bytes
The ROM's Stack
The boot sector does not load the Stack Pointer: its calls, the push of the tries at 4376H, the push of Register Pair DE at 43B6H and the NMI's return address use the stack the ROM left.
Ports F0H-F3H
4 bytes
Floppy Disk Controller
F0H command (write) and status (read), F2H sector register, F3H data register (the cylinder for the Seek, then each byte read).
Port F4H
1 byte
Drive Select
81H: drive 0, double density; C1H: the same with wait state generation (bit 6).
Port E4H
1 byte
NMI Mask
C0H while a sector is read (bit 7 lets the controller's interrupt request raise the NMI, bit 6 the drive motor time-out), 00H after it.

BOOT/SYS Data and Operands Other Files Read

Address
Size
Contents
4302H
1 byte
Directory Cylinder
14H (cylinder 20), the operand of CP 14H. The boot reads it at 4304H; SYS0/SYS copies it to drive 0's drive code table at 4709H (4E85H).
4395H
1 byte
Seek Command and Bootstrap Stepping Rate
1BH, the operand of LD A at 4394H. SYS0/SYS copies bits 1-0 into drive 0's drive code table at 4703H (4E77H-4E84H).
43E6H-43F3H
14 bytes
Disk error Message
17H, E8H, Disk error, 1FH, 03H.
43F4H-43FFH
12 bytes
No system Message
17H, E8H, No system, 03H.

Sector 2 (read into 4300H by SYS0/SYS)

Address
Size
Contents
4300H
1 byte
Mark
53H, S.
4301H
1 byte
Configuration Byte
C9H; SYS0/SYS takes it and stores 00H in its place (4E9BH-4EA0H).
4302H-430DH
12 bytes
Days of the Months
January to December; SYS0/SYS sets February (4303H) to 1CH or 1DH by the year.
4320H-436FH
80 bytes
First Block of Drive Code Tables
Eight entries of 10 bytes, drives 0-7; drives 0-3 present (JP 4583H), drives 4-7 C9H.
4370H-43BFH
80 bytes
Second Block of Drive Code Tables
Eight entries of 10 bytes; SYS0/SYS copies drives 1-7 (437AH-43BFH) to 470AH-474FH (4FC8H-4FD1H).
43C2H
1 byte
Date Prompt Switch
00H: ask for the date (4EA1H).
43C3H
1 byte
Time Prompt Switch
00H: ask for the time (4F94H).
43C7H-43FFH
57 bytes
Day and Month Names
SunMonTueWedThuFriSat and JanFebMarAprMayJunJulAugSepOctNovDec.

Outside Routines

AddressUse
021BH
3 bytes
ROM: Display a Line
Displays the text at Register Pair HL until 03H or 0DH (4387H).
0040H
3 bytes
ROM: Line Input
Waits for a line from the keyboard (438AH).
0000H
1 byte
ROM: Restart
RST 00H after an error (438DH).
4E00H
3 bytes
SYS0/SYS Transfer Address
Reached by JP (HL) at 434DH.

Disassembly

Sector 0: The Copy of the Boot Sector

File offsets 0000H-00FFH, cylinder 0, sector 0. Byte for byte the same 256 bytes as sector 1, the boot sector the ROM reads and runs at 4300H (FORMAT/CMD carries the same sector as images at 6A00H and 6B00H, which differ from it only in byte 02H, the directory cylinder, and byte 95H, the stepping rate operand). The ROM reads sector 1 and the boot sector never reads this sector, so its bytes are shown as data, each row naming the instructions of sector 1 they repeat.

0000-000F
DEFB 00H, FEH, 14H, F3H, 3AH, 02H, 43H, 57H, 1EH, 04H, CDH, 74H, 43H, 20H, 71H, 3AH 00 FE 14 F3 3A 02 43 57 1E 04 CD 74 43 20 71 3A
Bytes 00H-0FH of sector 0, the same as 4300H-430FH of sector 1: NOP, CP 14H, DI and the LD A,(4302H), LD D,A, LD E,04H, CALL 4374H and JR NZ,4380H that read the directory entry of SYS0/SYS.
0010-001F
DEFB 00H, 51H, E6H, 10H, 28H, 6EH, D9H, 2AH, 16H, 51H, 55H, 7CH, 07H, 07H, 07H, E6H 00 51 E6 10 28 6E D9 2A 16 51 55 7C 07 07 07 E6
Bytes 10H-1FH of sector 0, the same as 4310H-431FH of sector 1: the attribute test of the directory entry at 5100H, the jump to No system, EXX and the load of the first extent from 5116H with the rotates of the granule.
0020-002F
DEFB 07H, 67H, 07H, 84H, 07H, 5FH, 21H, FFH, 51H, D9H, CDH, 5DH, 43H, 3DH, 20H, 0CH 07 67 07 84 07 5F 21 FF 51 D9 CD 5D 43 3D 20 0C
Bytes 20H-2FH of sector 0, the same as 4320H-432FH of sector 1: the end of the granule multiply, LD HL,51FFH, EXX, and the type test and load block copy loop of the record loader at 432AH.
0030-003F
DEFB CDH, 4EH, 43H, CDH, 5DH, 43H, 77H, 23H, 10H, F9H, 18H, EEH, 3DH, 28H, 0BH, CDH CD 4E 43 CD 5D 43 77 23 10 F9 18 EE 3D 28 0B CD
Bytes 30H-3FH of sector 0, the same as 4330H-433FH of sector 1: the end of the load block loop, the transfer record test and the loop at 433FH that passes over a record of another type.
0040-004F
DEFB 5DH, 43H, 47H, CDH, 5DH, 43H, 10H, FBH, 18H, E0H, CDH, 4EH, 43H, E9H, CDH, 5DH 5D 43 47 CD 5D 43 10 FB 18 E0 CD 4E 43 E9 CD 5D
Bytes 40H-4FH of sector 0, the same as 4340H-434FH of sector 1: the end of the pass-over loop, the jump to the transfer address at 434AH and the start of the record length and address fetch at 434EH.
0050-005F
DEFB 43H, 47H, CDH, 5DH, 43H, 6FH, 05H, CDH, 5DH, 43H, 67H, 05H, C9H, D9H, 2CH, 20H 43 47 CD 5D 43 6F 05 CD 5D 43 67 05 C9 D9 2C 20
Bytes 50H-5FH of sector 0, the same as 4350H-435FH of sector 1: the end of the record length and address fetch and the start of the byte fetch at 435DH with its buffer pointer step.
0060-006F
DEFB 0FH, E5H, CDH, 74H, 43H, 20H, 19H, E1H, 1CH, 7BH, D6H, 12H, 20H, 02H, 5FH, 14H 0F E5 CD 74 43 20 19 E1 1C 7B D6 12 20 02 5F 14
Bytes 60H-6FH of sector 0, the same as 4360H-436FH of sector 1: the byte fetch's sector read, the sector and cylinder step against 12H, the byte load and the RST 00H at 4373H.
0070-007F
DEFB 7EH, D9H, C9H, C7H, 06H, 05H, C5H, CDH, 8EH, 43H, C1H, E6H, 1CH, C8H, 10H, F6H 7E D9 C9 C7 06 05 C5 CD 8E 43 C1 E6 1C C8 10 F6
Bytes 70H-7FH of sector 0, the same as 4370H-437FH of sector 1: the start of the five try read at 4374H and the Disk error and No system display at 4380H with its ROM calls.
0080-008F
DEFB 21H, E6H, 43H, DDH, 21H, F4H, 43H, CDH, 1BH, 02H, CDH, 40H, 00H, C7H, 01H, F4H 21 E6 43 DD 21 F4 43 CD 1B 02 CD 40 00 C7 01 F4
Bytes 80H-8FH of sector 0, the same as 4380H-438FH of sector 1: the ROM calls of the error display, RST 00H and the start of the seek at 438EH: drive select, Seek command 1BH and the cylinder.
0090-009F
DEFB 81H, EDH, 41H, 0DH, 3EH, 1BH, EDH, 51H, CDH, DFH, 43H, DBH, F0H, CBH, 47H, 20H 81 ED 41 0D 3E 1B ED 51 CD DF 43 DB F0 CB 47 20
Bytes 90H-9FH of sector 0, the same as 4390H-439FH of sector 1: the busy wait of the seek, the sector register, the reselect and the setting of the NMI vector at 4049H to JP 43D3H.
00A0-00AF
DEFB FAH, 7BH, D3H, F2H, 3EH, 81H, D3H, F4H, 21H, D3H, 43H, 22H, 4AH, 40H, 3EH, C3H FA 7B D3 F2 3E 81 D3 F4 21 D3 43 22 4A 40 3E C3
Bytes A0H-AFH of sector 0, the same as 43A0H-43AFH of sector 1: the NMI vector store, the buffer pointer 5100H, PUSH DE, LD DE,0C102H and the Read Sector command 80H.
00B0-00BF
DEFB 32H, 49H, 40H, 21H, 00H, 51H, D5H, 11H, 02H, C1H, 3EH, 80H, CDH, DFH, 43H, 3EH 32 49 40 21 00 51 D5 11 02 C1 3E 80 CD DF 43 3E
Bytes B0H-BFH of sector 0, the same as 43B0H-43BFH of sector 1: the NMI mask C0H to port E4H, the wait for the first data request and the INI loop with wait state generation.
00C0-00CF
DEFB C0H, D3H, E4H, DBH, F0H, A3H, 28H, FBH, EDH, A2H, 7AH, D3H, F4H, EDH, A2H, 20H C0 D3 E4 DB F0 A3 28 FB ED A2 7A D3 F4 ED A2 20
Bytes C0H-CFH of sector 0, the same as 43C0H-43CFH of sector 1: the end of the INI loop, the wait for the NMI at 43D1H and the end of read routine at 43D3H.
00D0-00DF
DEFB FAH, 18H, FEH, E1H, D1H, AFH, D3H, E4H, 3EH, 81H, D3H, F4H, DBH, F0H, C9H, D3H FA 18 FE E1 D1 AF D3 E4 3E 81 D3 F4 DB F0 C9 D3
Bytes D0H-DFH of sector 0, the same as 43D0H-43DFH of sector 1: the end of the end of read routine, the command send at 43DFH with its delay, and the start of the Disk error message.
00E0-00EF
DEFB F0H, 06H, 0CH, 10H, FEH, C9H, 17H, E8H, 44H, 69H, 73H, 6BH, 20H, 65H, 72H, 72H F0 06 0C 10 FE C9 17 E8 44 69 73 6B 20 65 72 72
Bytes E0H-EFH of sector 0, the same as 43E0H-43EFH of sector 1: the text Disk error with its 1FH and 03H end bytes and the start of the No system message.
00F0-00FF
DEFB 6FH, 72H, 1FH, 03H, 17H, E8H, 4EH, 6FH, 20H, 73H, 79H, 73H, 74H, 65H, 6DH, 03H 6F 72 1F 03 17 E8 4E 6F 20 73 79 73 74 65 6D 03
Bytes F0H-FFH of sector 0, the same as 43F0H-43FFH of sector 1: the text No system and its 03H end byte, the last byte of the sector.

4300H - Sector 1: The Boot Sector

When the computer is reset with a diskette in drive 0, the ROM reads cylinder 0, sector 1 into 4300H-43FFH and jumps to 4300H. This sector 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, a sector at a time through the same buffer, until the transfer record sends it to SYS0/SYS. It keeps the stack the ROM left and runs with the interrupts off.

4300
NOP 00
No operation. Byte 00H of the boot sector; the ROM jumps to 4300H and execution simply passes on to the compare at 4301H.
4301
CP 14H FE 14
Compare Register A with 14H, the operand byte at 4302H. The compare does nothing useful: its operand is the directory cylinder of this diskette (cylinder 20), kept at byte 02H of the boot sector, where 4304H reads it and SYS0/SYS's start-up copies it into drive 0's drive code table (4709H).
4303
DI F3
Disable the interrupts. The boot sector runs with them off from here to the jump into SYS0/SYS; the end of each read reaches it through the NMI, which DI does not mask.
4304
LD A,(4302H) 3A 02 43
Load Register A with the directory cylinder from 4302H (14H, cylinder 20), the operand byte of the compare at 4301H.
4307
LD D,A 57
Copy the directory cylinder from Register A into Register D, the cylinder the read at 4374H seeks to.
4308
LD E,04H 1E 04
Load Register E with 04H: sector 4 of the directory cylinder holds the directory entry of SYS0/SYS in its first 32 bytes. Register Pair DE is now cylinder 20, sector 4.
430A
Call 4374H to read cylinder Register D, sector Register E into the buffer at 5100H-51FFH, with up to five tries. Register A returns the status masked with 1CH and the Z FLAG is set when the read succeeded.
430D
If the NZ FLAG is set (all five tries of the read failed), jump to 4380H to display Disk error and restart the computer.
430F
LD A,(5100H) 3A 00 51
Load Register A with the attribute byte of the directory entry at 5100H, byte 00H of the entry of SYS0/SYS.
4312
AND 10H E6 10
Mask Register A with 10H to keep bit 4 of the attribute byte, the bit that marks a directory entry in use. The Z FLAG is set when the entry is free.
4314
If the Z FLAG is set (the directory entry of SYS0/SYS is not in use, so this diskette has no system), jump to 4384H, inside the LD IX at 4383H, to display No system and restart the computer.
4316
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set. From here the alternate Register Pair DE' holds the cylinder and sector of the next sector of SYS0/SYS and the alternate Register Pair HL' the pointer into the buffer at 5100H, which the byte fetch at 435DH uses.
4317
LD HL,(5116H) 2A 16 51
Load Register Pair HL with the first extent of SYS0/SYS from 5116H-5117H, bytes 16H-17H of its directory entry: Register L the starting cylinder, Register H the starting granule in bits 7-5 and the granule count in bits 4-0.
431A
LD D,L 55
Copy the starting cylinder from Register L into Register D: Register D now names the first cylinder of SYS0/SYS.
431B
LD A,H 7C
Copy the granule byte from Register H into Register A, to take the starting granule out of its bits 7-5.
431C
RLCA 07
Rotate Register A left once. With the two rotates that follow, the starting granule in bits 7-5 moves into bits 2-0.
431D
RLCA 07
Rotate Register A left a second time, moving the starting granule one more place towards bits 2-0.
431E
RLCA 07
Rotate Register A left a third time: bits 7-5 of the granule byte are now in bits 2-0 of Register A.
431F
AND 07H E6 07
Mask Register A with 07H to keep only the starting granule (0, 1 or 2 on a cylinder of three granules).
4321
LD H,A 67
Save the starting granule from Register A in Register H for the addition at 4323H.
4322
RLCA 07
Rotate Register A left: the starting granule times 2 (bit 7 is 0, so nothing enters bit 0).
4323
ADD A,H 84
Add Register H to Register A: the starting granule times 3.
4324
RLCA 07
Rotate Register A left: the starting granule times 6, the first sector of the granule on its cylinder (six sectors a granule, sectors numbered from 0).
4325
LD E,A 5F
Store the first sector of SYS0/SYS from Register A in Register E: Register Pair DE now holds the cylinder and sector where SYS0/SYS starts.
4326
LD HL,51FFH 21 FF 51
Load Register Pair HL with 51FFH, the last byte of the buffer, so that the first call of the byte fetch at 435DH steps Register L to 00H and reads the first sector of SYS0/SYS before it takes a byte.
4329
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set again, putting the cylinder and sector (now in Register Pair DE') and the buffer pointer (now in Register Pair HL') aside for the byte fetch.

432AH - Load SYS0/SYS Record by Record

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.

432A
Call 435DH to fetch the next byte of SYS0/SYS into Register A: the type byte of the next record.
432D
DEC A 3D
Decrement Register A, the record type. The Z FLAG is set when the type was 01H, a load block.
432E
If the NZ FLAG is set (the record is not a load block), jump to 433CH to test for the transfer record.
4330
Call 434EH to fetch the length of the load block into Register B and its load address into Register Pair HL; Register B returns as the count of data bytes that follow.
4333
Call 435DH to fetch the next data byte of the load block into Register A.
4336
LD (HL),A 77
Store the data byte from Register A at the load address in Register Pair HL.
4337
INC HL 23
Increment Register Pair HL to the next load address of the block.
4338
Decrement Register B, the data bytes left in the load block, and loop back to 4333H until it reaches zero.
433A
Jump back to 432AH to fetch the type byte of the next record.
433C
DEC A 3D
Decrement Register A again. The Z FLAG is set when the record type was 02H, the transfer record.
433D
If the Z FLAG is set (the record is the transfer record), jump to 434AH to take the transfer address and jump to it.
433F
Call 435DH to fetch the length byte of a record of another type into Register A.
4342
LD B,A 47
Copy the length of the record from Register A into Register B, the count of bytes to pass over.
4343
Call 435DH to fetch the next byte of the record into Register A. The byte is not used: the record is passed over byte by byte.
4346
Decrement Register B, the bytes left in the record being passed over, and loop back to 4343H until it reaches zero.
4348
Jump back to 432AH to fetch the type byte of the next record.
434A
Call 434EH to fetch the transfer record: Register B its length and Register Pair HL the transfer address of SYS0/SYS (4E00H on this diskette).
434D
JP (HL) E9
Jump to the transfer address in Register Pair HL: SYS0/SYS takes over. The interrupts are still off and the NMI vector at 4049H still holds JP 43D3H.

434EH - Fetch a Record Length and Address

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.

434E
Call 435DH to fetch the length byte of the record into Register A.
4351
LD B,A 47
Copy the length of the record from Register A into Register B: it counts the address bytes and the data bytes together.
4352
Call 435DH to fetch the low byte of the load address or transfer address into Register A.
4355
LD L,A 6F
Store the low byte of the address from Register A in Register L.
4356
DEC B 05
Decrement Register B, the record length, for the low address byte just taken.
4357
Call 435DH to fetch the high byte of the load address or transfer address into Register A.
435A
LD H,A 67
Store the high byte of the address from Register A in Register H: Register Pair HL now holds the address.
435B
DEC B 05
Decrement Register B for the high address byte: Register B now counts only the data bytes that follow.
435C
RET C9
Return to the caller with Register B holding the count of data bytes and Register Pair HL the address.

435DH - Fetch the Next Byte of SYS0/SYS

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.

435D
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set: Register Pair HL now holds the buffer pointer and Register Pair DE the cylinder and sector of the next sector, while the caller's Register B and Register Pair HL are kept aside.
435E
INC L 2C
Increment Register L, the low byte of the buffer pointer in Register Pair HL. The Z FLAG is set when it wraps from FFH to 00H, the end of the buffer.
435F
If the NZ FLAG is set (the pointer is still inside the buffer), jump to 4370H to take the byte at Register Pair HL.
4361
PUSH HL E5
Save the buffer pointer in Register Pair HL (now 5100H) on the stack while the next sector is read.
4362
Call 4374H to read cylinder Register D, sector Register E into the buffer at 5100H-51FFH, with up to five tries.
4365
If the NZ FLAG is set (all five tries failed), jump to 4380H to display Disk error and restart the computer. The pushed buffer pointer is left on the stack, which no longer matters.
4367
POP HL E1
Restore the buffer pointer (5100H) from the stack into Register Pair HL.
4368
INC E 1C
Increment Register E, the sector number, to the next sector of SYS0/SYS.
4369
LD A,E 7B
Copy the sector number from Register E into Register A to test it against the end of the cylinder.
436A
SUB 12H D6 12
Subtract 12H (18, the sectors of a double density cylinder, numbered 00H-11H) from Register A. The Z FLAG is set when Register E has passed the last sector of the cylinder.
436C
If the NZ FLAG is set (the sector is still on this cylinder), jump to 4370H to take the byte.
436E
LD E,A 5F
Store 00H from Register A (the result of the subtraction) into Register E: the next sector is sector 0 of the next cylinder.
436F
INC D 14
Increment Register D, the cylinder number, to the next cylinder.
4370
LD A,(HL) 7E
Load Register A with the byte of SYS0/SYS at the buffer pointer in Register Pair HL.
4371
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set again, giving the caller back its Register B and Register Pair HL and putting the reading position aside. Register A keeps the byte.
4372
RET C9
Return to the caller with the byte of SYS0/SYS in Register A.
4373
RST 00H C7
RST 00H, one byte that no code reaches: the RET at 4372H ends the byte fetch and the read routine starts at 4374H. Executed, it would restart the computer through 0000H.

4374H - Read a Sector, Five Tries

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.

4374
LD B,05H 06 05
Load Register B with 05H, the number of tries the read gets.
4376
PUSH BC C5
Save Register B, the tries left, on the stack: the read at 438EH uses Register Pair BC for the port number and the byte count.
4377
Call 438EH to seek cylinder Register D and read sector Register E into 5100H-51FFH. Register A returns the controller status.
437A
POP BC C1
Restore the tries left from the stack into Register Pair BC: Register B holds the count of tries left.
437B
AND 1CH E6 1C
Mask the controller status in Register A with 1CH: bit 4 RECORD NOT FOUND, bit 3 CRC ERROR and bit 2 LOST DATA. The Z FLAG is set when none of them is set.
437D
RET Z C8
If the Z FLAG is set (the sector was read without error), return to the caller.
437E
Decrement Register B, the tries left, and loop back to 4376H to read the sector again until five tries have failed. After the last try the code falls into 4380H.

4380H - Display Disk error or No system and Restart

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.

4380
LD HL,43E6H 21 E6 43
Point Register Pair HL to 43E6H, the Disk error message.
4383
LD IX,43F4H DD 21 F4 43
Load Index Register IX with 43F4H. Nothing uses Index Register IX afterwards: the instruction only lets the path from 4380H pass over the three bytes 21H F4H 43H at 4384H-4386H, which the jump from 4314H takes as LD HL,43F4H, pointing Register Pair HL to the No system message instead.
4387
Call the ROM routine at 021BH to display the message at Register Pair HL until its 03H end byte: 17H turns the display to 32 characters a line, E8H is a space compression code for 40 spaces, then the text and, for Disk error, 1FH, which clears to the end of the screen.
438A
Call the ROM routine at 0040H to take a line from the keyboard: the computer waits until ENTER is pressed.
438D
RST 00H C7
RST 00H: restart the computer through 0000H, which tries the boot again.

438EH - Seek and Read One Sector

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.

438E
LD BC,81F4H 01 F4 81
Load Register Pair BC with 81F4H: Register B holds 81H, the drive select value (bit 0 drive 0, bit 7 double density), and Register C holds F4H, the drive select port.
4391
OUT (C),B ED 41
Send 81H from Register B to port F4H in Register C: select drive 0 in double density, which also starts its motor.
4393
DEC C 0D
Decrement Register C from F4H to F3H, the data register of the floppy disk controller.
4394
LD A,1BH 3E 1B
Load Register A with 1BH, the Seek command: bit 3 loads the head and bits 1-0 (11) give the slowest stepping rate. The two rate bits at 4395H are the bootstrap stepping rate: SYS0/SYS's start-up copies them into drive 0's drive code table.
4396
OUT (C),D ED 51
Send the cylinder number in Register D to port F3H in Register C, the data register, where the Seek command takes the cylinder to move to.
4398
Call 43DFH to send the Seek command in Register A to the command port F0H and wait for its status to be valid.
439B
IN A,(F0H) DB F0
Read the controller status from port F0H into Register A.
439D
BIT 0,A CB 47
Test bit 0 of Register A, BUSY. The NZ FLAG is set while the seek is still going on.
439F
If the NZ FLAG is set (the controller is still busy with the seek), jump back to 439BH to read the status again.
43A1
LD A,E 7B
Copy the sector number from Register E into Register A.
43A2
OUT (F2H),A D3 F2
Send the sector number in Register A to port F2H, the sector register of the controller.
43A4
LD A,81H 3E 81
Load Register A with 81H, the drive select value for drive 0 in double density.
43A6
OUT (F4H),A D3 F4
Send 81H from Register A to port F4H, selecting drive 0 again to keep its motor running.
43A8
LD HL,43D3H 21 D3 43
Point Register Pair HL to 43D3H, the end of read routine of this sector.
43AB
LD (404AH),HL 22 4A 40
Store 43D3H from Register Pair HL at 404AH-404BH, the address bytes of the NMI vector at 4049H.
43AE
LD A,C3H 3E C3
Load Register A with C3H, the opcode of JP, for the first byte of the NMI vector at 4049H.
43B0
LD (4049H),A 32 49 40
Store C3H from Register A at 4049H: the NMI vector now holds JP 43D3H. The ROM's NMI handler at 0066H jumps to 4049H when no reset is pending, so the interrupt that ends the read lands at 43D3H.
43B3
LD HL,5100H 21 00 51
Point Register Pair HL to 5100H, the buffer the sector is read into, for the INI instructions that follow.
43B6
PUSH DE D5
Save Register Pair DE (cylinder and sector) on the stack: 43D3H takes it back after the NMI.
43B7
LD DE,C102H 11 02 C1
Load Register Pair DE with C102H: Register D holds C1H, the drive select value with bit 6 (wait state generation) set, and Register E holds 02H, the DATA REQUEST bit of the status.
43BA
LD A,80H 3E 80
Load Register A with 80H, the Read Sector command (one sector, no settling delay, no side compare).
43BC
Call 43DFH to send the Read Sector command in Register A to port F0H and wait for its status to be valid. Register B returns 00H.
43BF
LD A,C0H 3E C0
Load Register A with C0H for the NMI mask port.
43C1
OUT (E4H),A D3 E4
Send C0H from Register A to port E4H, the NMI mask: bit 7 lets the controller's interrupt request at the end of the command raise the NMI, and bit 6 lets the drive motor time-out raise it too, so that a read on a drive whose motor stops also ends at the NMI.
43C3
IN A,(F0H) DB F0
Read the controller status from port F0H into Register A.
43C5
AND E A3
Mask the status in Register A with Register E (02H), keeping only DATA REQUEST. The Z FLAG is set while the first byte is not ready.
43C6
If the Z FLAG is set (the first byte of the sector has not arrived), jump back to 43C3H to read the status again.
43C8
INI ED A2
Read the first data byte from port F3H in Register C into the buffer at Register Pair HL, increment Register Pair HL and decrement Register B from 00H to FFH, leaving 255 bytes to take.
43CA
LD A,D 7A
Copy C1H from Register D into Register A: drive 0, double density, with wait state generation.
43CB
OUT (F4H),A D3 F4
Send C1H from Register A to port F4H: with bit 6 set, the next read of the data port holds the CPU in wait states until the controller has the byte ready.
43CD
INI ED A2
Read the next data byte from port F3H in Register C into the buffer at Register Pair HL, increment Register Pair HL and decrement Register B, the bytes left.
43CF
If the NZ FLAG is set (Register B has not reached zero), jump back to 43CBH for the next byte. After 256 bytes the code falls through to 43D1H.
43D1
Jump to 43D1H itself: wait here until the controller ends the command and its interrupt request raises the NMI, which goes through 0066H and 4049H to 43D3H.

43D3H - End of Read (NMI)

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.

43D3
POP HL E1
Remove the return address of the NMI (43D1H, the wait loop) from the stack into Register Pair HL; the code does not go back there.
43D4
POP DE D1
Restore Register Pair DE, the cylinder and sector pushed at 43B6H.
43D5
XOR A AF
Set Register A to 00H (XOR A with itself) for the NMI mask port E4H.
43D6
OUT (E4H),A D3 E4
Send 00H from Register A to port E4H, turning off every NMI source of the port.
43D8
LD A,81H 3E 81
Load Register A with 81H, the drive select value for drive 0 in double density without wait states.
43DA
OUT (F4H),A D3 F4
Send 81H from Register A to port F4H, turning off wait state generation while keeping drive 0 selected.
43DC
IN A,(F0H) DB F0
Read the final status of the Read Sector command from port F0H into Register A.
43DE
RET C9
Return to 437AH, the caller of the read, with the controller status in Register A.

43DFH - Send a Command to the Controller

Sends the command in Register A to port F0H, then waits a short time for the status to be valid. Register B returns 00H.

43DF
OUT (F0H),A D3 F0
Send the command in Register A to port F0H, the command register of the floppy disk controller.
43E1
LD B,0CH 06 0C
Load Register B with 0CH, the count of the short delay loop that lets the controller's status become valid after a command.
43E3
Decrement Register B and loop to 43E3H itself until it reaches zero: 12 passes of the delay.
43E5
RET C9
Return to the caller with Register B at 00H and the command running in the controller.

43E6H - The Two Messages

The texts 4387H displays through the ROM routine at 021BH, each ending in 03H.

43E6-43E7
DEFB 17H, E8H 17 E8
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.
43E8-43F1
DEFM "Disk error" 44 69 73 6B 20 65 72 72 6F 72
The ten characters Disk error, displayed by 4387H when a sector cannot be read in five tries.
43F2-43F3
DEFB 1FH, 03H 1F 03
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.
43F4-43F5
DEFB 17H, E8H 17 E8
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.
43F6-43FE
DEFM "No system" 4E 6F 20 73 79 73 74 65 6D
The nine characters No system, displayed when the directory entry of SYS0/SYS is not in use.
43FF
DEFB 03H 03
The end byte of the No system message for the ROM routine at 021BH, and the last byte of the boot sector.

Sector 2: The System Information Sector (at 4300H)

File offsets 0200H-02FFH, cylinder 0, sector 2. The boot sector does not read it. SYS0/SYS's start-up reads it into 4300H-43FFH (4E91H-4E98H), over the boot sector, and takes the configuration byte, the month lengths, the date and time switches and the names of the days and months from it, and the entries of drives 1-7 of the second block of drive code tables (4FC8H-4FD1H). The rows show it at 4300H, where it is read.

4300
DEFB 53H 53
Byte 00H of sector 2: 53H, the character S that opens the system information sector.
4301
DEFB C9H C9
Byte 01H: C9H. SYS0/SYS's start-up loads this byte from 4301H, stores 00H in its place and keeps the byte on the stack (4E9BH-4EA0H).
4302-430D
DEFB 1FH, 1CH, 1FH, 1EH, 1FH, 1EH, 1FH, 1FH, 1EH, 1FH, 1EH, 1FH 1F 1C 1F 1E 1F 1E 1F 1F 1E 1F 1E 1F
Bytes 02H-0DH: the days of the twelve months, January to December (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31). SYS0/SYS's start-up sets byte 03H, February, to 1CH or 1DH by the year (4EDEH-4EE1H, 4F09H-4F10H) and sums the bytes from 4302H for the day of the year (4F1AH).
430E-431F
DEFB 06H, 09H, AEH, 2CH, 10H, FCH, B7H, C9H, 00H, D0H, 15H, 3BH, DDH, 3FH, D9H, DBH, CDH, D3H 06 09 AE 2C 10 FC B7 C9 00 D0 15 3B DD 3F D9 DB CD D3
Bytes 0EH-1FH: 18 bytes that no instruction of the boot sector or of SYS0/SYS's start-up names; the boot never reads them.
4320-4329
DEFB C3H, 83H, 45H, 43H, 41H, 00H, 27H, 11H, 45H, 14H C3 83 45 43 41 00 27 11 45 14
Bytes 20H-29H, the first block of drive code tables, entry 0. Drive 0: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 43H, the drive flags (bit 6 set, double density, bits 1-0 the stepping rate, 3); +04H 41H (bits 3-0 01H, the drive select bit of the drive, bit 6 set); +05H 00H, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20).
432A-4333
DEFB C3H, 83H, 45H, 44H, 42H, FFH, 27H, 11H, 45H, 14H C3 83 45 44 42 FF 27 11 45 14
Bytes 2AH-33H, the first block of drive code tables, entry 1. Drive 1: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 42H (bits 3-0 02H, the drive select bit of the drive, bit 6 set); +05H FFH, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20).
4334-433D
DEFB C3H, 83H, 45H, 44H, 44H, FFH, 27H, 11H, 45H, 14H C3 83 45 44 44 FF 27 11 45 14
Bytes 34H-3DH, the first block of drive code tables, entry 2. Drive 2: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 44H (bits 3-0 04H, the drive select bit of the drive, bit 6 set); +05H FFH, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20).
433E-4347
DEFB C3H, 83H, 45H, 44H, 48H, FFH, 27H, 11H, 45H, 14H C3 83 45 44 48 FF 27 11 45 14
Bytes 3EH-47H, the first block of drive code tables, entry 3. Drive 3: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 48H (bits 3-0 08H, the drive select bit of the drive, bit 6 set); +05H FFH, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20).
4348-4351
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 00H, 00H, 00H, 00H C9 83 45 00 00 00 00 00 00 00
Bytes 48H-51H, the first block of drive code tables, entry 4. Drive 4: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 00H, 00H, 00H, 00H.
4352-435B
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 00H, 00H, 00H, 00H C9 83 45 00 00 00 00 00 00 00
Bytes 52H-5BH, the first block of drive code tables, entry 5. Drive 5: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 00H, 00H, 00H, 00H.
435C-4365
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 00H, 00H, 00H, 00H C9 83 45 00 00 00 00 00 00 00
Bytes 5CH-65H, the first block of drive code tables, entry 6. Drive 6: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 00H, 00H, 00H, 00H.
4366-436F
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 00H, 00H, 00H, 00H C9 83 45 00 00 00 00 00 00 00
Bytes 66H-6FH, the first block of drive code tables, entry 7. Drive 7: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 00H, 00H, 00H, 00H.
4370-4379
DEFB C3H, 83H, 45H, 44H, 41H, 00H, 27H, 11H, 45H, 14H C3 83 45 44 41 00 27 11 45 14
Bytes 70H-79H, the second block of drive code tables, entry 0. Drive 0: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 41H (bits 3-0 01H, the drive select bit of the drive, bit 6 set); +05H 00H, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20).
437A-4383
DEFB C3H, 83H, 45H, 44H, 42H, FFH, 27H, 11H, 45H, 14H C3 83 45 44 42 FF 27 11 45 14
Bytes 7AH-83H, the second block of drive code tables, entry 1. Drive 1: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 42H (bits 3-0 02H, the drive select bit of the drive, bit 6 set); +05H FFH, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20). SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
4384-438D
DEFB C3H, 83H, 45H, 44H, 44H, FFH, 27H, 11H, 45H, 14H C3 83 45 44 44 FF 27 11 45 14
Bytes 84H-8DH, the second block of drive code tables, entry 2. Drive 2: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 44H (bits 3-0 04H, the drive select bit of the drive, bit 6 set); +05H FFH, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20). SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
438E-4397
DEFB C3H, 83H, 45H, 44H, 48H, FFH, 27H, 11H, 45H, 14H C3 83 45 44 48 FF 27 11 45 14
Bytes 8EH-97H, the second block of drive code tables, entry 3. Drive 3: C3H 83H 45H = JP 4583H, the floppy disk driver of SYS0/SYS, so the drive is present; +03H 44H, the drive flags (bit 6 set, double density, bit 2 set, bits 1-0 the stepping rate, 0); +04H 48H (bits 3-0 08H, the drive select bit of the drive, bit 6 set); +05H FFH, the current cylinder; +06H 27H, the highest cylinder (39); +07H 11H, the highest sector (17, so 18 sectors a cylinder); +08H 45H (bits 7-5 2: three granules a cylinder, bits 4-0 5: six sectors a granule); +09H 14H, the directory cylinder (20). SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
4398-43A1
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 27H, 00H, 00H, 00H C9 83 45 00 00 00 27 00 00 00
Bytes 98H-A1H, the second block of drive code tables, entry 4. Drive 4: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 27H, 00H, 00H, 00H. SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
43A2-43AB
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 27H, 00H, 00H, 00H C9 83 45 00 00 00 27 00 00 00
Bytes A2H-ABH, the second block of drive code tables, entry 5. Drive 5: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 27H, 00H, 00H, 00H. SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
43AC-43B5
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 27H, 00H, 00H, 00H C9 83 45 00 00 00 27 00 00 00
Bytes ACH-B5H, the second block of drive code tables, entry 6. Drive 6: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 27H, 00H, 00H, 00H. SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
43B6-43BF
DEFB C9H, 83H, 45H, 00H, 00H, 00H, 27H, 00H, 00H, 00H C9 83 45 00 00 00 27 00 00 00
Bytes B6H-BFH, the second block of drive code tables, entry 7. Drive 7: C9H, the opcode of RET, in place of the JP: the drive is not present and every request for it returns at once. Bytes +01H-+02H 83H 45H keep the address of the floppy disk driver (4583H); +03H-+09H hold 00H, 00H, 00H, 27H, 00H, 00H, 00H. SYS0/SYS's start-up copies this entry to its drive code tables (4FC8H-4FD1H).
43C0
DEFB FFH FF
Byte C0H: FFH. Neither the boot sector nor SYS0/SYS's start-up reads it.
43C1
DEFB 00H 00
Byte C1H: 00H. Neither the boot sector nor SYS0/SYS's start-up reads it.
43C2
DEFB 00H 00
Byte C2H, the date prompt switch: 00H. SYS0/SYS's start-up loads it from 43C2H (4EA1H) and goes on to ask for the date only when it is 00H; any other value jumps past the date prompt to 4F94H.
43C3
DEFB 00H 00
Byte C3H, the time prompt switch: 00H. SYS0/SYS's start-up loads it from 43C3H (4F94H) and tests it before the time prompt.
43C4-43C6
DEFB 00H, 00H, 00H 00 00 00
Bytes C4H-C6H: three bytes of 00H that neither the boot sector nor SYS0/SYS's start-up reads.
43C7-43DB
DEFM "SunMonTueWedThuFriSat" 53 75 6E 4D 6F 6E 54 75 65 57 65 64 54 68 75 46 72 69 53 61 74
Bytes C7H-DBH: the names of the seven days, three characters each, Sunday first. SYS0/SYS points Register Pair HL to 43C7H (4F61H) to take the name of the day it displays.
43DC-43FF
DEFM "JanFebMarAprMayJunJulAugSepOctNovDec" 4A 61 6E 46 65 62 4D 61 72 41 70 72 4D 61 79 4A 75 6E 4A 75 6C 41 75 67 53 65 70 4F 63 74 4E 6F 76 44 65 63
Bytes DCH-FFH: the names of the twelve months, three characters each, January first, read by SYS0/SYS's start-up for the date it displays.

Sector 3: An Old Granule Allocation Table Image

File offsets 0300H-03FFH, cylinder 0, sector 3. A granule allocation table for an empty 40 cylinder diskette named LDOS-513, dated 09/29/86. It is not the allocation table of this diskette, which is sector 0 of the directory cylinder (named LDOS531, dated 08/09/91). The boot sector never reads this sector. The rows show it at its file offsets.

0300
DEFB F9H F9
Allocation byte 00H, cylinder 0: F9H, granule 0 in use (bit 0) and bits 7-3 set for the granules a cylinder of three does not have.
0301-0313
DEFB F8H x 19 F8 x 19
Allocation bytes 01H-13H, cylinders 1-19, free cylinders: F8H, granules 0-2 free, bits 7-3 set for the granules a cylinder of three does not have.
0314
DEFB FFH FF
Allocation byte 14H, cylinder 20, the directory cylinder: FFH, every granule in use.
0315-0327
DEFB F8H x 19 F8 x 19
Allocation bytes 15H-27H, cylinders 21-39, free cylinders: F8H, granules 0-2 free, bits 7-3 set for the granules a cylinder of three does not have.
0328-035F
DEFB FFH x 56 FF x 56
Allocation bytes 28H-5FH, for cylinders 40-95, which a 40 cylinder diskette does not have: FFH, every granule unavailable.
0360-0387
DEFB F8H x 40 F8 x 40
Lock out bytes 60H-87H, one for each of cylinders 0-39: F8H, granules 0-2 usable, bits 7-3 set for the granules a cylinder does not have.
0388-03CA
DEFB FFH x 67 FF x 67
Bytes 88H-CAH: FFH, the lock out bytes of the cylinders a 40 cylinder diskette does not have and the unused bytes up to CAH.
03CB
DEFB 53H 53
Byte CBH: 53H, the version byte of the table.
03CC
DEFB 05H 05
Byte CCH: 05H, the cylinders beyond 35 (40 cylinders).
03CD
DEFB CAH CA
Byte CDH: CAH, the configuration byte of the diskette.
03CE-03CF
DEFB E0H, 42H E0 42
Bytes CEH-CFH: the hash of the master password, 42E0H.
03D0-03D7
DEFM "LDOS-513" 4C 44 4F 53 2D 35 31 33
Bytes D0H-D7H: the diskette name LDOS-513, eight characters.
03D8-03DF
DEFM "09/29/86" 30 39 2F 32 39 2F 38 36
Bytes D8H-DFH: the diskette date 09/29/86, the date the table was written, as MM/DD/YY.
03E0
DEFB 0DH 0D
Byte E0H: 0DH, a carriage return at the start of the automatic command field, which is therefore empty.
03E1-03FF
DEFB 20H x 31 20 x 31
Bytes E1H-FFH: 31 spaces, the rest of the automatic command field.

Sector 4: Format Fill

File offsets 0400H-04FFH, cylinder 0, sector 4, the last sector of BOOT/SYS. It holds only the fill pattern a freshly formatted sector carries; nothing reads it.

0400-040F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 00H-0FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0410-041F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 10H-1FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0420-042F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 20H-2FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0430-043F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 30H-3FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0440-044F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 40H-4FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0450-045F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 50H-5FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0460-046F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 60H-6FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0470-047F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 70H-7FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0480-048F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 80H-8FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
0490-049F
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes 90H-9FH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
04A0-04AF
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes A0H-AFH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
04B0-04BF
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes B0H-BFH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
04C0-04CF
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes C0H-CFH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
04D0-04DF
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes D0H-DFH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
04E0-04EF
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes E0H-EFH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.
04F0-04FF
DEFB 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H, 6DH, B6H 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6 6D B6
Bytes F0H-FFH of sector 4: the pair 6DH B6H eight times, the fill written into the sector when the track was formatted.