DOSPLUS 3.5 for the Model III - SYSGEN/CMD Disassembled

Page Customization

Introduction/Summary

DOSPLUS 3.5 SYSGEN/CMD Disassembly - Making a System Disk (Model III)

SYSGEN/CMD puts the DOSPLUS system on a formatted diskette or rigid drive, run from the DOS command level as SYSGEN :dr [filespec] (XFER=value); its heading reads SYSGEN - DOSPLUS System generation - 3.52, a later version number than the other utilities. It is a load module of 6 blocks, 1338 bytes, at 5200H-567FH and 568AH-5743H with the transfer address 5200H, after the two comment records (the name SYSGEN and the copyright notice); 5680H-5689H, between the two parts, is not loaded. SYSGEN/CMD is on the Model III master only.

SYSGEN copies from drive 0, the system drive, to the drive given: the boot sectors of cylinder 0, a new configuration sector (sector 2 of BOOT/SYS, which SYS0/SYS reads at boot), and each system file whose entry is in the first directory sectors. It works below the file system: the directory sectors are read and written by logical file number, the files' granules are taken in the target's GAT by SYSGEN itself, and the files are copied through two file control blocks it fills, one from drive 0's entry and one pointed at the new extent.

The Parts of SYSGEN/CMD

AddressContents
5200H-5243HThe heading and the five buffer pages (5200H).
5244H-52F1HEVAL@, the target drive, the bootstrap file, DCHECK, the density of cylinder 0, the first directory sectors (5244H).
52F2H-5343HA clean diskette, and the 8 inch cylinder 0 (52F2H).
5344H-53D0HThe boot sectors, from drive 0 or the bootstrap file (5344H).
53D1H-5427HThe configuration sector (53D1H).
5428H-550AHThe system files (5428H).
550BH-5672HThe end and the errors, granules, a granule's bit, the hash code, directory sectors, a single density track (550BH, 5533H, 5580H, 55A0H, 55B0H, 55FBH).
5673H-5743HThe data (5673H).

How SYSGEN Works

The target must be a drive other than drive 0 (Protected system device), there, and not write protected (5244H). Its cylinder 0 is verified in single density, then in double density. The HIT must be empty from byte 02H on, so only BOOT/SYS and DIR/SYS may be on the diskette (Disk contains illegal files, 52F2H): SYSGEN is for a diskette just formatted. For an 8 inch floppy whose cylinder 0 is double density, the drive control table gets single density values and cylinder 0 is formatted again in single density with 16 sectors, all its granules marked in use (55FBH).

The boot sectors are drive 0's cylinder 0 sectors 0 and 1, with the target's directory cylinder in byte 2 of sector 0; or, with a bootstrap file, its first sector written as sectors 0 and 1 and the rest of the file from sector 3 on (5344H). Sector 2 is made anew (53D1H): DCT and the target's drive control table bytes +0BH-13H, then fixed values, the boot flags 0EH (time and date prompts, the logo) with bit 0 and the address when XFER is given, the cursor character 5FH, the step rate 03H; the configuration of drive 0's BOOT/SYS is not copied.

For each logical file number from 02H to 14H, drive 0's entry is read; an active system file is copied (5428H). Its entry goes to the same place in the target's directory (moved on when the target's directory is shorter, 55E1H) with one extent of free granules found from two cylinders below the directory cylinder up (5533H), and the hash code of its name into the target's HIT (55A0H). The file is read whole into memory, a page a sector, and written to the new extent. At the end the GAT and the HIT are written and SYSGEN returns by EXIT@, with no message (550BH).

Differences from the Manual

The manual does not say that the target may not be drive 0, that it must hold no file but BOOT/SYS and DIR/SYS, that the configuration sector is written with fixed values instead of the system's own (so the SYSTEM settings saved on drive 0 are not carried over), that a bootstrap file's first sector goes to both sector 0 and sector 1, or that SYSGEN shows no message when it is done. Each system file must fit in one run of free granules.

5745H, the mark of a double density cylinder 0, is not in the loaded file and is written only when cylinder 0 is double density; for a single density cylinder 0 it keeps whatever memory held, so the 8 inch case at 5310H can be taken on that leftover byte.

Variables

SYSGEN/CMD Variables

Address
Size
Contents
53E8H-53E9H
2 bytes
XFER
The value of XFER, the operand of LD DE (53E7H).
558EH, 559EH
1 byte each
Bit opcodes
The second bytes of SET n,A and BIT n,A (5589H, 5599H).
561CH-561DH, 5628H
3 bytes
Track operands
The pairs of each sector and the cylinder of the IDs (5617H, 5601H).
5680H-5688H
9 bytes
Kept DCT
The target's DCT+0BH-13H (5307H).
5744H
1 byte
Directory cylinder
Of the target (52EFH).
5745H
1 byte
Density mark
FFH for a double density cylinder 0 (52D5H).
5746H
1 byte
Target drive
(5287H).
5747H-5748H
2 bytes
Extent
Of the file being copied (547EH).
5749H-574AH
2 bytes
End page
After the file read (54E8H).
574BH-5754H
10 bytes
Buffers
The five buffer pages (5219H).
5755H-5775H
33 bytes
Source block
The drive; from 5756H the reader's file control block (54A6H).
5776H-5796H
33 bytes
Destination block
From 5777H the bootstrap file, then the writer (5296H, 54B4H).

Outside Routines

AddressContents
4467HSYS0/SYS: DSPLY@ (5204H).
4479HSYS0/SYS: EVAL@ (5248H).
44A3HSYS0/SYS: LOCDCT% (528BH).
4424HSYS0/SYS: OPEN@ (529CH).
4488HSYS0/SYS: DISKIO% (52A4H, 5665H).
4436HSYS0/SYS: READ@ (534DH, 54DAH).
4439HSYS0/SYS: WRITE@ (54F4H).
4451HSYS0/SYS: DIVD@ (5537H).
4FC1HSYS2/SYS: routine 6, fill a file control block from an entry (55F8H).
4409HSYS0/SYS: ERROR@ (5530H).
4030HSYS0/SYS: ABORT@ (552AH).
402DHSYS0/SYS: EXIT@ (5521H).
0033HROM: display a character (5257H).
0040HROM: line input (525FH).

Disassembly

5200H - SYSGEN

SYSGEN/CMD's transfer address, entered from the DOS command level with Register Pair HL at the command line after the word SYSGEN: SYSGEN :dr [filespec] (XFER=value). SYSGEN makes a formatted diskette (or rigid drive) on which no file has been made into a system disk: it writes the boot sectors (from drive 0, or from a bootstrap file), the configuration sector 2 of BOOT/SYS, and a copy of every system file of drive 0 (the directory entries of logical file numbers 02H-14H) into granules from two cylinders below the directory up, then the GAT and the HIT. The heading gives the version 3.52. First five buffer pages are placed above 5800H or above LOW$, with room for the largest system file below HMEM$.

5200
PUSH HL E5
Save Register Pair HL, the command line pointer after SYSGEN, to the top of the stack while the heading is shown.
5201
LD HL,56CDH 21 CD 56
Point Register Pair HL to 56CDH, SYSGEN's heading (SYSGEN - DOSPLUS System generation - 3.52) and the copyright line.
5204
GOSUB to 4467H, DSPLY@, to display the text at Register Pair HL up to and with the 0DH after the copyright line.
5207
LD HL,(42A7H) 2A A7 42
Load Register Pair HL with LOW$ from 42A7H-42A8H, the lowest address the DOS keeps.
520A
LD BC,5800H 01 00 58
Load Register Pair BC with 5800H, the first buffer when LOW$ is below it.
520D
OR A B7
OR Register A with itself, to clear the C FLAG for the SBC below.
520E
SBC HL,BC ED 42
SUBtract Register Pair BC (5800H) from Register Pair HL (LOW$) with the C FLAG: the C FLAG when LOW$ is below 5800H.
5210
If the C FLAG is set (LOW$ below 5800H), JUMP to 5219H with the first buffer at 5800H in Register Pair BC.
5212
LD BC,(42A7H) ED 4B A7 42
Load Register Pair BC with LOW$ from 42A7H-42A8H, for the page above it.
5216
LD C,00H 0E 00
Load Register C with 00H: Register Pair BC = the start of the page of LOW$.
5218
INC B 04
INCrement Register B by 1: Register Pair BC = the page above LOW$, the first buffer.
5219
LD (574BH),BC ED 43 4B 57
Store Register Pair BC, the first buffer, into 574BH-574CH: the reply to the prompt, then the GAT of the target.
521D
INC B 04
INCrement Register B by 1: Register Pair BC = the next page, the second buffer.
521E
LD (574DH),BC ED 43 4D 57
Store Register Pair BC, the second buffer, into 574DH-574EH: the HIT of the target.
5222
INC B 04
INCrement Register B by 1: Register Pair BC = the next page, the third buffer.
5223
LD (574FH),BC ED 43 4F 57
Store Register Pair BC, the third buffer, into 574FH-5750H: directory sector 2 of the target.
5227
INC B 04
INCrement Register B by 1: Register Pair BC = the next page, the fourth buffer.
5228
LD (5751H),BC ED 43 51 57
Store Register Pair BC, the fourth buffer, into 5751H-5752H: the boot sectors, the directory sectors of drive 0, the files read.
522C
INC B 04
INCrement Register B by 1: Register Pair BC = the next page, the fifth buffer.
522D
LD (5753H),BC ED 43 53 57
Store Register Pair BC, the fifth buffer, into 5753H-5754H: the boot's second sector and the target's directory sectors.
5231
LD HL,1518H 21 18 15
Load Register Pair HL with 1518H, the room needed above the fifth buffer for the pages of a system file.
5234
ADD HL,BC 09
ADD Register Pair BC (the fifth buffer) to Register Pair HL: the top of the room, the C FLAG when past FFFFH.
5235
LD A,21H 3E 21
Load Register A with 21H, the error code of No memory space available.
5237
If the C FLAG is set (past FFFFH), JUMP to 552EH to post the error 21H.
523A
LD BC,(4411H) ED 4B 11 44
Load Register Pair BC with HMEM$ from 4411H-4412H, the highest address free for programs.
523E
SBC HL,BC ED 42
SUBtract Register Pair BC (HMEM$) from Register Pair HL with the C FLAG: the NC FLAG when the room reaches HMEM$.
5240
If the NC FLAG is set (no room below HMEM$), JUMP to 552EH to post the error 21H, No memory space available.
5243
POP HL E1
Restore Register Pair HL, the command line pointer, from the top of the stack.

5244H - The Command Line and the Target Drive

EVAL@ with the block 56BAH; nothing given is an asterisk and a new command line (BREAK the error 30H). The first field must be a drive (no field 2FH, not a drive 2BH) other than drive 0 (28H, Protected system device). A bootstrap file (the second field) is opened. DCHECK must find the drive (08H) and it must not be write protected (0FH). The target's cylinder 0 sector 2 is verified in single density, then in double density (5745H := FFH); the diskette is set to be logged and its GAT, HIT and directory sector 2 are read into the first three buffers.

5244
LD IX,56BAH DD 21 BA 56
Point Index Register IX to 56BAH, SYSGEN's evaluation block for EVAL@ (the drive, the bootstrap file and XFER).
5248
GOSUB to 4479H, EVAL@, to take the fields and the parameters of the command line at Register Pair HL into the blocks.
524B
If the NZ FLAG is set (EVAL@ found an error, 2EH in Register A), JUMP to 552EH to post the error.
524E
LD A,(IX+00H) DD 7E 00
Load Register A with the flag byte of the evaluation block at Index Register IX+00H, which EVAL@ has set.
5251
AND 0FH E6 0F
AND Register A with 0FH, the bits of the source, the destination, the wildmask and the parameters.
5253
If the NZ FLAG is set (something was given), JUMP to 5269H to take the drive.
5255
LD A,2AH 3E 2A
Load Register A with 2AH, the asterisk shown as the prompt when the command line holds nothing.
5257
GOSUB to 0033H, the ROM's display of the character in Register A, the prompt.
525A
LD HL,(574BH) 2A 4B 57
Load Register Pair HL with the first buffer from 574BH-574CH, the buffer for the reply.
525D
LD B,3FH 06 3F
Load Register B with 3FH, the most characters of the reply: 63.
525F
GOSUB to 0040H, the ROM's line input of up to Register B characters into the buffer at Register Pair HL; the C FLAG for BREAK.
5262
LD B,30H 06 30
Load Register B with 30H, the error code of Terminated, for BREAK.
5264
If the C FLAG is set (BREAK), JUMP to 552DH to post the error 30H in Register B.
5267
JUMP to 5244H to evaluate the reply at Register Pair HL as the command line.
5269
BIT 0,(IX+00H) DD CB 00 46
Test bit 0 of the flag byte at Index Register IX+00H, set by EVAL@ when a source field, the drive, was given.
526D
LD B,2FH 06 2F
Load Register B with 2FH, the error code of I/o field not found, for a command line without a drive.
526F
If the Z FLAG is set (no drive), JUMP to 552DH to post the error 2FH in Register B.
5272
LD A,(5755H) 3A 55 57
Load Register A with the flag byte of the source block from 5755H: bit 7 a device or a drive, bit 6 a name, bit 3 a drive.
5275
LD C,A 4F
Load Register C with Register A, keeping the flag byte of the source block for its drive number.
5276
AND C8H E6 C8
AND Register A with C8H, keeping bit 7 (a device or a drive), bit 6 (a name) and bit 3 (a drive).
5278
CP 88H FE 88
Compare Register A against 88H, a drive without a name: bits 7 and 3 set, bit 6 clear.
527A
LD B,2BH 06 2B
Load Register B with 2BH, the error code of Illegal devicespec, for a field that is not a drive.
527C
If the NZ FLAG is set (not a drive), JUMP to 552DH to post the error 2BH in Register B.
527F
LD A,C 79
Load Register A with Register C, the flag byte of the source block again.
5280
AND 07H E6 07
AND Register A with 07H, keeping bits 0-2, the drive number LOCDEV@ put there: the Z FLAG for drive 0.
5282
LD B,28H 06 28
Load Register B with 28H, the error code of Protected system device, for drive 0.
5284
If the Z FLAG is set (drive 0, the system drive), JUMP to 552DH to post the error 28H in Register B.
5287
LD (5746H),A 32 46 57
Store Register A, the target drive, into 5746H.
528A
LD C,A 4F
Load Register C with Register A, the target drive, for LOCDCT% and DISKIO%.
528B
GOSUB to 44A3H, LOCDCT%, to point Index Register IY to the drive control table of drive Register C.
528E
BIT 1,(IX+00H) DD CB 00 4E
Test bit 1 of the flag byte at Index Register IX+00H, set by EVAL@ when a destination field, the bootstrap file, was given.
5292
If the Z FLAG is set (no bootstrap file), JUMP to 52A2H to check the drive.
5294
LD B,00H 06 00
Load Register B with 00H, the logical record length for OPEN@: 256 byte records.
5296
LD DE,5777H 11 77 57
Point Register Pair DE to 5777H, the text of the destination block, the bootstrap file's specification.
5299
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, the buffer of the bootstrap file.
529C
GOSUB to 4424H, OPEN@, to open the bootstrap file of the file control block at Register Pair DE.
529F
If the NZ FLAG is set (OPEN@ failed, its error code in Register A), JUMP to 552EH to post the error.
52A2
LD A,00H 3E 00
Load Register A with 00H, the function DCHECK of DISKIO%, which checks the drive and its write protection.
52A4
GOSUB to 4488H, DISKIO%, to check drive Register C; the C FLAG when the diskette or the drive is write protected.
52A7
LD B,08H 06 08
Load Register B with 08H, the error code of Drive not available.
52A9
If the NZ FLAG is set (the drive is not there), JUMP to 552DH to post the error 08H in Register B.
52AC
LD B,0FH 06 0F
Load Register B with 0FH, the error code of Write protected disk.
52AE
If the C FLAG is set (write protected), JUMP to 552DH to post the error 0FH in Register B.
52B1
LD A,01H 3E 01
Load Register A with 01H, the function DHOME of DISKIO%, which moves the head to cylinder 0.
52B3
GOSUB to 4488H, DISKIO%, to move the head of drive Register C to cylinder 0.
52B6
RES 7,(IY+0BH) FD CB 0B BE
Reset bit 7 of DCT+0BH at Index Register IY+0BH: try cylinder 0 in single density first.
52BA
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H, cylinder 0 in Register D and sector 2 in Register E.
52BD
LD HL,(574BH) 2A 4B 57
Load Register Pair HL with the first buffer from 574BH-574CH.
52C0
LD A,04H 3E 04
Load Register A with 04H, the function DVERF of DISKIO%, which reads a sector without keeping it.
52C2
GOSUB to 4488H, DISKIO%, to verify cylinder Register D, sector Register E of drive Register C.
52C5
If the Z FLAG is set (cylinder 0 is single density), JUMP to 52D8H.
52C7
SET 7,(IY+0BH) FD CB 0B FE
Set bit 7 of DCT+0BH at Index Register IY+0BH: try cylinder 0 in double density.
52CB
LD A,04H 3E 04
Load Register A with 04H, the function DVERF of DISKIO%, which reads a sector without keeping it.
52CD
GOSUB to 4488H, DISKIO%, to verify cylinder Register D, sector Register E of drive Register C.
52D0
If the NZ FLAG is set (neither density reads), JUMP to 552EH to post the error in Register A.
52D3
LD A,FFH 3E FF
Load Register A with FFH, the mark of a double density cylinder 0.
52D5
LD (5745H),A 32 45 57
Store Register A (FFH) into 5745H; nothing else writes 5745H, which is not loaded.
52D8
SET 0,(IY+03H) FD CB 03 C6
Set bit 0 of DCT+03H at Index Register IY+03H, the flag that the diskette is to be logged.
52DC
LD B,03H 06 03
Load Register B with 03H, the three first sectors of the directory: the GAT, the HIT and sector 2.
52DE
LD E,00H 1E 00
Load Register E with 00H, directory sector 0, the GAT.
52E0
LD A,06H 3E 06
Load Register A with 06H, the function SREAD of DISKIO%, which reads a sector of the directory cylinder.
52E2
GOSUB to 4488H, DISKIO%, to read sector Register E of the directory of drive Register C into the buffer at Register Pair HL.
52E5
If the NZ FLAG is set (the read failed, its error code in Register A), JUMP to 552EH to post the error.
52E8
INC E 1C
INCrement Register E by 1, to the next directory sector.
52E9
INC H 24
INCrement Register H by 1, to the next buffer page.
52EA
DECrement Register B and, while it is not zero, LOOP BACK to 52E0H for the next sector (DJNZ).
52EC
LD A,(IY+12H) FD 7E 12
Load Register A with the directory cylinder of the target from DCT+12H, Index Register IY+12H.
52EF
LD (5744H),A 32 44 57
Store Register A, the directory cylinder, into 5744H.

52F2H - A Clean Diskette, and an 8 Inch Cylinder 0

Every byte of the target's HIT from 02H on must be 00H: only BOOT/SYS and DIR/SYS may be on it, else Disk contains illegal files. DCT+0BH-13H are kept at 5680H. An 8 inch floppy whose cylinder 0 is double density gets the single density values of 5673H and cylinder 0 is formatted again in single density (55FBH), its granules marked in use in the GAT.

52F2
LD HL,(574DH) 2A 4D 57
Load Register Pair HL with the second buffer from 574DH-574EH, the HIT of the target.
52F5
INC L 2C
INCrement Register L by 1, the first of two steps past the entries of BOOT/SYS and DIR/SYS.
52F6
INC L 2C
INCrement Register L by 1: Register Pair HL = byte 02H of the HIT.
52F7
LD A,(HL) 7E
Load Register A with the byte of the HIT at Register Pair HL.
52F8
OR A B7
OR Register A with itself: the NZ FLAG for a file on the diskette.
52F9
If the NZ FLAG is set (a file), JUMP to 5524H for Disk contains illegal files.
52FC
INC L 2C
INCrement Register L by 1, to the next byte of the HIT: the Z FLAG past the last.
52FD
If the NZ FLAG is set (more bytes), JUMP to 52F7H to test the next one.
52FF
PUSH IY FD E5
Save Index Register IY, the drive control table of the target, to the top of the stack.
5301
POP HL E1
Restore Register Pair HL from the top of the stack: Register Pair HL = the drive control table.
5302
LD DE,000BH 11 0B 00
Load Register Pair DE with 000BH, the offset of the diskette's values in a drive control table.
5305
ADD HL,DE 19
ADD Register Pair DE (000BH) to Register Pair HL: Register Pair HL = DCT+0BH.
5306
PUSH HL E5
Save Register Pair HL, DCT+0BH, to the top of the stack.
5307
LD DE,5680H 11 80 56
Point Register Pair DE to 5680H, the place where DCT+0BH-13H are kept.
530A
LD BC,0009H 01 09 00
Load Register Pair BC with 0009H, the nine bytes DCT+0BH-13H.
530D
LDIR ED B0
Copy DCT+0BH-13H to 5680H: Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR).
530F
POP DE D1
Restore Register Pair DE, DCT+0BH, from the top of the stack.
5310
LD A,(5745H) 3A 45 57
Load Register A with the mark of a double density cylinder 0 from 5745H.
5313
OR A B7
OR Register A with itself, to test the mark for zero.
5314
If the Z FLAG is set (single density cylinder 0), JUMP to 5344H for the boot sectors.
5316
BIT 5,(IY+03H) FD CB 03 6E
Test bit 5 of DCT+03H at Index Register IY+03H, set for a rigid drive.
531A
If the NZ FLAG is set (a rigid drive), JUMP to 5344H for the boot sectors.
531C
BIT 7,(IY+03H) FD CB 03 7E
Test bit 7 of DCT+03H at Index Register IY+03H, set for an 8 inch drive.
5320
If the Z FLAG is set (a 5 inch drive), JUMP to 5344H for the boot sectors.
5322
LD HL,5673H 21 73 56
Point Register Pair HL to 5673H, the values DCT+0BH-13H of a single density 8 inch cylinder.
5325
LD BC,0009H 01 09 00
Load Register Pair BC with 0009H, the nine bytes DCT+0BH-13H.
5328
LDIR ED B0
Copy the single density values into DCT+0BH-13H: Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR).
532A
SET 0,(IY+03H) FD CB 03 C6
Set bit 0 of DCT+03H at Index Register IY+03H, the flag that the diskette is to be logged.
532E
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
5331
LD C,A 4F
Load Register C with Register A, the target drive, for DISKIO%.
5332
LD A,01H 3E 01
Load Register A with 01H, the function DHOME of DISKIO%, which moves the head to cylinder 0.
5334
GOSUB to 4488H, DISKIO%, to move the head of drive Register C to cylinder 0.
5337
LD D,00H 16 00
Load Register D with 00H, cylinder 0, the cylinder to format.
5339
GOSUB to 55FBH to format cylinder Register D in single density with 16 sectors.
533C
If the NZ FLAG is set (the format failed, its error code in Register A), JUMP to 552EH to post the error.
533F
LD HL,(574BH) 2A 4B 57
Load Register Pair HL with the first buffer from 574BH-574CH, the GAT of the target.
5342
LD (HL),FFH 36 FF
Store FFH into GAT+00H at Register Pair HL: every granule of cylinder 0 in use.

5344H - The Boot Sectors

From a bootstrap file: its first sector, with byte 2 set to the target's directory cylinder, goes to sectors 0 and 1 of cylinder 0, and the rest of the file to sectors 3 on. Without one: drive 0's cylinder 0 sectors 0 and 1, sector 0 with the directory cylinder of the target, are written to the target.

5344
BIT 1,(IX+00H) DD CB 00 4E
Test bit 1 of the flag byte at Index Register IX+00H, set by EVAL@ when a bootstrap file was given.
5348
If the Z FLAG is set (no bootstrap file), JUMP to 5394H to copy drive 0's boot sectors.
534A
LD DE,5777H 11 77 57
Point Register Pair DE to 5777H, the file control block of the bootstrap file.
534D
GOSUB to 4436H, READ@, to read the first sector of the bootstrap file into the fourth buffer.
5350
If the NZ FLAG is set (READ@ failed, its error code in Register A), JUMP to 552EH to post the error.
5353
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, the first sector of the bootstrap file.
5356
PUSH HL E5
Save Register Pair HL, the buffer, to the top of the stack.
5357
INC L 2C
INCrement Register L by 1, the first of two steps to byte 2.
5358
INC L 2C
INCrement Register L by 1: Register Pair HL = byte 2 of the boot sector, the directory cylinder.
5359
LD A,(5744H) 3A 44 57
Load Register A with the directory cylinder of the target from 5744H.
535C
LD (HL),A 77
Store Register A, the directory cylinder, into byte 2 of the boot sector at Register Pair HL.
535D
POP HL E1
Restore Register Pair HL, the buffer, from the top of the stack.
535E
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
5361
LD C,A 4F
Load Register C with Register A, the target drive, for DISKIO%.
5362
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, cylinder 0 in Register D and sector 0 in Register E.
5365
LD A,05H 3E 05
Load Register A with 05H, the function DWRITE of DISKIO%.
5367
GOSUB to 4488H, DISKIO%, to write cylinder Register D, sector Register E of drive Register C from the buffer at Register Pair HL.
536A
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
536D
INC E 1C
INCrement Register E by 1, to sector 1, which gets the same first sector of the file.
536E
LD A,05H 3E 05
Load Register A with 05H, the function DWRITE of DISKIO%.
5370
GOSUB to 4488H, DISKIO%, to write cylinder Register D, sector Register E of drive Register C from the buffer at Register Pair HL.
5373
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
5376
INC E 1C
INCrement Register E by 1, to sector 2, which SYSGEN writes itself.
5377
INC E 1C
INCrement Register E by 1, to sector 3, for the rest of the bootstrap file.
5378
PUSH DE D5
Save Register Pair DE, the cylinder and the sector, to the top of the stack around READ@.
5379
LD DE,5777H 11 77 57
Point Register Pair DE to 5777H, the file control block of the bootstrap file.
537C
GOSUB to 4436H, READ@, to read the next sector of the bootstrap file into the fourth buffer.
537F
POP DE D1
Restore Register Pair DE, the cylinder and the sector, from the top of the stack.
5380
If the Z FLAG is set (a sector was read), JUMP to 5389H to write it.
5382
CP 1CH FE 1C
Compare Register A against 1CH, the error code of Attempted to read past eof: the end of the bootstrap file.
5384
If the NZ FLAG is set (another error), JUMP to 552EH to post the error.
5387
JUMP to 53D1H for the configuration sector, the bootstrap file written.
5389
LD A,05H 3E 05
Load Register A with 05H, the function DWRITE of DISKIO%.
538B
GOSUB to 4488H, DISKIO%, to write cylinder Register D, sector Register E of drive Register C from the buffer at Register Pair HL.
538E
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
5391
INC E 1C
INCrement Register E by 1, to the next sector of cylinder 0.
5392
JUMP to 5378H for the next sector of the bootstrap file.
5394
LD C,00H 0E 00
Load Register C with 00H, drive 0, the system drive, whose boot sectors are copied.
5396
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H.
5399
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, cylinder 0 in Register D and sector 0 in Register E.
539C
LD A,03H 3E 03
Load Register A with 03H, the function DREAD of DISKIO%.
539E
GOSUB to 4488H, DISKIO%, to read cylinder Register D, sector Register E of drive Register C into the buffer at Register Pair HL.
53A1
If the NZ FLAG is set (the read failed, its error code in Register A), JUMP to 552EH to post the error.
53A4
INC L 2C
INCrement Register L by 1, the first of two steps to byte 2.
53A5
INC L 2C
INCrement Register L by 1: Register Pair HL = byte 2 of sector 0, the directory cylinder.
53A6
LD A,(5744H) 3A 44 57
Load Register A with the directory cylinder of the target from 5744H.
53A9
LD (HL),A 77
Store Register A, the directory cylinder, into byte 2 of sector 0 at Register Pair HL.
53AA
INC E 1C
INCrement Register E by 1, to sector 1, the boot code of the Model III.
53AB
LD HL,(5753H) 2A 53 57
Load Register Pair HL with the fifth buffer from 5753H-5754H, the page after the fourth.
53AE
LD A,03H 3E 03
Load Register A with 03H, the function DREAD of DISKIO%.
53B0
GOSUB to 4488H, DISKIO%, to read cylinder Register D, sector Register E of drive Register C into the buffer at Register Pair HL.
53B3
If the NZ FLAG is set (the read failed, its error code in Register A), JUMP to 552EH to post the error.
53B6
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
53B9
LD C,A 4F
Load Register C with Register A, the target drive, for DISKIO%.
53BA
LD E,00H 1E 00
Load Register E with 00H, sector 0 of cylinder 0.
53BC
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, drive 0's sector 0.
53BF
LD A,05H 3E 05
Load Register A with 05H, the function DWRITE of DISKIO%.
53C1
GOSUB to 4488H, DISKIO%, to write cylinder Register D, sector Register E of drive Register C from the buffer at Register Pair HL.
53C4
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
53C7
INC E 1C
INCrement Register E by 1, to sector 1 of cylinder 0.
53C8
INC H 24
INCrement Register H by 1, to the fifth buffer, drive 0's sector 1.
53C9
LD A,05H 3E 05
Load Register A with 05H, the function DWRITE of DISKIO%.
53CB
GOSUB to 4488H, DISKIO%, to write cylinder Register D, sector Register E of drive Register C from the buffer at Register Pair HL.
53CE
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.

53D1H - The Configuration Sector

Sector 2 of cylinder 0, the page of BOOT/SYS that SYS0/SYS reads at boot: DCT and the nine kept bytes DCT+0BH-13H, then fixed values: 10H the boot flags 0EH (time and date prompts, logo; bit 0 with XFER), 11H-12H XFER's address, 13H 00H, 14H 5FH (the cursor character), 15H 00H, 16H 03H (the step rate), the rest 00H. The target's DCT+0BH-13H are put back from 5680H.

53D1
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, for the configuration sector.
53D4
LD (HL),00H 36 00
Store 00H into the byte of the buffer at Register Pair HL.
53D6
INC L 2C
INCrement Register L by 1, to the next byte of the buffer: the Z FLAG past the last.
53D7
If the NZ FLAG is set (more bytes), JUMP to 53D4H to clear the next one.
53D9
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the buffer, Register Pair HL = the cylinder and sector.
53DA
LD HL,567DH 21 7D 56
Point Register Pair HL to 567DH, the three letters DCT and the nine kept bytes at 5680H.
53DD
LD BC,000CH 01 0C 00
Load Register Pair BC with 000CH, the twelve bytes at the start of the sector.
53E0
LDIR ED B0
Copy DCT and the drive's values to the buffer: Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR).
53E2
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the buffer after the twelve bytes.
53E3
LD L,10H 2E 10
Load Register L with 10H: Register Pair HL = byte 10H of the sector, the boot flags.
53E5
LD (HL),0EH 36 0E
Store 0EH into the boot flags at Register Pair HL: bit 3 the time prompt, bit 2 the date prompt, bit 1 the logo.
53E7
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the operand 53E8H-53E9H where EVAL@ stores the value of XFER, a number.
53EA
LD A,D 7A
Load Register A with Register D, the high byte of XFER's address.
53EB
OR E B3
OR Register A with Register E: the Z FLAG when no XFER was given.
53EC
If the Z FLAG is set (no XFER), JUMP to 53F0H.
53EE
SET 0,(HL) CB C6
Set bit 0 of the boot flags at Register Pair HL: an alternate system driver, entered at XFER's address.
53F0
INC L 2C
INCrement Register L by 1, to byte 11H of the sector.
53F1
LD (HL),E 73
Store Register E, the low byte of XFER's address, into byte 11H at Register Pair HL.
53F2
INC L 2C
INCrement Register L by 1, to byte 12H of the sector.
53F3
LD (HL),D 72
Store Register D, the high byte of XFER's address, into byte 12H at Register Pair HL.
53F4
INC L 2C
INCrement Register L by 1, to byte 13H of the sector, the cursor blink.
53F5
LD (HL),00H 36 00
Store 00H into byte 13H at Register Pair HL, the cursor blink.
53F7
INC L 2C
INCrement Register L by 1, to byte 14H of the sector, the cursor character.
53F8
LD (HL),5FH 36 5F
Store 5FH, the underline, into byte 14H at Register Pair HL, the cursor character.
53FA
INC L 2C
INCrement Register L by 1, to byte 15H of the sector, the caps setting.
53FB
LD (HL),00H 36 00
Store 00H into byte 15H at Register Pair HL, the caps setting.
53FD
INC L 2C
INCrement Register L by 1, to byte 16H of the sector, the default step rate.
53FE
LD (HL),03H 36 03
Store 03H into byte 16H at Register Pair HL, the default step rate.
5400
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
5403
LD C,A 4F
Load Register C with Register A, the target drive, for DISKIO%.
5404
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H, cylinder 0 in Register D and sector 2 in Register E.
5407
LD L,00H 2E 00
Load Register L with 00H: Register Pair HL = the start of the configuration sector.
5409
LD A,05H 3E 05
Load Register A with 05H, the function DWRITE of DISKIO%.
540B
GOSUB to 4488H, DISKIO%, to write cylinder Register D, sector Register E of drive Register C from the buffer at Register Pair HL.
540E
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
5411
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
5414
LD C,A 4F
Load Register C with Register A, the target drive, for LOCDCT%.
5415
GOSUB to 44A3H, LOCDCT%, to point Index Register IY to the drive control table of drive Register C.
5418
PUSH IY FD E5
Save Index Register IY, the drive control table, to the top of the stack.
541A
POP HL E1
Restore Register Pair HL from the top of the stack: Register Pair HL = the drive control table.
541B
LD DE,000BH 11 0B 00
Load Register Pair DE with 000BH, the offset of the diskette's values in a drive control table.
541E
ADD HL,DE 19
ADD Register Pair DE (000BH) to Register Pair HL: Register Pair HL = DCT+0BH.
541F
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = DCT+0BH.
5420
LD HL,5680H 21 80 56
Point Register Pair HL to 5680H, the kept values DCT+0BH-13H.
5423
LD BC,0009H 01 09 00
Load Register Pair BC with 0009H, the nine bytes DCT+0BH-13H.
5426
LDIR ED B0
Copy the kept values back into DCT+0BH-13H: Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR).

5428H - The System Files

For each logical file number from 02H to 14H (directory sectors 4 on, entry 0, moved on for a short directory by 55E1H), drive 0's entry is read; an active system file (bits 6 and 4) is copied: its entry goes into the target's directory with one new extent of granules found free in the GAT (5533H), from two cylinders below the target's directory cylinder up; the hash code of its name goes into the target's HIT; the file is read whole into the pages from the fourth buffer by READ@ and written by WRITE@ through a second file control block that points to the new extent.

5428
LD A,(5744H) 3A 44 57
Load Register A with the directory cylinder of the target from 5744H.
542B
SUB 02H D6 02
SUBtract 02H from Register A: two cylinders below the directory cylinder, where the system files begin.
542D
LD D,A 57
Load Register D with Register A, the first cylinder to look at for free granules.
542E
LD E,00H 1E 00
Load Register E with 00H, granule 0 of that cylinder.
5430
LD BC,0200H 01 00 02
Load Register Pair BC with 0200H: Register B = 02H, the first logical file number; Register C = 00H, drive 0.
5433
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, for the directory sector of drive 0.
5436
PUSH BC C5
Save Register Pair BC, the logical file number and the drive, to the top of the stack.
5437
GOSUB to 55E1H to fit the logical file number in Register B to the directory of drive Register C.
543A
GOSUB to 55B0H to read the directory sector of logical file number Register B; Register Pair HL = the entry.
543D
POP BC C1
Restore Register Pair BC, the logical file number and drive 0, from the top of the stack.
543E
If the NZ FLAG is set (the read failed, its error code in Register A), JUMP to 552EH to post the error.
5441
LD A,(HL) 7E
Load Register A with the flag byte of the entry at Register Pair HL.
5442
CPL 2F
Complement Register A (CPL), so that a set bit becomes a clear one.
5443
AND 50H E6 50
AND Register A with 50H, keeping bits 6 and 4: the Z FLAG for an active system file.
5445
If the NZ FLAG is set (not an active system file), JUMP to 5504H for the next logical file number.
5448
PUSH HL E5
Save Register Pair HL, the entry of drive 0, to the top of the stack.
5449
PUSH BC C5
Save Register Pair BC, the logical file number, to the top of the stack.
544A
PUSH DE D5
Save Register Pair DE, the place to look for free granules, to the top of the stack.
544B
PUSH HL E5
Save Register Pair HL, the entry of drive 0, to the top of the stack again for the copy.
544C
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
544F
LD C,A 4F
Load Register C with Register A, the target drive.
5450
GOSUB to 55E1H to fit the logical file number in Register B to the directory of drive Register C.
5453
LD HL,(5753H) 2A 53 57
Load Register Pair HL with the fifth buffer from 5753H-5754H, for the target's directory sector.
5456
GOSUB to 55B0H to read the target's directory sector of logical file number Register B; Register Pair HL = the entry.
5459
If the NZ FLAG is set (the read failed, its error code in Register A), JUMP to 552EH to post the error.
545C
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the target's entry.
545D
POP HL E1
Restore Register Pair HL, the entry of drive 0, from the top of the stack.
545E
PUSH DE D5
Save Register Pair DE, the target's entry, to the top of the stack.
545F
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of a directory entry.
5462
LDIR ED B0
Copy the entry of drive 0 to the target's entry: Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR).
5464
POP HL E1
Restore Register Pair HL, the target's entry, from the top of the stack.
5465
POP DE D1
Restore Register Pair DE, the place to look for free granules, from the top of the stack.
5466
PUSH HL E5
Save Register Pair HL, the target's entry, to the top of the stack.
5467
PUSH DE D5
Save Register Pair DE, the place to look for free granules, to the top of the stack.
5468
LD DE,0014H 11 14 00
Load Register Pair DE with 0014H, the offset of the sector count in an entry.
546B
ADD HL,DE 19
ADD Register Pair DE (0014H) to Register Pair HL: Register Pair HL = the sector count of the file.
546C
LD A,(HL) 7E
Load Register A with the low byte of the sector count at Register Pair HL.
546D
INC L 2C
INCrement Register L by 1, to the high byte of the sector count.
546E
LD H,(HL) 66
Load Register H with the high byte of the sector count at Register Pair HL.
546F
LD L,A 6F
Load Register L with Register A: Register Pair HL = the sectors of the file.
5470
POP DE D1
Restore Register Pair DE, the place to look for free granules, from the top of the stack.
5471
GOSUB to 5533H to take granules for Register Pair HL sectors from Register Pair DE on; Register Pair HL = the extent, Register Pair DE = the place after it.
5474
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the extent, Register Pair HL = the place after it.
5475
EX (SP),HL E3
Exchange the top of the stack at the Stack Pointer with Register Pair HL: the place after the extent kept, Register Pair HL = the target's entry.
5476
PUSH HL E5
Save Register Pair HL, the target's entry, to the top of the stack.
5477
LD BC,0016H 01 16 00
Load Register Pair BC with 0016H, the offset of the first extent in an entry.
547A
ADD HL,BC 09
ADD Register Pair BC (0016H) to Register Pair HL: Register Pair HL = the first extent of the target's entry.
547B
LD (HL),E 73
Store Register E, the cylinder of the new extent, into the first extent at Register Pair HL.
547C
INC L 2C
INCrement Register L by 1, to the granule byte of the extent.
547D
LD (HL),D 72
Store Register D, the granule byte of the new extent, into the extent at Register Pair HL.
547E
LD (5747H),DE ED 53 47 57
Store Register Pair DE, the new extent, into 5747H-5748H for the file control block of the copy.
5482
POP HL E1
Restore Register Pair HL, the target's entry, from the top of the stack.
5483
POP DE D1
Restore Register Pair DE, the place after the extent, from the top of the stack.
5484
POP BC C1
Restore Register Pair BC, the logical file number, from the top of the stack.
5485
PUSH BC C5
Save Register Pair BC, the logical file number, to the top of the stack again.
5486
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
5489
LD C,A 4F
Load Register C with Register A, the target drive.
548A
GOSUB to 55E1H to fit the logical file number in Register B to the directory of drive Register C.
548D
GOSUB to 55C4H to write the target's directory sector of logical file number Register B from the fifth buffer.
5490
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
5493
LD A,L 7D
Load Register A with Register L, the low byte of the target's entry.
5494
ADD A,05H C6 05
ADD 05H to Register A, the offset of the name in an entry.
5496
LD L,A 6F
Load Register L with Register A: Register Pair HL = the name and extension of the entry.
5497
GOSUB to 55A0H for the hash code in Register A of the 11 characters at Register Pair HL.
549A
LD HL,(574DH) 2A 4D 57
Load Register Pair HL with the second buffer from 574DH-574EH, the HIT of the target.
549D
LD L,B 68
Load Register L with Register B, the logical file number: the file's byte of the HIT.
549E
LD (HL),A 77
Store Register A, the hash code, into the file's byte of the HIT at Register Pair HL.
549F
POP BC C1
Restore Register Pair BC, the logical file number and drive 0, from the top of the stack.
54A0
POP HL E1
Restore Register Pair HL, the entry of drive 0, from the top of the stack.
54A1
PUSH DE D5
Save Register Pair DE, the place after the extent, to the top of the stack.
54A2
PUSH BC C5
Save Register Pair BC, the logical file number and drive 0, to the top of the stack.
54A3
GOSUB to 55E1H to fit the logical file number in Register B to the directory of drive Register C, drive 0.
54A6
LD IX,5756H DD 21 56 57
Point Index Register IX to 5756H, the file control block that reads the system file of drive 0.
54AA
GOSUB to 55F8H to fill the file control block at Index Register IX from the entry at Register Pair HL (SYS2/SYS routine 6).
54AD
LD (IX+01H),20H DD 36 01 20
Store 20H into FCB+01H at Index Register IX+01H: bit 5, the buffer is to be read before its first byte is used.
54B1
LD HL,5756H 21 56 57
Point Register Pair HL to 5756H, the file control block of the reader.
54B4
LD DE,5777H 11 77 57
Point Register Pair DE to 5777H, the second file control block, the writer.
54B7
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of a file control block.
54BA
LDIR ED B0
Copy the reader's file control block to the writer: Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR).
54BC
POP BC C1
Restore Register Pair BC, the logical file number, from the top of the stack.
54BD
PUSH BC C5
Save Register Pair BC, the logical file number, to the top of the stack again.
54BE
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
54C1
LD C,A 4F
Load Register C with Register A, the target drive.
54C2
GOSUB to 55E1H to fit the logical file number in Register B to the directory of drive Register C, the target.
54C5
LD (577DH),BC ED 43 7D 57
Store Register Pair BC into 577DH-577EH, FCB+06H and +07H of the writer: the target drive and the file's logical file number.
54C9
LD HL,(5747H) 2A 47 57
Load Register Pair HL with the new extent from 5747H-5748H.
54CC
LD (5785H),HL 22 85 57
Store Register Pair HL into 5785H-5786H, FCB+0EH of the writer: its first extent is the new one.
54CF
LD DE,5756H 11 56 57
Point Register Pair DE to 5756H, the file control block of the reader.
54D2
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, the first page for the file.
54D5
DEC H 25
DECrement Register H by 1, so that the INC below gives the fourth buffer.
54D6
INC H 24
INCrement Register H by 1, to the next page for the file.
54D7
LD (5759H),HL 22 59 57
Store Register Pair HL into 5759H-575AH, FCB+03H of the reader: its buffer is that page.
54DA
GOSUB to 4436H, READ@, to read the next sector of the system file into the page at Register Pair HL.
54DD
If the Z FLAG is set (a sector was read), JUMP to 54D6H for the next page.
54DF
CP 1DH FE 1D
Compare Register A against 1DH, the error code of Attempted to read outside of file limits.
54E1
If the Z FLAG is set (past the end), JUMP to 54E8H to write the file.
54E3
CP 1CH FE 1C
Compare Register A against 1CH, the error code of Attempted to read past eof.
54E5
If the NZ FLAG is set (another error), JUMP to 552EH to post the error.
54E8
LD (5749H),HL 22 49 57
Store Register Pair HL, the page after the last one read, into 5749H-574AH.
54EB
LD DE,5777H 11 77 57
Point Register Pair DE to 5777H, the file control block of the writer.
54EE
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, the first page of the file.
54F1
LD (577AH),HL 22 7A 57
Store Register Pair HL into 577AH-577BH, FCB+03H of the writer: its buffer is that page.
54F4
GOSUB to 4439H, WRITE@, to write the page as the next sector of the file at Register Pair DE on the target.
54F7
If the NZ FLAG is set (WRITE@ failed, its error code in Register A), JUMP to 552EH to post the error.
54FA
LD A,(574AH) 3A 4A 57
Load Register A with the high byte of the page after the last from 574AH.
54FD
DEC A 3D
DECrement Register A by 1, the last page of the file.
54FE
INC H 24
INCrement Register H by 1, to the next page of the file to write.
54FF
CP H BC
Compare Register A, the last page, against Register H: the NC FLAG while Register H is not past it.
5500
If the NC FLAG is set (more pages), JUMP to 54F1H to write the next one.
5502
POP BC C1
Restore Register Pair BC, the logical file number and drive 0, from the top of the stack.
5503
POP DE D1
Restore Register Pair DE, the place after the extent, from the top of the stack.
5504
LD A,B 78
Load Register A with Register B, the logical file number just done.
5505
INC B 04
INCrement Register B by 1, to the next logical file number.
5506
CP 14H FE 14
Compare Register A against 14H, the last logical file number of the system files.
5508
If the C FLAG is set (more files), JUMP to 5433H for the next logical file number.

550BH - The End

The GAT and the HIT of the target are written (SWRITE of sectors 0 and 1); SYSGEN ends by EXIT@ without a message. 5524H is Disk contains illegal files and ABORT@; 552DH posts the error code in Register B, 552EH the one in Register A, with bit 6 set (no frame), so ERROR@ ends through ABORT@.

550B
LD A,(5746H) 3A 46 57
Load Register A with the target drive from 5746H.
550E
LD C,A 4F
Load Register C with Register A, the target drive, for DISKIO%.
550F
LD B,02H 06 02
Load Register B with 02H, the two sectors to write: the GAT and the HIT.
5511
LD E,00H 1E 00
Load Register E with 00H, directory sector 0, the GAT.
5513
LD HL,(574BH) 2A 4B 57
Load Register Pair HL with the first buffer from 574BH-574CH, the GAT of the target.
5516
LD A,07H 3E 07
Load Register A with 07H, the function SWRITE of DISKIO%, which writes a sector of the directory cylinder.
5518
GOSUB to 4488H, DISKIO%, to write sector Register E of the directory of drive Register C from the buffer at Register Pair HL.
551B
If the NZ FLAG is set (the write failed, its error code in Register A), JUMP to 552EH to post the error.
551D
INC E 1C
INCrement Register E by 1, to directory sector 1, the HIT.
551E
INC H 24
INCrement Register H by 1, to the second buffer, the HIT.
551F
DECrement Register B and, while it is not zero, LOOP BACK to 5516H for the HIT (DJNZ).
5521
JUMP to 402DH, EXIT@, back to the DOS with the system disk made.
5524
LD HL,5728H 21 28 57
Point Register Pair HL to 5728H, the message Disk contains illegal files.
5527
GOSUB to 4467H, DSPLY@, to display the message at Register Pair HL.
552A
JUMP to 4030H, ABORT@, which ends SYSGEN and returns to the DOS.
552D
LD A,B 78
Load Register A with Register B, the error code.
552E
OR 40H F6 40
OR Register A with 40H, setting bit 6 of the error code: ERROR@ shows the message without the frame of asterisks.
5530
JUMP to 4409H, ERROR@, with the error code in Register A; with bit 7 clear ERROR@ does not return but ends through ABORT@.

5533H - Granules for a File

Register Pair HL = the sectors of the file, Register Pair DE = a cylinder and a granule: finds the first run of free granules (DCT+0FH sectors each, the count rounded up) from there on in the GAT, crossing to the next cylinder after DCT+10H granules, and sets them in use. Returns Register Pair HL = the extent (Register L the cylinder, Register H the starting granule in bits 7-5 and the granules less 1 in bits 4-0) and Register Pair DE = the granule after the run.

5533
PUSH BC C5
Save Register Pair BC to the top of the stack.
5534
LD A,(IY+0FH) FD 7E 0F
Load Register A with the sectors per granule from DCT+0FH, Index Register IY+0FH.
5537
GOSUB to 4451H, DIVD@, to divide Register Pair HL by Register A: the granules in Register Pair HL, the sectors left over in Register A.
553A
OR A B7
OR Register A with itself, to test the sectors left over for zero.
553B
If the Z FLAG is set (whole granules), JUMP to 553EH.
553D
INC HL 23
INCrement Register Pair HL by 1, one more granule for the sectors left over.
553E
LD B,L 45
Load Register B with Register L, the granules the file needs.
553F
PUSH BC C5
Save Register Pair BC, the granules needed, to the top of the stack.
5540
PUSH DE D5
Save Register Pair DE, the start of the run, to the top of the stack.
5541
LD HL,(574BH) 2A 4B 57
Load Register Pair HL with the first buffer from 574BH-574CH, the GAT of the target.
5544
LD L,D 6A
Load Register L with Register D, the cylinder: Register Pair HL = its byte of the GAT.
5545
LD A,(HL) 7E
Load Register A with the GAT byte of the cylinder at Register Pair HL.
5546
GOSUB to 5590H to test the bit of granule Register E in Register A: the Z FLAG when it is free.
5549
PUSH AF F5
Save Register Pair AF, the Z FLAG of the test, to the top of the stack.
554A
LD A,(IY+10H) FD 7E 10
Load Register A with the granules per cylinder from DCT+10H, Index Register IY+10H.
554D
INC E 1C
INCrement Register E by 1, to the next granule.
554E
SUB E 93
SUBtract Register E from Register A: the Z FLAG when Register E has passed the last granule of the cylinder.
554F
If the NZ FLAG is set (the same cylinder), JUMP to 5553H.
5551
LD E,A 5F
Load Register E with Register A (00H), granule 0 of the next cylinder.
5552
INC D 14
INCrement Register D by 1, to the next cylinder.
5553
POP AF F1
Restore Register Pair AF, the Z FLAG of the test, from the top of the stack.
5554
If the Z FLAG is set (the granule was free), JUMP to 555AH to count it in the run.
5556
POP AF F1
Restore Register Pair AF from the top of the stack, dropping the start of the run.
5557
POP BC C1
Restore Register Pair BC, the granules needed, from the top of the stack.
5558
JUMP to 553FH to start a new run after the granule in use.
555A
DECrement Register B and, while it is not zero, LOOP BACK to 5541H for the next granule of the run (DJNZ).
555C
POP DE D1
Restore Register Pair DE, the start of the run, from the top of the stack.
555D
POP BC C1
Restore Register Pair BC, the granules needed, from the top of the stack.
555E
PUSH BC C5
Save Register Pair BC, the granules needed, to the top of the stack again.
555F
PUSH DE D5
Save Register Pair DE, the start of the run, to the top of the stack again.
5560
LD HL,(574BH) 2A 4B 57
Load Register Pair HL with the first buffer from 574BH-574CH, the GAT of the target.
5563
LD L,D 6A
Load Register L with Register D, the cylinder: Register Pair HL = its byte of the GAT.
5564
LD A,(HL) 7E
Load Register A with the GAT byte of the cylinder at Register Pair HL.
5565
GOSUB to 5580H to set the bit of granule Register E in Register A: the granule in use.
5568
LD (HL),A 77
Store Register A, the GAT byte, into the GAT at Register Pair HL.
5569
LD A,(IY+10H) FD 7E 10
Load Register A with the granules per cylinder from DCT+10H, Index Register IY+10H.
556C
INC E 1C
INCrement Register E by 1, to the next granule.
556D
SUB E 93
SUBtract Register E from Register A: the Z FLAG when Register E has passed the last granule of the cylinder.
556E
If the NZ FLAG is set (the same cylinder), JUMP to 5572H.
5570
LD E,A 5F
Load Register E with Register A (00H), granule 0 of the next cylinder.
5571
INC D 14
INCrement Register D by 1, to the next cylinder.
5572
DECrement Register B and, while it is not zero, LOOP BACK to 5560H for the next granule of the run (DJNZ).
5574
POP HL E1
Restore Register Pair HL, the start of the run, from the top of the stack: Register H the cylinder, Register L the granule.
5575
POP BC C1
Restore Register Pair BC, the granules of the run, from the top of the stack.
5576
LD A,L 7D
Load Register A with Register L, the starting granule.
5577
LD L,H 6C
Load Register L with Register H, the cylinder, the first byte of the extent.
5578
RRCA 0F
Rotate Register A right one bit, the first of three that bring the granule to bits 7-5 (RRCA).
5579
RRCA 0F
Rotate Register A right one bit, the second of three (RRCA).
557A
RRCA 0F
Rotate Register A right one bit, the third of three: the starting granule in bits 7-5 (RRCA).
557B
DEC B 05
DECrement Register B by 1, the granules of the run less 1.
557C
OR B B0
OR Register A with Register B, the granules less 1 into bits 4-0.
557D
LD H,A 67
Load Register H with Register A, the second byte of the extent.
557E
POP BC C1
Restore Register Pair BC from the top of the stack.
557F
RET C9
RETurn to the caller with the extent in Register Pair HL and the next place in Register Pair DE.

5580H - Set or Test a Granule's Bit

5580H sets bit Register E (0-7) of Register A by a SET n,A whose second byte is made at 558EH; 5590H tests it by a BIT n,A made at 559EH (the Z FLAG when the granule is free).

5580
PUSH AF F5
Save Register Pair AF, the GAT byte in Register A, to the top of the stack.
5581
LD A,E 7B
Load Register A with Register E, the granule on its cylinder.
5582
AND 07H E6 07
AND Register A with 07H, keeping the bit number 0-7.
5584
RLCA 07
Rotate Register A left one bit, the first of three that bring the bit number to bits 5-3 (RLCA).
5585
RLCA 07
Rotate Register A left one bit, the second of three (RLCA).
5586
RLCA 07
Rotate Register A left one bit, the third of three: the bit number in bits 5-3 (RLCA).
5587
OR C7H F6 C7
OR Register A with C7H, making the second byte of SET n,A.
5589
LD (558EH),A 32 8E 55
Store Register A into 558EH, the second byte of the SET below.
558C
POP AF F1
Restore Register Pair AF, the GAT byte in Register A, from the top of the stack.
558D
SET 0,A CB C7
Set bit n of Register A, n made at 558EH: the granule is in use (SET 0,A as loaded).
558F
RET C9
RETurn to the caller with the bit of the granule set in Register A.
5590
PUSH AF F5
Save Register Pair AF, the GAT byte in Register A, to the top of the stack.
5591
LD A,E 7B
Load Register A with Register E, the granule on its cylinder.
5592
AND 07H E6 07
AND Register A with 07H, keeping the bit number 0-7.
5594
RLCA 07
Rotate Register A left one bit, the first of three that bring the bit number to bits 5-3 (RLCA).
5595
RLCA 07
Rotate Register A left one bit, the second of three (RLCA).
5596
RLCA 07
Rotate Register A left one bit, the third of three: the bit number in bits 5-3 (RLCA).
5597
OR 47H F6 47
OR Register A with 47H, making the second byte of BIT n,A.
5599
LD (559EH),A 32 9E 55
Store Register A into 559EH, the second byte of the BIT below.
559C
POP AF F1
Restore Register Pair AF, the GAT byte in Register A, from the top of the stack.
559D
BIT 0,A CB 47
Test bit n of Register A, n made at 559EH: the Z FLAG when the granule is free (BIT 0,A as loaded).
559F
RET C9
RETurn to the caller with the Z FLAG for a free granule.

55A0H - The Hash Code of a Name

The 11 characters at Register Pair HL, each XORed in and the result rotated left; 00H becomes 01H, as the DOS's hash codes are never 00H.

55A0
PUSH BC C5
Save Register Pair BC to the top of the stack.
55A1
LD BC,0B00H 01 00 0B
Load Register Pair BC with 0B00H: Register B = 0BH, the 11 characters; Register C = 00H, the code so far.
55A4
LD A,(HL) 7E
Load Register A with the next character of the name at Register Pair HL.
55A5
INC L 2C
INCrement Register L by 1, to the next character.
55A6
XOR C A9
XOR Register A with Register C, the code so far.
55A7
RLCA 07
Rotate Register A left one bit (RLCA), the code with the character in it.
55A8
LD C,A 4F
Load Register C with Register A, the code so far.
55A9
DECrement Register B and, while it is not zero, LOOP BACK to 55A4H for the next character (DJNZ).
55AB
POP BC C1
Restore Register Pair BC from the top of the stack.
55AC
OR A B7
OR Register A with itself, to test the code for zero.
55AD
RET NZ C0
If the NZ FLAG is set (not 00H), RETurn to the caller with the hash code in Register A.
55AE
INC A 3C
INCrement Register A by 1: the code 00H becomes 01H.
55AF
RET C9
RETurn to the caller with the hash code 01H in Register A.

55B0H - A Directory Sector by Logical File Number

55B0H reads (error 11H) and 55C4H writes (error 12H) the directory sector of logical file number Register B on drive Register C through the page at Register Pair HL, whose Register L becomes the entry's offset (55D8H: bits 7-5 the entry, bits 4-0 the sector less 2). 55E1H fits a logical file number of the first directory sectors to a short directory: when its sector is past DCT+0EH it moves to the next entry of an earlier sector (bit 5), or the one after (bit 6).

55B0
PUSH BC C5
Save Register Pair BC, the logical file number and the drive, to the top of the stack.
55B1
PUSH DE D5
Save Register Pair DE to the top of the stack.
55B2
GOSUB to 55D8H for Register E = the sector and Register L = the offset of the entry of logical file number Register B.
55B5
PUSH HL E5
Save Register Pair HL, the address of the entry, to the top of the stack.
55B6
LD L,00H 2E 00
Load Register L with 00H: Register Pair HL = the start of the page.
55B8
LD A,06H 3E 06
Load Register A with 06H, the function SREAD of DISKIO%, which reads a sector of the directory cylinder.
55BA
GOSUB to 4488H, DISKIO%, to read sector Register E of the directory of drive Register C into the buffer at Register Pair HL.
55BD
POP HL E1
Restore Register Pair HL, the address of the entry, from the top of the stack.
55BE
POP DE D1
Restore Register Pair DE from the top of the stack.
55BF
POP BC C1
Restore Register Pair BC, the logical file number and the drive, from the top of the stack.
55C0
RET Z C8
If the Z FLAG is set (the read worked), RETurn to the caller with Register Pair HL at the entry.
55C1
LD A,11H 3E 11
Load Register A with 11H, the error code of Directory read error.
55C3
RET C9
RETurn to the caller with the error code 11H in Register A and the NZ FLAG.
55C4
PUSH BC C5
Save Register Pair BC, the logical file number and the drive, to the top of the stack.
55C5
PUSH DE D5
Save Register Pair DE to the top of the stack.
55C6
GOSUB to 55D8H for Register E = the sector and Register L = the offset of the entry of logical file number Register B.
55C9
PUSH HL E5
Save Register Pair HL, the address of the entry, to the top of the stack.
55CA
LD L,00H 2E 00
Load Register L with 00H: Register Pair HL = the start of the page.
55CC
LD A,07H 3E 07
Load Register A with 07H, the function SWRITE of DISKIO%, which writes a sector of the directory cylinder.
55CE
GOSUB to 4488H, DISKIO%, to write sector Register E of the directory of drive Register C from the buffer at Register Pair HL.
55D1
POP HL E1
Restore Register Pair HL, the address of the entry, from the top of the stack.
55D2
POP DE D1
Restore Register Pair DE from the top of the stack.
55D3
POP BC C1
Restore Register Pair BC, the logical file number and the drive, from the top of the stack.
55D4
RET Z C8
If the Z FLAG is set (the write worked), RETurn to the caller.
55D5
LD A,12H 3E 12
Load Register A with 12H, the error code of Directory write error.
55D7
RET C9
RETurn to the caller with the error code 12H in Register A and the NZ FLAG.
55D8
LD A,B 78
Load Register A with Register B, the logical file number.
55D9
AND E0H E6 E0
AND Register A with E0H, keeping bits 7-5, the entry within its sector.
55DB
LD L,A 6F
Load Register L with Register A, the offset of the entry: 00H, 20H ... E0H.
55DC
XOR B A8
XOR Register A with Register B: Register A = bits 4-0, the sector less 2.
55DD
ADD A,02H C6 02
ADD 02H to Register A: the directory sector of the entry.
55DF
LD E,A 5F
Load Register E with Register A, the directory sector.
55E0
RET C9
RETurn to the caller with the sector in Register E and the offset in Register L.
55E1
GOSUB to 44A3H, LOCDCT%, to point Index Register IY to the drive control table of drive Register C.
55E4
LD A,B 78
Load Register A with Register B, the logical file number.
55E5
ADD A,02H C6 02
ADD 02H to Register A: the directory sector of the logical file number.
55E7
SUB (IY+0EH) FD 96 0E
SUBtract the directory's sectors at DCT+0EH, Index Register IY+0EH, from Register A: the C FLAG when the sector is in the directory.
55EA
RET C D8
If the C FLAG is set (it fits), RETurn to the caller with Register B as it was.
55EB
LD B,A 47
Load Register B with Register A, the sector less the directory's length.
55EC
SET 5,B CB E8
Set bit 5 of Register B: the second entry of that sector.
55EE
ADD A,02H C6 02
ADD 02H to Register A, the sector of the new logical file number.
55F0
SUB (IY+0EH) FD 96 0E
SUBtract the directory's sectors at DCT+0EH, Index Register IY+0EH, from Register A: the C FLAG when that sector is in the directory.
55F3
RET C D8
If the C FLAG is set (it fits), RETurn to the caller with the new logical file number in Register B.
55F4
SET 6,A CB F7
Set bit 6 of Register A: the third entry of the sector after that.
55F6
LD B,A 47
Load Register B with Register A, the new logical file number.
55F7
RET C9
RETurn to the caller with the new logical file number in Register B.
55F8
LD A,16H 3E 16
Load Register A with 16H, the overlay request for SYS2/SYS routine 6: fill a file control block from a directory entry.
55FA
RST 28H EF
RST 28H, the overlay request in Register A: SYS2/SYS fills the file control block at Index Register IX from the entry at Register Pair HL.

55FBH - Format a Single Density Cylinder

Builds the track image for cylinder Register D in the fourth buffer from the count and byte pairs at 568AH (the gap and index mark, then for each of DCT+0DH sectors the ID with the sector number from the table at 56AAH and a data field of 256 bytes 6CH, then the end), and writes it by DFORMT.

55FB
PUSH BC C5
Save Register Pair BC, the drive in Register C, to the top of the stack.
55FC
PUSH DE D5
Save Register Pair DE, the cylinder in Register D, to the top of the stack.
55FD
LD C,(IY+0DH) FD 4E 0D
Load Register C with the sectors per track from DCT+0DH, Index Register IY+0DH, the count of sectors to format.
5600
LD A,D 7A
Load Register A with Register D, the cylinder to format.
5601
LD (5628H),A 32 28 56
Store Register A, the cylinder, into 5628H, the operand of LD (HL) at 5627H, the cylinder byte of each ID.
5604
LD DE,56AAH 11 AA 56
Point Register Pair DE to 56AAH, the order of the sector numbers on the track.
5607
PUSH DE D5
Save Register Pair DE, the place in the sector numbers, to the top of the stack.
5608
LD DE,568AH 11 8A 56
Point Register Pair DE to 568AH, the count and byte pairs of the track.
560B
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, the place of the track image.
560E
GOSUB to 5669H to store the next count and byte pair: 0BH bytes FFH, the gap at the start of the track.
5611
GOSUB to 5669H to store the next count and byte pair: one FCH, the index mark.
5614
GOSUB to 5669H to store the next count and byte pair: 14H bytes FFH, the gap after the index mark.
5617
LD (561CH),DE ED 53 1C 56
Store Register Pair DE (5690H), the pairs of each sector, into 561CH-561DH, the operand of LD DE at 561BH.
561B
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the operand 561CH-561DH set to 5690H: the pairs of each sector.
561E
GOSUB to 5669H to store the next count and byte pair: three bytes 00H.
5621
GOSUB to 5669H to store the next count and byte pair: three more bytes 00H before the ID.
5624
LD (HL),FEH 36 FE
Store FEH, the ID address mark, into the track image at Register Pair HL.
5626
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
5627
LD (HL),00H 36 00
Store the cylinder, the operand 5628H set at 5601H (00H as loaded), into the ID at Register Pair HL.
5629
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
562A
LD (HL),00H 36 00
Store 00H, the side, into the ID at Register Pair HL.
562C
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
562D
EX (SP),HL E3
Exchange the top of the stack at the Stack Pointer with Register Pair HL: Register Pair HL = the place in the sector numbers.
562E
LD A,(HL) 7E
Load Register A with the next sector number at Register Pair HL.
562F
INC HL 23
INCrement Register Pair HL by 1, to the next sector number.
5630
EX (SP),HL E3
Exchange the top of the stack at the Stack Pointer with Register Pair HL: Register Pair HL = the track image again.
5631
LD (HL),A 77
Store Register A, the sector number, into the ID at Register Pair HL.
5632
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
5633
LD (HL),01H 36 01
Store 01H, the length code of a 256 byte sector, into the ID at Register Pair HL.
5635
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
5636
LD (HL),F7H 36 F7
Store F7H, which makes the controller write the two CRC bytes of the ID, at Register Pair HL.
5638
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
5639
GOSUB to 5669H to store the next count and byte pair: 0BH bytes FFH, the gap after the ID.
563C
GOSUB to 5669H to store the next count and byte pair: three bytes 00H.
563F
GOSUB to 5669H to store the next count and byte pair: three more bytes 00H before the data.
5642
LD (HL),FBH 36 FB
Store FBH, the data address mark, into the track image at Register Pair HL.
5644
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
5645
LD B,00H 06 00
Load Register B with 00H, the 256 bytes of the data field.
5647
LD A,6CH 3E 6C
Load Register A with 6CH, the byte that fills a new sector.
5649
GOSUB to 566EH to store Register B (256) bytes of Register A at Register Pair HL.
564C
LD (HL),F7H 36 F7
Store F7H, which makes the controller write the two CRC bytes of the data, at Register Pair HL.
564E
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
564F
GOSUB to 5669H to store the next count and byte pair: 0BH bytes FFH, the gap after the sector.
5652
DEC C 0D
DECrement Register C by 1, one sector formatted: the Z FLAG when all are done.
5653
If the NZ FLAG is set (more sectors), JUMP to 561BH for the next sector.
5655
GOSUB to 5669H to store the next count and byte pair: 256 bytes FFH, the gap at the end of the track.
5658
GOSUB to 5669H to store the next count and byte pair: 256 more bytes FFH.
565B
POP DE D1
Restore Register Pair DE from the top of the stack, dropping the place in the sector numbers.
565C
POP DE D1
Restore Register Pair DE, the cylinder in Register D, from the top of the stack.
565D
POP BC C1
Restore Register Pair BC, the drive in Register C, from the top of the stack.
565E
LD E,00H 1E 00
Load Register E with 00H, sector 0, for the DFORMT of the whole track.
5660
LD HL,(5751H) 2A 51 57
Load Register Pair HL with the fourth buffer from 5751H-5752H, the track image.
5663
LD A,09H 3E 09
Load Register A with 09H, the function DFORMT of DISKIO%, which writes a whole track.
5665
GOSUB to 4488H, DISKIO%, to format cylinder Register D of drive Register C with the track image at Register Pair HL.
5668
RET C9
RETurn to the caller with the Z FLAG of DFORMT, or the NZ FLAG and its error code in Register A.
5669
LD A,(DE) 1A
Load Register A with the count of the pair at Register Pair DE.
566A
INC DE 13
INCrement Register Pair DE by 1, to the byte of the pair.
566B
LD B,A 47
Load Register B with Register A, the count of the pair (00H for 256).
566C
LD A,(DE) 1A
Load Register A with the byte of the pair at Register Pair DE.
566D
INC DE 13
INCrement Register Pair DE by 1, to the next pair.
566E
LD (HL),A 77
Store Register A, the byte, into the track image at Register Pair HL.
566F
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the track image.
5670
DECrement Register B and, while it is not zero, LOOP BACK to 566EH for the next byte (DJNZ).
5672
RET C9
RETurn to the caller with Register Pair DE at the next pair and Register Pair HL after the bytes.

5673H - The Data

The values DCT+0BH-13H of a single density 8 inch cylinder, DCT and the kept bytes (5680H-5688H, not loaded), the count and byte pairs of a single density track, a table of 10 sector numbers no instruction uses, the table of 16 sector numbers, the evaluation block with XFER (type 40H, a number), the heading (version 3.52) and the message. 5744H on is not loaded.

5673-567B
DEFB 40H,01H,10H,FFH,10H,01H,10H,00H,FFH 40 01 10 FF 10 01 10 00 FF
DCT+0BH-13H for a single density 8 inch cylinder 0 (5322H): one surface, 16 sectors a track, granules of 16 sectors, one a cylinder, 16 sectors a cylinder.
567C
DEFB FFH FF
A byte after the nine values that no instruction reads.
567D-567F
DEFM "DCT" 44 43 54
The three letters at the start of the configuration sector (53DAH), as in BOOT/SYS's sector 2.
5680-5688
DEFS 9
The target's DCT+0BH-13H, kept (5307H), written after DCT in the configuration sector and put back (5420H).
5689
DEFS 1
A byte not loaded and not used, between the kept values and the pairs.
568A-568F
DEFB 0BH,FFH,01H,FCH,14H,FFH 0B FF 01 FC 14 FF
The start of the track (560EH): 0BH bytes FFH, one FCH (the index mark), 14H bytes FFH.
5690-569B
DEFB 03H,00H,03H,00H,0BH,FFH,03H,00H,03H,00H,0BH,FFH 03 00 03 00 0B FF 03 00 03 00 0B FF
The pairs of each sector (561BH): six bytes 00H before the ID, then 0BH bytes FFH and six bytes 00H before the data, then 0BH bytes FFH after it.
569C-569F
DEFB 00H,FFH,00H,FFH 00 FF 00 FF
The end of the track (5655H): 256 bytes FFH twice.
56A0-56A9
DEFB 00H,05H,01H,06H,02H,07H,03H,08H,04H,09H 00 05 01 06 02 07 03 08 04 09
An order of 10 sector numbers, for a 5 inch single density track; no instruction points to it.
56AA-56B9
DEFB 00H,0BH,06H,01H,0CH,07H,02H,0DH,08H,03H,0EH,09H,04H,0FH,0AH,05H 00 0B 06 01 0C 07 02 0D 08 03 0E 09 04 0F 0A 05
The order of the 16 sector numbers of the 8 inch cylinder 0 (5604H).
56BA
DEFB 00H 00
The flags of the evaluation block, set by EVAL@: bit 0 the source, 1 the destination, 2 the wildmask, 3 the parameters.
56BB-56BC
DEFW 5755H 55 57
The address of the source field's block, 5755H, the target drive.
56BD-56BE
DEFW 5776H 76 57
The address of the destination field's block, 5776H, the bootstrap file.
56BF-56C0
DEFW 5776H 76 57
The address of the wildmask field's block, the destination block again.
56C1-56C2
DEFW 56C3H C3 56
The address of the parameter block, 56C3H, the entry XFER.
56C3-56C8
DEFM "XFER " 58 46 45 52 20 20
The name of the parameter XFER (or X): the address of an alternate system driver.
56C9-56CA
DEFW 53E8H E8 53
The address for XFER's value, the operand of LD DE at 53E7H.
56CB
DEFB 40H 40
The type byte of XFER: a number only (bit 6).
56CC
DEFB 00H 00
The 00H that ends the parameter block of SYSGEN's one parameter.
56CD-56F6
DEFM "SYSGEN - DOSPLUS System generation - 3.52" / DEFB 0AH 53 59 53 47 45 4E 20 2D 20 44 4F 53 50 4C 55 53 20 53 79 73 74 65 6D 20 67 65 6E 65 72 61 74 69 6F 6E 20 2D 20 33 2E 35 32 0A
The heading (5201H): SYSGEN - DOSPLUS System generation - 3.52 and a line feed.
56F7-5727
DEFM "(c) Copyright 1983, Micro-Systems Software Inc." / DEFB 0AH,0DH 28 63 29 20 43 6F 70 79 72 69 67 68 74 20 31 39 38 33 2C 20 4D 69 63 72 6F 2D 53 79 73 74 65 6D 73 20 53 6F 66 74 77 61 72 65 20 49 6E 63 2E 0A 0D
The copyright line, a line feed and the 0DH at which DSPLY@ stops.
5728-5743
DEFM "Disk contains illegal files" / DEFB 0DH 44 69 73 6B 20 63 6F 6E 74 61 69 6E 73 20 69 6C 6C 65 67 61 6C 20 66 69 6C 65 73 0D
The message for a target whose HIT shows a file other than BOOT/SYS and DIR/SYS (5524H).
5744
DEFS 1
The directory cylinder of the target (52EFH).
5745
DEFS 1
FFH when the target's cylinder 0 is double density (52D5H); only written then.
5746
DEFS 1
The target drive (5287H), read again for each disk call.
5747-5748
DEFS 2
The new extent of the system file being copied (547EH).
5749-574A
DEFS 2
The page after the last one of the file read (54E8H).
574B-5754
DEFS 10
The five buffer pages (5219H-522DH): the GAT, the HIT, directory sector 2, the boot sectors and files, the target's directory sectors.
5755-5775
DEFS 33
The source field's block (56BBH), the drive; from 5756H the file control block that reads a system file (54A6H).
5776-5796
DEFS 33
The destination field's block (56BDH): from 5777H the file control block of the bootstrap file, then of the writer (54B4H).