LDOS 5.3.1 for the Model III - QFB/CMD Disassembled

Page Customization

Introduction/Summary

LDOS 5.3.1 QFB/CMD Disassembly - The Quick Format and Backup (Model III)

QFB/CMD, the LDOS Quick Format and Backup, makes a mirror image copy of a floppy disk in one pass: QFB :s :d (QUERY, ALL, V1, V2) (M-40-060, where DISKCOPY is the version 6 utility of the same kind). For each cylinder it formats the destination with the Write Track command, reads the source cylinder into memory, writes it and, with V1 (the default), reads it back and compares the sum of its bytes with the source's. With V2 the whole destination is read back once more at the end. Only the cylinders that hold data are read and written unless ALL is given; QUERY asks the three questions. The source must be a floppy (or a drive with its own driver, a MemDISK), the destination a floppy of the same size; its drive code table takes the source's density, sides and cylinders.

The file is a load module of 4121 bytes without a copyright record: seventeen load blocks for 5200H-5697H, 570CH-5CF0H and 5CF3H-6246H (4049 bytes) and the transfer address record for 5200H. One file serves the Model I and the Model III: the start-up tests the ROM and stores the Model I addresses of four system cells into the operands. Six format tables describe the tracks of 5 and 8 inch disks in single and double density, two of them with a closer interleave for the FAST speed. While QFB copies, the RST 38H vector at 4012H holds a RET, so the clock stops; the drive code tables are put back as they were at the end.

What QFB Does

StepWhat Happens
The startThe Model I operands, the copy of the drive code tables, the banner, the parameters by @PARAM and the drive digits of the command line (5200H, 6201H, 5577H).
The drives and questionsSource drive ? and Destination drive ? for a drive not given; with QUERY the three questions for ALL, V1 and V2 (5234H, 5282H, 559BH).
The sourceThe prompt to load the disks; the source must be a floppy that turns; its boot sector and allocation table give the directory cylinder, the cylinders and the sides; the memory test and the format table (52BDH, 5A04H, 5507H).
The destinationNot write protected, not a hard disk, the source's size; its drive code table takes the source's values (533AH, 535FH).
The copyFor each cylinder: format, read the source, write, verify; a destination with errors is dropped; SHIFT @ pauses, BREAK stops (53C4H, 5A33H, 60CFH, 5BA6H, 61C1H).
The endThe second pass with V2, the count of the disks made; ENTER copies again, R starts again with the questions, BREAK ends; the system is put back (5462H, 5484H, 5C37H).

About This Page

The site has no Model I page of QFB/CMD, so this page is written from the bytes of the Model III file alone; the seven operands that the code changes on the Model I are named with both values on their rows. Every byte of the file is shown at its address. Found in the code: the memory test (5507H) takes the sectors of a track from byte +07H of the drive code table with the mask 0FH, so that a double density track of 18 sectors counts as 2 and an 8 inch one of 30 as 14; the test then asks for far less memory than the cylinder buffer from 6700H uses (for a 5 inch double density disk with two sides, 36 pages up to 8B00H). An error found by the second pass (V2) stops that pass for the disk but gives no message, does not drop the disk and does not keep it from the count of the disks made (5476H). A double density source with a destination whose byte +04H has bit 6 clear is accepted without its sides, cylinders and sectors being set (539AH); every floppy table of the Model III's SYS0/SYS has bit 6 set. The drive number given to the driver is the digit OR 07H, 37H for every drive (54F4H); the floppy driver selects by byte +04H and does not use it. The code is written for a list of destinations, but the command line and the question take one. A disk is refused when bit 4 of byte CDH of its allocation table is set, with the text Cannot duplicate disk with protected files. The count of the disks made is never cleared, and the letter s of disks stays once written. A source cylinder that cannot be read is read once more; a cylinder that fails its verify is written once more. Not used: the decimal input 5564H, the hex output 60BBH, the driver calls 5CA3H (write) and 5CB7H (verify), the text Source READ error - at 6015H and the 22 spaces at 5786H; 5691H and 5694H are written and never read. The note that the clock is no longer accurate is shown at every end, even when QFB ends at a question before the clock was stopped.

Memory Map

Load Blocks in File Order

The seventeen load blocks of the file: 4049 bytes. 5698H-570BH and 5CF1H-5CF2H are not in the file. The transfer address is 5200H. The file has no copyright record.

AddressContents
5200H-52FFH, 5300H-53FFH, 5400H-54FFH, 5500H-55FFH256 bytes each: the start, the drives and questions, the source and destination, the copy loop, the memory test, the questions and the errors
5600H-5697H152 bytes: the errors that end QFB, the parameter table, the defaults and the values
570CH-580BH, 580CH-590BH, 590CH-5A0BH, 5A0CH-5B0BH, 5B0CH-5C0BH256 bytes each: the texts, the index pulse test, the format, the sector loop
5C0CH-5CF0H229 bytes: the end, the driver calls and the digits
5CF3H-5DF2H, 5DF3H-5EF2H, 5EF3H-5FF2H, 5FF3H-60F2H, 60F3H-61F2H256 bytes each: the six format tables, the texts of the copy, the source read and the sums
61F3H-6246H84 bytes: the end of BREAK and the set-up for the model

Sections of the Disassembly

AddressContents
5200HThe Start: the Banner, the Parameters and the Drives
5234HAsking for the Drives
5282HThe Questions of QUERY
52BDHLoading the Disks and the Source
533AHThe Destination Drives
53C4HThe Copy, Cylinder by Cylinder
5462HThe Second Pass and the End
54DAHThe Next Destination
5507HThe Memory Test and the Format Table
5564HA Decimal Number Not Used
5577HCollecting the Drive Digits
559BHThe Questions and the Answers
55C2HThe Errors of a Step
5618HThe Errors That End QFB
562DHThe Parameter Table and the Values
570CHThe Texts
5A04HThe Index Pulse Test
5A33HFormatting a Cylinder
5B57HIs the Cylinder Copied?
5C18HThe End of QFB
5C7AHThe Calls of the Disk Driver
5CF3HThe Format Table: 5 Inch Single Density
5D34HThe Format Table: 5 Inch Double Density
5D90HThe Format Table: 8 Inch Single Density
5DD5HThe Format Table: 8 Inch Double Density
5E55HThe Format Table: 5 Inch Double Density with FAST
5EACHThe Format Table: 8 Inch Double Density with FAST
5F24HThe Texts of the Copy
60BBHTwo Hex Digits, Not Used
60CFHReading the Source Cylinder
615BHA Drive Code Table and a Decimal Number
61C1HThe Pause and BREAK
6201HThe Set-Up for the Model and the Drive Code Tables

Memory QFB/CMD Uses

AddressContents
0033H, 0040H, 0049HROM: display the character in Register A, take a line at Register Pair HL of up to Register B characters (the CARRY FLAG after BREAK), wait for a key (the same in ROM 3.1 and ROM 1.3).
0060HROM: the delay loop of Register Pair BC (JP 01FBH in ROM 3.1, other bytes in ROM 1.3).
0125HThe ROM byte of the model test: 49H in ROM 3.1.
3801H, 3840H, 3880HThe keyboard matrix: @ (row 0 bit 0), BREAK (row 6 bit 2) and the SHIFT keys (row 7 bits 1-0).
4012HThe RST 38H vector: C9H while QFB copies, put back at the end.
402DH@EXIT, the end of QFB.
428AH@LOGOT: the errors that end QFB (447BH on the Model I).
4411HHIGH$, the end of the memory for the cylinder buffer (4049H on the Model I).
442BHSFLAG$: bit 3, FAST, chooses the double density tables (430FH on the Model I).
4454H@PARAM: QUERY, ALL, V1 and V2 (4476H on the Model I).
4467H@DSPLY: the texts.
4700H-474FHDCT$, the eight drive code tables: +00H the JP to the driver, +03H-+09H the flags, cylinders and sectors; copied to 569CH and put back.
6300H-67FFH up to HIGH$The two copies of the sums, the boot sector and allocation table, the list of the identification bytes and the verify page, the cylinder buffer.

Variables

The entry points of QFB/CMD, then the data of the file, the operands it changes, and the cells outside the file that it uses, by address.

Entry Points

AddressContents
5200HThe start of QFB/CMD, the transfer address of the file.
522EHThe restart R: the banner and the questions for the drives.
52CFHCopy again from the source's boot sector (ENTER at the end, the source error).
54DAHThe next destination: Index Register IY at its drive code table and the NZ FLAG, or the Z FLAG.
5507HThe memory test and the choice of the format table.
5577H, 5578HCollect the drive digits at Register Pair HL into Register Pair DE.
559BH, 55B2HAsk a question with Y or N; display a question and take a line.
55C2H, 55EEH, 55F6HThe errors of the source read and of a destination; drop a destination.
5618H, 561CH, 5620H, 5624HThe four errors that end QFB.
565EH, 5669HThe defaults of the parameters; clear the drives.
5A04HThe index pulse test of the drive at Index Register IY.
5A33HFormat the cylinder at 569AH on the destination at Index Register IY.
5B57HIs the cylinder copied: the NZ FLAG when it is.
5B6FH, 5B81H, 5B90HWrite, read, verify the cylinder.
5BA6H, 5BF3HThe sector loop; one sector by the step at 5695H.
5C18H, 5C1BH, 5C1EH, 5C37HThe ends of QFB.
5C3DHPut the RST 38H vector, the cursor and the drive code tables back.
5C7AHThe calls of the driver: 5C7AH function 00H to 5CB7H function 0AH.
5CCAHCount an error at 5696H.
5CD2H, 5CDFHTwo digits of Register A in Register C and Register B; write them over the cylinder of the text.
60CFHRead the source cylinder and keep its sum.
60F1H, 6105HSet up the buffer and the sum; add a sector to the sum.
611BH, 6130HKeep the sum; compare a sum with the kept ones.
615BHIndex Register IY at the drive code table of drive Register A.
616CHRegister Pair DE in decimal at Register Pair HL.
61C1HThe pause and BREAK.
6201HThe set-up for the model and the copy of the drive code tables.

Data in the File

Address
Size
Contents
562DH-5632H
6 bytes
DEFM "QUERY "
562DH-5632H: the name QUERY, padded to six characters with a space.
5633H-5634H
2 bytes
DEFW 5682H
5633H-5634H: 5682H, the value of QUERY: with it, the questions are asked.
5635H-563AH
6 bytes
DEFM "Q "
5635H-563AH: the name Q, the short form of QUERY, padded to six characters.
563BH-563CH
2 bytes
DEFW 5682H
563BH-563CH: 5682H, the same value as QUERY, for the short form Q.
563DH-5642H
6 bytes
DEFM "ALL "
563DH-5642H: the name ALL, padded to six characters: copy the cylinders that are not in use too.
5643H-5644H
2 bytes
DEFW 567CH
5643H-5644H: 567CH, the value of ALL, two bytes that @PARAM stores.
5645H-564AH
6 bytes
DEFM "A "
5645H-564AH: the name A, the short form of ALL, padded to six characters.
564BH-564CH
2 bytes
DEFW 567CH
564BH-564CH: 567CH, the same value as ALL, for the short form A.
564DH-5652H
6 bytes
DEFM "V1 "
564DH-5652H: the name V1, padded to six characters: verify each cylinder on the same pass.
5653H-5654H
2 bytes
DEFW 567EH
5653H-5654H: 567EH, the value of V1, two bytes that @PARAM stores.
5655H-565AH
6 bytes
DEFM "V2 "
5655H-565AH: the name V2, padded to six characters: verify the disk on a second pass.
565BH-565CH
2 bytes
DEFW 5680H
565BH-565CH: 5680H, the value of V2, two bytes that @PARAM stores.
565DH
1 byte
DEFB 00H
565DH: 00H, the end of the parameter table for @PARAM.
5674H-5675H
2 bytes
DEFB 01H, 00H
5674H-5675H: the default of ALL for the restart R: 01H not given, 00H copy only the cylinders in use.
5676H-5677H
2 bytes
DEFB 01H, FFH
5676H-5677H: the default of V1 for the restart R: 01H not given, FFH verify on the same pass.
5678H-5679H
2 bytes
DEFB 01H, 00H
5678H-5679H: the default of V2 for the restart R: 01H not given, 00H no second pass.
567AH-567BH
2 bytes
DEFB FFH, FFH
567AH-567BH: the default of QUERY for the restart R: FFFFH, the questions are asked.
567CH-567DH
2 bytes
DEFB 01H, 00H
567CH-567DH: the value of ALL: 01H not given, 00H the default; 52B6H complements the high byte 567DH.
567EH-567FH
2 bytes
DEFB 01H, FFH
567EH-567FH: the value of V1: 01H not given, FFH the default, verify after each write.
5680H-5681H
2 bytes
DEFB 01H, 00H
5680H-5681H: the value of V2: 01H not given, 00H the default, no second pass.
5682H-5683H
2 bytes
DEFB 00H x 2
5682H-5683H: the value of QUERY: 0000H unless QUERY or Q is given (or the restart R).
5684H
1 byte
DEFB 00H
5684H: the source drive's digit, 30H-37H, from the command line or the question.
5685H
1 byte
DEFB 00H
5685H: the destination drive's digit, 30H-37H.
5686H
1 byte
DEFB 00H
5686H: 00H, the end of the destination digits; 54E5H and 55FEH index from it.
5687H-5688H
2 bytes
DEFB 00H x 2
5687H-5688H: the copy of the destination digit and its end, made by 533AH; 00H when the destination is dropped.
5689H-568AH
2 bytes
DEFB 00H x 2
5689H-568AH: the address of the source's drive code table, the first entry of the table of drives.
568BH-568CH
2 bytes
DEFB 00H x 2
568BH-568CH: the address of the destination's drive code table, the second entry.
568DH-568EH
2 bytes
DEFB 00H x 2
568DH-568EH: DCT$, 4700H, stored by 6201H: the first drive code table.
568FH-5690H
2 bytes
DEFB 00H x 2
568FH-5690H: HIGH$, stored by 6201H, for the memory test 5525H.
5691H
1 byte
DEFB 00H
5691H: the source's byte +03H, stored by 5304H; no instruction reads it.
5692H-5693H
2 bytes
DEFB 00H x 2
5692H-5693H: the count of the disks made since QFB was started (5491H); it is never cleared.
5694H
1 byte
DEFB 00H
5694H: written by 5498H and 55E8H; no instruction reads it.
5695H
1 byte
DEFB 00H
5695H: the step of the sector loop 5BA6H: 00H write, 01H verify, FFH read.
5696H
1 byte
DEFB 00H
5696H: the count of the errors of the current step, counted by 5CCAH.
5697H
1 byte
DEFB 00H
5697H: the count of the writes of a cylinder after a verify error (5433H).
570CH-571AH
15 bytes
DEFM "Parameter error"
570CH-571AH: the text of 5624H for a bad parameter or a bad drive on the command line.
571BH
1 byte
DEFB 0DH
571BH: 0DH, the end of the text Parameter error.
571CH-571DH
2 bytes
DEFB 1CH, 1FH
571CH-571DH: 1CH, the cursor to the top left, and 1FH, the screen cleared: the start of the banner (5208H, 522EH, 54C5H).
571EH-574FH
50 bytes
DEFM "QFB - LDOS Quick Format and Backup - Version 5.3.1"
571EH-574FH: the name of the program, what it does and its version.
5750H
1 byte
DEFB 0AH
5750H: 0AH, a new line: the copyright goes on the next line.
5751H-5783H
51 bytes
DEFM "Copyright 1991 MISOSYS, Inc., All rights reserved."
5751H-5783H: the copyright line of the banner, with two spaces after the comma.
5784H-5785H
2 bytes
DEFB 0AH, 0DH
5784H-5785H: 0AH, a new line, and 0DH, the end of the banner.
5786H-579BH
22 bytes
DEFB 20H x 22
5786H-579BH: 22 spaces before the text of the memory test; no instruction points at 5786H, 552BH points past them at 579CH.
579CH-57C3H
40 bytes
DEFM "Insufficient memory for specified drive!"
579CH-57C3H: the text of 552EH when HIGH$ is below the end of the cylinder buffer.
57C4H
1 byte
DEFB 0DH
57C4H: 0DH, the end of the text Insufficient memory for specified drive!.
57C5H-57D3H
15 bytes
DEFM "Source drive ? "
57C5H-57D3H: the question of 523DH when the command line gives no source drive.
57D4H
1 byte
DEFB 03H
57D4H: 03H, the end of the question: the answer is typed after it.
57D5H-57E8H
20 bytes
DEFM "Destination drive ? "
57D5H-57E8H: the question of 5269H when the command line gives no destination drive.
57E9H
1 byte
DEFB 03H
57E9H: 03H, the end of the question: the answer is typed after it.
57EAH-57FFH
22 bytes
DEFM "Source Disk not ready!"
57EAH-57FFH: the text of 52EEH: no index pulses, or the boot sector or the allocation table could not be read.
5800H
1 byte
DEFB 0DH
5800H: 0DH, the end of the text Source Disk not ready!.
5801H-5820H
32 bytes
DEFM "Load diskettes and press <ENTER>"
5801H-5820H: the prompt of 52BDH before the copy starts.
5821H-5822H
2 bytes
DEFB 0AH, 0DH
5821H-5822H: 0AH, a new line, and 0DH, the end of the prompt.
5823H-5845H
35 bytes
DEFM "This program requires floppy disks!"
5823H-5845H: the text of 5620H when the source or the destination is a hard disk.
5846H
1 byte
DEFB 0DH
5846H: 0DH, the end of the text This program requires floppy disks!.
5847H-5872H
44 bytes
DEFM "Source and destinations drives are the same!"
5847H-5872H: the text of 5254H when a destination is the source drive.
5873H
1 byte
DEFB 0DH
5873H: 0DH, the end of the text Source and destinations drives are the same!.
5874H-5897H
36 bytes
DEFM "Duplicate unallocated tracks? (Y/N) "
5874H-5897H: the question of ALL (528FH): Y copies every cylinder, N only those in use.
5898H
1 byte
DEFB 03H
5898H: 03H, the end of the question: the answer is typed after it.
5899H-58B3H
27 bytes
DEFM "Verify on same pass? (Y/N) "
5899H-58B3H: the question of V1 (529EH): Y reads each cylinder back after it is written.
58B4H
1 byte
DEFB 03H
58B4H: 03H, the end of the question: the answer is typed after it.
58B5H-58D1H
29 bytes
DEFM "Verify on second pass? (Y/N) "
58B5H-58D1H: the question of V2 (52ADH): Y reads the whole disk back after the copy.
58D2H
1 byte
DEFB 03H
58D2H: 03H, the end of the question: the answer is typed after it.
58D3H-58F3H
33 bytes
DEFM "Incorrect destination drive type!"
58D3H-58F3H: the text of 561CH when the destination is not of the source's size (5 or 8 inch).
58F4H
1 byte
DEFB 0DH
58F4H: 0DH, the end of the text Incorrect destination drive type!.
58F5H-5921H
45 bytes
DEFM "Destination drive has software write-protect!"
58F5H-5921H: the text of 5618H when bit 7 of byte +03H of the destination's drive code table is set.
5922H
1 byte
DEFB 0DH
5922H: 0DH, the end of the text Destination drive has software write-protect!.
5923H-5936H
20 bytes
DEFM "Invalid drive entry!"
5923H-5936H: the text of 527AH when the answer to Destination drive ? has a bad character.
5937H
1 byte
DEFB 0DH
5937H: 0DH, the end of the text Invalid drive entry!.
5938H-5956H
31 bytes
DEFM " =========> Bad disk in drive "
5938H-5956H: the text of 55F8H when a destination is dropped; 560BH adds the drive's digit.
5957H
1 byte
DEFB 03H
5957H: 03H, the end of the text: the digit follows on the same line.
5958H-5959H
2 bytes
DEFB 0AH, 0AH
5958H-5959H: two new lines before the text Duplication complete (54ADH).
595AH-596EH
21 bytes
DEFM "Duplication complete "
595AH-596EH: the start of the text of the count of the disks made.
596FH-5973H
5 bytes
DEFB 20H x 5
596FH-5973H: the five places of the count, written by 616CH with spaces for the leading zeros (54AAH, 5C30H).
5974H-5978H
5 bytes
DEFM " disk"
5974H-5978H: a space and the word disk after the count.
5979H-597AH
2 bytes
DEFB 20H x 2
5979H-597AH: two spaces: 54A3H writes the letter s at 5979H when more than one disk was made; it stays there.
597BH-5981H
7 bytes
DEFM "created"
597BH-5981H: the word created, the end of the text of the count.
5982H
1 byte
DEFB 0DH
5982H: 0DH, the end of the text of the count; @LOGOT shows it from 596FH at 5C34H.
5983H
1 byte
DEFB 0AH
5983H: 0AH, a new line: the start of the text of 54B3H.
5984H-59B7H
52 bytes
DEFM "Replace destination disk and press <ENTER> to repeat"
5984H-59B7H: the first line of 54B3H: ENTER makes another copy (54C1H).
59B8H
1 byte
DEFB 0AH
59B8H: 0AH, a new line after the first line of the question of the end.
59B9H-59DDH
37 bytes
DEFM " ..<R> to restart with new parameters"
59B9H-59DDH: the second line: R asks for the drives and the parameters again (54D0H).
59DEH
1 byte
DEFB 0AH
59DEH: 0AH, a new line after the second line.
59DFH-5A02H
36 bytes
DEFM " ...or....<BREAK> to exit program."
59DFH-5A02H: the third line: BREAK ends QFB (54BCH).
5A03H
1 byte
DEFB 0DH
5A03H: 0DH, the end of the text of 54B3H, the question of the end.
5CF3H
1 byte
DEFB 0AH
5CF3H: 0AH, 10 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5CF4H
1 byte
DEFB 08H
5CF4H: 08H, the step: the next cylinder starts 8 sector numbers further on in the list (5B4BH).
5CF5H-5CFEH
10 bytes
DEFB 00H, 05H, 01H, 06H, 02H, 07H, 03H, 08H, 04H, 09H
5CF5H-5CFEH: the 10 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5CFFH-5D07H
9 bytes
DEFB F6H x 9
5CFFH-5D07H: 9 wrap bytes F6H, minus 10: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5D08H-5D09H
2 bytes
DEFB 0EH, FFH
5D08H-5D09H: 14 bytes FFH, the gap after the index pulse.
5D0AH
1 byte
DEFB F1H
5D0AH: F1H, the start of the part built once for each of the 10 sectors (5A94H).
5D0BH-5D0CH
2 bytes
DEFB 06H, 00H
5D0BH-5D0CH: 6 bytes 00H, the sync field before the identification address mark.
5D0DH-5D0EH
2 bytes
DEFB 01H, FEH
5D0DH-5D0EH: FEH, the identification address mark of the sector.
5D0FH
1 byte
DEFB F3H
5D0FH: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5D10H-5D11H
2 bytes
DEFB 03H, 00H
5D10H-5D11H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5D12H-5D13H
2 bytes
DEFB 01H, 01H
5D12H-5D13H: 01H, the length code of the sector: 256 bytes.
5D14H-5D15H
2 bytes
DEFB 01H, F7H
5D14H-5D15H: F7H: the controller writes the two CRC bytes of the identification.
5D16H-5D17H
2 bytes
DEFB 01H, FFH
5D16H-5D17H: 1 byte FFH, the gap between the identification and the data field.
5D18H-5D19H
2 bytes
DEFB 0BH, FFH
5D18H-5D19H: 11 bytes FFH, the gap between the identification and the data field.
5D1AH-5D1BH
2 bytes
DEFB 06H, 00H
5D1AH-5D1BH: 6 bytes 00H, the sync field before the data address mark.
5D1CH-5D1DH
2 bytes
DEFB 01H, FBH
5D1CH-5D1DH: FBH, the data address mark that starts the data field of the sector.
5D1EH-5D1FH
2 bytes
DEFB 00H, E5H
5D1EH-5D1FH: 256 bytes E5H, the data field of a single density sector.
5D20H-5D21H
2 bytes
DEFB 01H, F7H
5D20H-5D21H: F7H: the controller writes the two CRC bytes of the data field.
5D22H-5D23H
2 bytes
DEFB 01H, FFH
5D22H-5D23H: 1 byte FFH, the gap after the sector.
5D24H-5D25H
2 bytes
DEFB 0DH, FFH
5D24H-5D25H: 13 bytes FFH, the gap after the sector.
5D26H
1 byte
DEFB F2H
5D26H: F2H, the end of the part built for each sector (5A9BH).
5D27H-5D28H
2 bytes
DEFB 47H, FFH
5D27H-5D28H: 71 bytes FFH, the gap to the end of the track.
5D29H
1 byte
DEFB F4H
5D29H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5D2AH-5D33H
10 bytes
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H
5D2AH-5D33H: the order of the 10 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 10 added.
5D34H
1 byte
DEFB 12H
5D34H: 12H, 18 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5D35H
1 byte
DEFB 0FH
5D35H: 0FH, the step: the next cylinder starts 15 sector numbers further on in the list (5B4BH).
5D36H-5D47H
18 bytes
DEFB 00H, 06H, 0CH, 01H, 07H, 0DH, 02H, 08H, 0EH, 03H, 09H, 0FH, 04H, 0AH, 10H, 05H, 0BH, 11H
5D36H-5D47H: the 18 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5D48H-5D57H
16 bytes
DEFB EEH x 16
5D48H-5D57H: 16 wrap bytes EEH, minus 18: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5D58H-5D59H
2 bytes
DEFB 20H, 4EH
5D58H-5D59H: 32 bytes 4EH, the gap after the index pulse.
5D5AH
1 byte
DEFB F1H
5D5AH: F1H, the start of the part built once for each of the 18 sectors (5A94H).
5D5BH-5D5CH
2 bytes
DEFB 0CH, 00H
5D5BH-5D5CH: 12 bytes 00H, the sync field before the identification address mark.
5D5DH-5D5EH
2 bytes
DEFB 03H, F5H
5D5DH-5D5EH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5D5FH-5D60H
2 bytes
DEFB 01H, FEH
5D5FH-5D60H: FEH, the identification address mark of the sector.
5D61H
1 byte
DEFB F3H
5D61H: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5D62H-5D63H
2 bytes
DEFB 03H, 00H
5D62H-5D63H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5D64H-5D65H
2 bytes
DEFB 01H, 01H
5D64H-5D65H: 01H, the length code of the sector: 256 bytes.
5D66H-5D67H
2 bytes
DEFB 01H, F7H
5D66H-5D67H: F7H: the controller writes the two CRC bytes of the identification.
5D68H-5D69H
2 bytes
DEFB 16H, 4EH
5D68H-5D69H: 22 bytes 4EH, the gap between the identification and the data field.
5D6AH-5D6BH
2 bytes
DEFB 0CH, 00H
5D6AH-5D6BH: 12 bytes 00H, the sync field before the data address mark.
5D6CH-5D6DH
2 bytes
DEFB 03H, F5H
5D6CH-5D6DH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5D6EH-5D6FH
2 bytes
DEFB 01H, FBH
5D6EH-5D6FH: FBH, the data address mark that starts the data field of the sector.
5D70H-5D73H
4 bytes
DEFB F5H, 80H, 6DH, B6H
5D70H-5D73H: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5D74H-5D75H
2 bytes
DEFB 01H, F7H
5D74H-5D75H: F7H: the controller writes the two CRC bytes of the data field.
5D76H-5D77H
2 bytes
DEFB 01H, 4EH
5D76H-5D77H: 1 byte 4EH, the gap after the sector.
5D78H-5D79H
2 bytes
DEFB 17H, 4EH
5D78H-5D79H: 23 bytes 4EH, the gap after the sector.
5D7AH
1 byte
DEFB F2H
5D7AH: F2H, the end of the part built for each sector (5A9BH).
5D7BH-5D7CH
2 bytes
DEFB B6H, 4EH
5D7BH-5D7CH: 182 bytes 4EH, the gap to the end of the track.
5D7DH
1 byte
DEFB F4H
5D7DH: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5D7EH-5D8FH
18 bytes
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H
5D7EH-5D8FH: the order of the 18 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 18 added.
5D90H
1 byte
DEFB 10H
5D90H: 10H, 16 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5D91H
1 byte
DEFB 02H
5D91H: 02H, the step: the next cylinder starts 2 sector numbers further on in the list (5B4BH).
5D92H-5DA1H
16 bytes
DEFB 0AH, 05H, 00H, 0BH, 06H, 01H, 0CH, 07H, 02H, 0DH, 08H, 03H, 0EH, 09H, 04H, 0FH
5D92H-5DA1H: the 16 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5DA2H-5DA4H
3 bytes
DEFB F0H x 3
5DA2H-5DA4H: 3 wrap bytes F0H, minus 16: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5DA5H-5DA6H
2 bytes
DEFB 28H, FFH
5DA5H-5DA6H: 40 bytes FFH, the gap after the index pulse.
5DA7H
1 byte
DEFB F1H
5DA7H: F1H, the start of the part built once for each of the 16 sectors (5A94H).
5DA8H-5DA9H
2 bytes
DEFB 06H, 00H
5DA8H-5DA9H: 6 bytes 00H, the sync field before the identification address mark.
5DAAH-5DABH
2 bytes
DEFB 01H, FEH
5DAAH-5DABH: FEH, the identification address mark of the sector.
5DACH
1 byte
DEFB F3H
5DACH: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5DADH-5DAEH
2 bytes
DEFB 03H, 00H
5DADH-5DAEH: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5DAFH-5DB0H
2 bytes
DEFB 01H, 01H
5DAFH-5DB0H: 01H, the length code of the sector: 256 bytes.
5DB1H-5DB2H
2 bytes
DEFB 01H, F7H
5DB1H-5DB2H: F7H: the controller writes the two CRC bytes of the identification.
5DB3H-5DB4H
2 bytes
DEFB 0BH, FFH
5DB3H-5DB4H: 11 bytes FFH, the gap between the identification and the data field.
5DB5H-5DB6H
2 bytes
DEFB 06H, 00H
5DB5H-5DB6H: 6 bytes 00H, the sync field before the data address mark.
5DB7H-5DB8H
2 bytes
DEFB 01H, FBH
5DB7H-5DB8H: FBH, the data address mark that starts the data field of the sector.
5DB9H-5DBAH
2 bytes
DEFB 00H, E5H
5DB9H-5DBAH: 256 bytes E5H, the data field of a single density sector.
5DBBH-5DBCH
2 bytes
DEFB 01H, F7H
5DBBH-5DBCH: F7H: the controller writes the two CRC bytes of the data field.
5DBDH-5DBEH
2 bytes
DEFB 01H, FFH
5DBDH-5DBEH: 1 byte FFH, the gap after the sector.
5DBFH-5DC0H
2 bytes
DEFB 14H, FFH
5DBFH-5DC0H: 20 bytes FFH, the gap after the sector.
5DC1H
1 byte
DEFB F2H
5DC1H: F2H, the end of the part built for each sector (5A9BH).
5DC2H-5DC3H
2 bytes
DEFB D0H, FFH
5DC2H-5DC3H: 208 bytes FFH, the gap to the end of the track.
5DC4H
1 byte
DEFB F4H
5DC4H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5DC5H-5DD4H
16 bytes
DEFB 0AH, 00H, 06H, 0CH, 02H, 08H, 0EH, 04H, 05H, 0BH, 01H, 07H, 0DH, 03H, 09H, 0FH
5DC5H-5DD4H: the order of the 16 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 16 added.
5DD5H
1 byte
DEFB 1EH
5DD5H: 1EH, 30 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5DD6H
1 byte
DEFB 14H
5DD6H: 14H, the step: the next cylinder starts 20 sector numbers further on in the list (5B4BH).
5DD7H-5DF4H
30 bytes
DEFB 00H, 06H, 0CH, 12H, 18H, 01H, 07H, 0DH, 13H, 19H, 02H, 08H, 0EH, 14H, 1AH, 03H, 09H, 0FH, 15H, 1BH, 04H, 0AH, 10H, 16H, 1CH, 05H, 0BH, 11H, 17H, 1DH
5DD7H-5DF4H: the 30 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5DF5H-5E09H
21 bytes
DEFB E2H x 21
5DF5H-5E09H: 21 wrap bytes E2H, minus 30: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5E0AH-5E0BH
2 bytes
DEFB 14H, 4EH
5E0AH-5E0BH: 20 bytes 4EH, the gap after the index pulse.
5E0CH
1 byte
DEFB F1H
5E0CH: F1H, the start of the part built once for each of the 30 sectors (5A94H).
5E0DH-5E0EH
2 bytes
DEFB 0CH, 00H
5E0DH-5E0EH: 12 bytes 00H, the sync field before the identification address mark.
5E0FH-5E10H
2 bytes
DEFB 03H, F5H
5E0FH-5E10H: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E11H-5E12H
2 bytes
DEFB 01H, FEH
5E11H-5E12H: FEH, the identification address mark of the sector.
5E13H
1 byte
DEFB F3H
5E13H: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5E14H-5E15H
2 bytes
DEFB 03H, 00H
5E14H-5E15H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5E16H-5E17H
2 bytes
DEFB 01H, 01H
5E16H-5E17H: 01H, the length code of the sector: 256 bytes.
5E18H-5E19H
2 bytes
DEFB 01H, F7H
5E18H-5E19H: F7H: the controller writes the two CRC bytes of the identification.
5E1AH-5E1BH
2 bytes
DEFB 16H, 4EH
5E1AH-5E1BH: 22 bytes 4EH, the gap between the identification and the data field.
5E1CH-5E1DH
2 bytes
DEFB 0CH, 00H
5E1CH-5E1DH: 12 bytes 00H, the sync field before the data address mark.
5E1EH-5E1FH
2 bytes
DEFB 03H, F5H
5E1EH-5E1FH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E20H-5E21H
2 bytes
DEFB 01H, FBH
5E20H-5E21H: FBH, the data address mark that starts the data field of the sector.
5E22H-5E25H
4 bytes
DEFB F5H, 80H, 6DH, B6H
5E22H-5E25H: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5E26H-5E27H
2 bytes
DEFB 01H, F7H
5E26H-5E27H: F7H: the controller writes the two CRC bytes of the data field.
5E28H-5E29H
2 bytes
DEFB 01H, FFH
5E28H-5E29H: 1 byte FFH, the gap after the sector.
5E2AH-5E2BH
2 bytes
DEFB 11H, 4EH
5E2AH-5E2BH: 17 bytes 4EH, the gap after the sector.
5E2CH
1 byte
DEFB F2H
5E2CH: F2H, the end of the part built for each sector (5A9BH).
5E2DH-5E2EH
2 bytes
DEFB 00H, 4EH
5E2DH-5E2EH: 256 bytes 4EH, the gap to the end of the track.
5E2FH-5E30H
2 bytes
DEFB 3DH, 4EH
5E2FH-5E30H: 61 bytes 4EH, the gap to the end of the track.
5E31H
1 byte
DEFB F4H
5E31H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5E32H-5E4FH
30 bytes
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H, 12H, 13H, 14H, 15H, 16H, 17H, 18H, 19H, 1AH, 1BH, 1CH, 1DH
5E32H-5E4FH: the order of the 30 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 30 added.
5E50H-5E54H
5 bytes
DEFB 00H x 5
5E50H-5E54H: 5 bytes 00H after the order of the sectors; no instruction reads them.
5E55H
1 byte
DEFB 12H
5E55H: 12H, 18 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5E56H
1 byte
DEFB 0AH
5E56H: 0AH, the step: the next cylinder starts 10 sector numbers further on in the list (5B4BH).
5E57H-5E68H
18 bytes
DEFB 00H, 09H, 01H, 0AH, 02H, 0BH, 03H, 0CH, 04H, 0DH, 05H, 0EH, 06H, 0FH, 07H, 10H, 08H, 11H
5E57H-5E68H: the 18 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5E69H-5E73H
11 bytes
DEFB EEH x 11
5E69H-5E73H: 11 wrap bytes EEH, minus 18: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5E74H-5E75H
2 bytes
DEFB 20H, 4EH
5E74H-5E75H: 32 bytes 4EH, the gap after the index pulse.
5E76H
1 byte
DEFB F1H
5E76H: F1H, the start of the part built once for each of the 18 sectors (5A94H).
5E77H-5E78H
2 bytes
DEFB 0CH, 00H
5E77H-5E78H: 12 bytes 00H, the sync field before the identification address mark.
5E79H-5E7AH
2 bytes
DEFB 03H, F5H
5E79H-5E7AH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E7BH-5E7CH
2 bytes
DEFB 01H, FEH
5E7BH-5E7CH: FEH, the identification address mark of the sector.
5E7DH
1 byte
DEFB F3H
5E7DH: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5E7EH-5E7FH
2 bytes
DEFB 03H, 00H
5E7EH-5E7FH: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5E80H-5E81H
2 bytes
DEFB 01H, 01H
5E80H-5E81H: 01H, the length code of the sector: 256 bytes.
5E82H-5E83H
2 bytes
DEFB 01H, F7H
5E82H-5E83H: F7H: the controller writes the two CRC bytes of the identification.
5E84H-5E85H
2 bytes
DEFB 16H, 4EH
5E84H-5E85H: 22 bytes 4EH, the gap between the identification and the data field.
5E86H-5E87H
2 bytes
DEFB 0CH, 00H
5E86H-5E87H: 12 bytes 00H, the sync field before the data address mark.
5E88H-5E89H
2 bytes
DEFB 03H, F5H
5E88H-5E89H: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E8AH-5E8BH
2 bytes
DEFB 01H, FBH
5E8AH-5E8BH: FBH, the data address mark that starts the data field of the sector.
5E8CH-5E8FH
4 bytes
DEFB F5H, 80H, 6DH, B6H
5E8CH-5E8FH: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5E90H-5E91H
2 bytes
DEFB 01H, F7H
5E90H-5E91H: F7H: the controller writes the two CRC bytes of the data field.
5E92H-5E93H
2 bytes
DEFB 01H, 4EH
5E92H-5E93H: 1 byte 4EH, the gap after the sector.
5E94H-5E95H
2 bytes
DEFB 17H, 4EH
5E94H-5E95H: 23 bytes 4EH, the gap after the sector.
5E96H
1 byte
DEFB F2H
5E96H: F2H, the end of the part built for each sector (5A9BH).
5E97H-5E98H
2 bytes
DEFB B6H, 4EH
5E97H-5E98H: 182 bytes 4EH, the gap to the end of the track.
5E99H
1 byte
DEFB F4H
5E99H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5E9AH-5EABH
18 bytes
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H
5E9AH-5EABH: the order of the 18 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 18 added.
5EACH
1 byte
DEFB 1EH
5EACH: 1EH, 30 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5EADH
1 byte
DEFB 0CH
5EADH: 0CH, the step: the next cylinder starts 12 sector numbers further on in the list (5B4BH).
5EAEH-5ECBH
30 bytes
DEFB 00H, 0AH, 14H, 01H, 0BH, 15H, 02H, 0CH, 16H, 03H, 0DH, 17H, 04H, 0EH, 18H, 05H, 0FH, 19H, 06H, 10H, 1AH, 07H, 11H, 1BH, 08H, 12H, 1CH, 09H, 13H, 1DH
5EAEH-5ECBH: the 30 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5ECCH-5ED8H
13 bytes
DEFB E2H x 13
5ECCH-5ED8H: 13 wrap bytes E2H, minus 30: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5ED9H-5EDAH
2 bytes
DEFB 14H, 4EH
5ED9H-5EDAH: 20 bytes 4EH, the gap after the index pulse.
5EDBH
1 byte
DEFB F1H
5EDBH: F1H, the start of the part built once for each of the 30 sectors (5A94H).
5EDCH-5EDDH
2 bytes
DEFB 0CH, 00H
5EDCH-5EDDH: 12 bytes 00H, the sync field before the identification address mark.
5EDEH-5EDFH
2 bytes
DEFB 03H, F5H
5EDEH-5EDFH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5EE0H-5EE1H
2 bytes
DEFB 01H, FEH
5EE0H-5EE1H: FEH, the identification address mark of the sector.
5EE2H
1 byte
DEFB F3H
5EE2H: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5EE3H-5EE4H
2 bytes
DEFB 03H, 00H
5EE3H-5EE4H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5EE5H-5EE6H
2 bytes
DEFB 01H, 01H
5EE5H-5EE6H: 01H, the length code of the sector: 256 bytes.
5EE7H-5EE8H
2 bytes
DEFB 01H, F7H
5EE7H-5EE8H: F7H: the controller writes the two CRC bytes of the identification.
5EE9H-5EEAH
2 bytes
DEFB 16H, 4EH
5EE9H-5EEAH: 22 bytes 4EH, the gap between the identification and the data field.
5EEBH-5EECH
2 bytes
DEFB 0CH, 00H
5EEBH-5EECH: 12 bytes 00H, the sync field before the data address mark.
5EEDH-5EEEH
2 bytes
DEFB 03H, F5H
5EEDH-5EEEH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5EEFH-5EF0H
2 bytes
DEFB 01H, FBH
5EEFH-5EF0H: FBH, the data address mark that starts the data field of the sector.
5EF1H-5EF4H
4 bytes
DEFB F5H, 80H, 6DH, B6H
5EF1H-5EF4H: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5EF5H-5EF6H
2 bytes
DEFB 01H, F7H
5EF5H-5EF6H: F7H: the controller writes the two CRC bytes of the data field.
5EF7H-5EF8H
2 bytes
DEFB 01H, FFH
5EF7H-5EF8H: 1 byte FFH, the gap after the sector.
5EF9H-5EFAH
2 bytes
DEFB 11H, 4EH
5EF9H-5EFAH: 17 bytes 4EH, the gap after the sector.
5EFBH
1 byte
DEFB F2H
5EFBH: F2H, the end of the part built for each sector (5A9BH).
5EFCH-5EFDH
2 bytes
DEFB 00H, 4EH
5EFCH-5EFDH: 256 bytes 4EH, the gap to the end of the track.
5EFEH-5EFFH
2 bytes
DEFB 3DH, 4EH
5EFEH-5EFFH: 61 bytes 4EH, the gap to the end of the track.
5F00H
1 byte
DEFB F4H
5F00H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5F01H-5F1EH
30 bytes
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H, 12H, 13H, 14H, 15H, 16H, 17H, 18H, 19H, 1AH, 1BH, 1CH, 1DH
5F01H-5F1EH: the order of the 30 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 30 added.
5F1FH-5F23H
5 bytes
DEFB 00H x 5
5F1FH-5F23H: 5 bytes 00H after the order of the sectors; no instruction reads them.
5F24H
1 byte
DEFB 1DH
5F24H: 1DH, the cursor to the start of the line, before the text of the format step (5ABDH).
5F25H-5F3AH
22 bytes
DEFM "Formatting cylinder "
5F25H-5F3AH: the text of the format step; the cylinder is written over the last two spaces.
5F3BH
1 byte
DEFB 03H
5F3BH: 03H, the end of the text: the cursor stays after it.
5F3CH
1 byte
DEFB 1DH
5F3CH: 1DH, the cursor to the start of the line, before the text of the verify step (5B90H).
5F3DH-5F52H
22 bytes
DEFM "Verifying cylinder "
5F3DH-5F52H: the text of the verify step, padded to the length of the others.
5F53H
1 byte
DEFB 03H
5F53H: 03H, the end of the text: the cursor stays after it.
5F54H
1 byte
DEFB 1DH
5F54H: 1DH, the cursor to the start of the line, before the text of the write step (5B73H).
5F55H-5F6AH
22 bytes
DEFM "Writing cylinder "
5F55H-5F6AH: the text of the write step, padded to the length of the others.
5F6BH
1 byte
DEFB 03H
5F6BH: 03H, the end of the text: the cursor stays after it.
5F6CH
1 byte
DEFB 1DH
5F6CH: 1DH, the cursor to the start of the line, before the text of the read step (5B81H).
5F6DH-5F82H
22 bytes
DEFM "Reading cylinder "
5F6DH-5F82H: the text of the read step of the source, padded to the length of the others.
5F83H
1 byte
DEFB 03H
5F83H: 03H, the end of the text: the cursor stays after it.
5F84H
1 byte
DEFB 1DH
5F84H: 1DH, the cursor to the start of the line, before the text of 53F6H.
5F85H-5F9AH
22 bytes
DEFM "Disk not ready "
5F85H-5F9AH: the text of 53F6H when a destination gives no index pulses; Bad disk in drive follows.
5F9BH
1 byte
DEFB 03H
5F9BH: 03H, the end of the text: the cursor stays after it.
5F9CH
1 byte
DEFB 1DH
5F9CH: 1DH, the cursor to the start of the line, before the text of 61E6H.
5F9DH-5FB2H
22 bytes
DEFM "BREAK pressed "
5F9DH-5FB2H: the text of 61E6H for each destination when BREAK stops the copy.
5FB3H
1 byte
DEFB 03H
5FB3H: 03H, the end of the text: the cursor stays after it.
5FB4H
1 byte
DEFB 0AH
5FB4H: 0AH, a new line before the prompt of 5C66H.
5FB5H-5FDAH
38 bytes
DEFM "Load SYSTEM diskette and press <ENTER>"
5FB5H-5FDAH: the prompt at the end of QFB: only ENTER goes on (5C6FH).
5FDBH
1 byte
DEFB 0DH
5FDBH: 0DH, the end of the prompt Load SYSTEM diskette.
5FDCH
1 byte
DEFB 0AH
5FDCH: 0AH, a new line before the note of 5C73H.
5FDDH-6003H
39 bytes
DEFM "Note: Realtime clock no longer accurate"
5FDDH-6003H: the note at the end of QFB: the clock stopped while the RST 38H vector was a RET.
6004H
1 byte
DEFB 0DH
6004H: 0DH, the end of the note Realtime clock no longer accurate.
6005H
1 byte
DEFB 0AH
6005H: 0AH, a new line before the text of 6155H.
6006H-6013H
14 bytes
DEFM "MEMORY FAULT -"
6006H-6013H: the text of 6155H when the two copies of a sum differ; Program aborted! follows.
6014H
1 byte
DEFB 03H
6014H: 03H, the end of the text: Program aborted! follows on the same line.
6015H
1 byte
DEFB 0AH
6015H: 0AH, a new line before the text at 6016H, which no instruction points at.
6016H-6028H
19 bytes
DEFM "Source READ error -"
6016H-6028H: a text that no instruction of QFB displays.
6029H
1 byte
DEFB 03H
6029H: 03H, the end of the text Source READ error -.
602AH-6045H
28 bytes
DEFM " =======> Source disk error"
602AH-6045H: the text of 55D5H when the source cylinder could not be read twice.
6046H-6047H
2 bytes
DEFB 0AH, 0AH
6046H-6047H: two new lines before the question of the source error.
6048H-607BH
52 bytes
DEFM "Press <ENTER> to restart program or <BREAK> to exit."
6048H-607BH: the question of 55DBH: ENTER copies again from the start, BREAK ends.
607CH
1 byte
DEFB 0DH
607CH: 0DH, the end of the text of 55D5H, the source error.
607DH-608DH
17 bytes
DEFM " Program aborted!"
607DH-608DH: the text of 5C1EH after an error that ends QFB.
608EH
1 byte
DEFB 0DH
608EH: 0DH, the end of the text Program aborted!.
608FH-60B9H
43 bytes
DEFM "Cannot duplicate disk with protected files."
608FH-60B9H: the text of 5C18H when bit 4 of byte CDH of the source's allocation table is set.
60BAH
1 byte
DEFB 0DH
60BAH: 0DH, the end of the text Cannot duplicate disk with protected files..
61B7H-61C0H
10 bytes
DEFW 2710H, 03E8H, 0064H, 000AH, 0001H
61B7H-61C0H: the powers of ten of 616CH: 10000, 1000, 100, 10 and 1.

Operands Changed While It Runs

Address
Size
Contents
521FH
2 bytes
@PARAM: 4476H on the Model I (620BH).
5532H
2 bytes
SFLAG$: 430FH on the Model I (6226H).
5628H
2 bytes
@LOGOT: 447BH on the Model I (6217H).
5A38H
2 bytes
The format table, from 5560H.
5AD1H
2 bytes
The next sector number of the format, from 5A53H, 5AFEH and 5B52H.
5B4CH
1 byte
The step of the sector numbers, from 5A4CH.
5BCBH
2 bytes
The order of the sectors, from 5AADH.
5BCFH
1 byte
The sectors of side 0, added for side 1 (5BC4H, 5BE9H).
5BD8H
1 byte
The count of the sectors done (5BC1H, 5BDAH).
5C1CH
2 bytes
@LOGOT: 447BH on the Model I (621AH).
5C22H
2 bytes
@LOGOT: 447BH on the Model I (621DH).
5C35H
2 bytes
@LOGOT: 447BH on the Model I (6220H).
5C3EH
1 byte
The byte of the RST 38H vector at the start (6238H).
5CBEH
1 byte
The drive number for the driver (54F6H, 60E1H).
6230H
2 bytes
HIGH$: 4049H on the Model I (6211H).
596FH-5973H, 5979HThe count of the disks and the letter s (54A3H, 616CH).

Cells Outside the File That QFB/CMD Uses

Address
Size
Contents
5698H-5699H
2 bytes
DEFS 2
5698H-5699H: not in the file. The Stack Pointer at the start (5200H), loaded again by 52CFH and 5336H.
569AH
1 byte
DEFS 1
569AH: not in the file. The cylinder being copied (53C8H, 545CH).
569BH
1 byte
DEFS 1
569BH: not in the file. The index of the current drive in the table of drives: 0 the source, 1 the destination.
569CH-56EBH
80 bytes
DEFS 80
569CH-56EBH: not in the file. The copy of the eight drive code tables of DCT$ (6241H), put back by 5C3DH at the end.
56ECH-570BH
32 bytes
DEFS 32
56ECH-570BH: not in the file. The buffer of the answers for the ROM's line input (55B6H): ten characters and ENTER at most.
5CF1H
1 byte
DEFS 1
5CF1H: not in the file. The sectors of a cylinder (both sides), from 5517H and 5A47H; the loop 5BA6H ends after them.
5CF2H
1 byte
DEFS 1
5CF2H: not in the file. The sectors of a track, from 550DH and 5A3CH: the repeat F1H and the change of side.
6247H-62FFH
185 bytes
DEFS 185
6247H-62FFH: not in the file and not used by QFB.
6300H-63FFH
256 bytes
DEFS 256
6300H-63FFH: not in the file. The first copy of the sums of the cylinders: two bytes for each, at 6300H plus two times the cylinder (611BH).
6400H-64FFH
256 bytes
DEFS 256
6400H-64FFH: not in the file. The second copy of the sums, which 6130H compares with the first.
6500H-65FFH
256 bytes
DEFS 256
6500H-65FFH: not in the file. The source's boot sector, then its allocation table: 65xxH the granules in use, 6560H up the lock out table, 65CCH-65CDH the cylinders and flags.
6600H-66FFH
256 bytes
DEFS 256
6600H-66FFH: not in the file. The list of the places of the identification bytes during a format, the page each sector of a verify is read into.
6700H-67FFH
256 bytes
DEFS 256
6700H-67FFH: not in the file. The first page of the cylinder buffer, which goes on up to HIGH$: the image of a track for the format, the sectors of the cylinder for the read and the write.

Disassembly

5200H - The Start: the Banner, the Parameters and the Drives

LDOS Ready loads QFB/CMD at 5200H-6246H and jumps to 5200H, the transfer address, with Register Pair HL at the rest of the command line. The command is QFB :s :d (parameters) (M-40-060, version 5): the source and destination drives, and QUERY (Q), ALL (A), V1 and V2. 6201H fits the file to the Model I or the Model III and saves the drive code tables; the parameters in parentheses go to @PARAM, and the drive digits before them are collected at 5684H (the source) and 5685H (the destination). A drive that is not given is asked for.

5200
LD (5698H),SP ED 73 98 56
Store the Stack Pointer at 5698H, outside the file: the later starts (52CFH, 5336H) load it back from there to drop whatever is on the stack.
5204
PUSH HL E5
Save Register Pair HL (the command line after QFB) to the stack across the set-up and the banner.
5205
GOSUB to 6201H to put the Model I addresses into the operands when the ROM is not the Model III's, and to keep DCT$, HIGH$ and the drive code tables.
5208
LD HL,571CH 21 1C 57
Point Register Pair HL to 571CH, the banner: 1CH and 1FH clear the screen, then the name, the version and the copyright, ended by 0DH.
520B
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (571CH) on the video.
520E
POP HL E1
Restore Register Pair HL from the stack: the command line after QFB.
520F
DEC HL 2B
DECrement Register Pair HL by one, for the INC HL that starts the search loop at 5211H.
5210
PUSH HL E5
Save Register Pair HL (the command line less one) to the stack: the drive digits are taken from there at 5224H.
5211
INC HL 23
INCrement Register Pair HL to the next character of the command line. 5219H loops back here.
5212
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A.
5213
CP 0EH FE 0E
Compare Register A against 0EH: the CARRY FLAG is set for a control character such as 0DH, the end of the line.
5215
If the CARRY FLAG is set (the end of the line, no parameters), JUMP to 5224H to take the drives.
5217
CP 28H FE 28
Compare Register A against 28H, the left parenthesis that starts the parameters.
5219
If the NZ FLAG is set (not the parenthesis), JUMP back to 5211H to look at the next character.
521B
LD DE,562DH 11 2D 56
Point Register Pair DE to 562DH, the parameter table: QUERY, Q, ALL, A, V1 and V2.
521E
GOSUB to 4454H, @PARAM, to store the parameters at Register Pair HL by the table at Register Pair DE; 6201H puts 4476H here on the Model I.
5221
If the NZ FLAG is set (a parameter error), JUMP to 5624H to display Parameter error and end through 5C37H.
5224
POP HL E1
Restore Register Pair HL from the stack: the command line less one, for the drive digits.
5225
LD DE,5684H 11 84 56
Point Register Pair DE to 5684H, the place of the source drive's digit; the destination's goes to 5685H.
5228
GOSUB to 5578H to collect up to two drive digits from Register Pair HL at Register Pair DE (5684H): the NZ FLAG for a bad character.
522B
If the NZ FLAG is set (a character that is not a drive), JUMP to 5624H to display Parameter error and end through 5C37H.
522E
LD HL,571CH 21 1C 57
Point Register Pair HL to 571CH, the banner text: the screen is cleared again. The restart R comes here (54D7H).
5231
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (571CH) on the video.

5234H - Asking for the Drives

A drive missing from the command line is asked for: Source drive ? takes one character, Destination drive ? up to ten. The source must differ from every destination; a bad entry clears the digit and asks again. BREAK at a question ends QFB through 5C37H. The questions of QUERY follow.

5234
LD DE,5684H 11 84 56
Point Register Pair DE to 5684H, the source drive's digit. 5249H, 525DH, 5276H and 5280H come back here.
5237
LD A,(DE) 1A
Fetch the source drive's digit from 5684H at Register Pair DE into Register A.
5238
OR A B7
OR Register A with itself to set the Z FLAG when the digit is 00H, no source drive yet.
5239
If the NZ FLAG is set (a source drive is given), JUMP to 524BH to look at the destination.
523B
LD B,01H 06 01
Load Register B with 01H: the answer to Source drive ? is one character.
523D
LD HL,57C5H 21 C5 57
Point Register Pair HL to 57C5H, the text Source drive ? ended by 03H.
5240
GOSUB to 55B2H to display the question at Register Pair HL and take the answer of up to Register B characters at 56ECH.
5243
If the CARRY FLAG is set (BREAK was pressed), JUMP to 5C37H to put the system back and end QFB.
5246
GOSUB to 5577H to take a drive digit from the answer at Register Pair HL into 5684H at Register Pair DE.
5249
JUMP back to 5234H, which asks again when no digit was taken.
524B
INC DE 13
INCrement Register Pair DE to 5685H, the destination drive's digit.
524C
LD B,A 47
Copy Register A (the source drive's digit) into Register B for the comparisons.
524D
LD A,(DE) 1A
Fetch the destination drive's digit from 5685H at Register Pair DE into Register A.
524E
OR A B7
OR Register A with itself to set the Z FLAG when the digit is 00H, no destination yet.
524F
If the Z FLAG is set (no destination drive), JUMP to 5266H to ask for it.
5251
CP B B8
Compare Register A (a destination digit) against Register B (the source digit). 5262H loops back here.
5252
If the NZ FLAG is set (the drives differ), JUMP to 525FH for the next destination digit.
5254
LD HL,5847H 21 47 58
Point Register Pair HL to 5847H, the text Source and destinations drives are the same!, ended by 0DH.
5257
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5847H) on the video.
525A
GOSUB to 5669H to clear the drive digits and drive tables at 5684H-568CH: both drives are asked for again.
525D
JUMP back to 5234H to ask for the source drive.
525F
INC DE 13
INCrement Register Pair DE to the next destination digit (5686H, which 5578H keeps at 00H).
5260
LD A,(DE) 1A
Fetch the next destination digit at Register Pair DE into Register A.
5261
OR A B7
OR Register A with itself to set the Z FLAG at the 00H that ends the digits.
5262
If the NZ FLAG is set (another destination digit), JUMP back to 5251H to compare it with the source.
5264
JUMP to 5282H: the drives are known, the questions of QUERY follow.
5266
PUSH DE D5
Save Register Pair DE (5685H, the place of the destination digit) to the stack across the question.
5267
LD B,0AH 06 0A
Load Register B with 0AH: the answer to Destination drive ? may have up to ten characters.
5269
LD HL,57D5H 21 D5 57
Point Register Pair HL to 57D5H, the text Destination drive ? ended by 03H.
526C
GOSUB to 55B2H to display the question at Register Pair HL and take the answer of up to Register B characters at 56ECH.
526F
If the CARRY FLAG is set (BREAK was pressed), JUMP to 5C37H to put the system back and end QFB.
5272
GOSUB to 5577H to take the drive digits of the answer at Register Pair HL into 5685H at Register Pair DE: the Z FLAG when they are good.
5275
POP DE D1
Restore Register Pair DE from the stack: 5685H, the place of the destination digit.
5276
If the Z FLAG is set (a good answer), JUMP back to 5234H to compare the drives.
5278
XOR A AF
Clear Register A (XOR A) to 00H, to drop the digit of the bad answer.
5279
LD (DE),A 12
Store Register A (00H) at Register Pair DE (5685H): the destination is asked for again.
527A
LD HL,5923H 21 23 59
Point Register Pair HL to 5923H, the text Invalid drive entry!, ended by 0DH.
527D
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5923H) on the video.
5280
JUMP back to 5234H to ask for the destination drive again.

5282H - The Questions of QUERY

With QUERY (or Q) the three questions are asked for each of ALL, V1 and V2 whose low byte is still 01H, the mark of a parameter not given on the command line; the answer (00H for N, FFH for Y) goes into its high byte. @PARAM stores FFFFH or 0000H for a parameter that is given, so that it is not asked. Then the ALL byte 567DH is complemented: from here on FFH means copy only the cylinders in use.

5282
LD HL,(5682H) 2A 82 56
Fetch the QUERY value from 5682H into Register Pair HL: 0000H unless QUERY or Q was given (the restart R puts FFFFH there).
5285
LD A,L 7D
Copy Register L (the low byte of the QUERY value) into Register A.
5286
OR H B4
OR Register H into Register A: the Z FLAG is set when the QUERY value in Register Pair HL is 0000H.
5287
If the Z FLAG is set (no QUERY), JUMP to 52B6H: the defaults and the given parameters stand.
5289
LD A,(567CH) 3A 7C 56
Fetch the low byte of the ALL value from 567CH into Register A: 01H when ALL was not given.
528C
DEC A 3D
DECrement Register A: the Z FLAG is set when the low byte of the ALL value was 01H.
528D
If the NZ FLAG is set (ALL was given), JUMP to 5298H, the next question.
528F
LD HL,5874H 21 74 58
Point Register Pair HL to 5874H, the question Duplicate unallocated tracks? (Y/N), ended by 03H.
5292
GOSUB to 559BH to ask the question at Register Pair HL until Y or N: Register A = FFH for Y, 00H for N.
5295
LD (567DH),A 32 7D 56
Store Register A (the answer) at 567DH, the high byte of the ALL value.
5298
LD A,(567EH) 3A 7E 56
Fetch the low byte of the V1 value from 567EH into Register A: 01H when V1 was not given.
529B
DEC A 3D
DECrement Register A: the Z FLAG is set when the low byte of the V1 value was 01H.
529C
If the NZ FLAG is set (V1 was given), JUMP to 52A7H, the next question.
529E
LD HL,5899H 21 99 58
Point Register Pair HL to 5899H, the question Verify on same pass? (Y/N), ended by 03H.
52A1
GOSUB to 559BH to ask the question at Register Pair HL until Y or N: Register A = FFH for Y, 00H for N.
52A4
LD (567FH),A 32 7F 56
Store Register A (the answer) at 567FH, the high byte of the V1 value.
52A7
LD A,(5680H) 3A 80 56
Fetch the low byte of the V2 value from 5680H into Register A: 01H when V2 was not given.
52AA
DEC A 3D
DECrement Register A: the Z FLAG is set when the low byte of the V2 value was 01H.
52AB
If the NZ FLAG is set (V2 was given), JUMP to 52B6H.
52AD
LD HL,58B5H 21 B5 58
Point Register Pair HL to 58B5H, the question Verify on second pass? (Y/N), ended by 03H.
52B0
GOSUB to 559BH to ask the question at Register Pair HL until Y or N: Register A = FFH for Y, 00H for N.
52B3
LD (5681H),A 32 81 56
Store Register A (the answer) at 5681H, the high byte of the V2 value.
52B6
LD A,(567DH) 3A 7D 56
Fetch the high byte of the ALL value from 567DH into Register A: 00H by default, FFH for ALL or Y.
52B9
CPL 2F
Complement Register A (CPL): FFH now means copy only the cylinders in use, 00H copy every cylinder.
52BA
LD (567DH),A 32 7D 56
Store Register A (the complemented ALL byte) at 567DH, which 5B5EH tests.

52BDH - Loading the Disks and the Source

After the prompt, ENTER starts the copy and BREAK ends QFB. The source drive must be a floppy (no hard disk, bit 3 of byte +03H of its drive code table) and must pass the index pulse test of 5A04H. Its boot sector gives the directory cylinder, and the allocation table there, read with the deleted data mark that a directory sector must have, gives the cylinders and the sides. A disk whose table has bit 4 of byte CDH set is refused. The answer ENTER of 54C1H and a source error (55EBH) come back to 52CFH.

52BD
LD HL,5801H 21 01 58
Point Register Pair HL to 5801H, the text Load diskettes and press <ENTER>, a new line and 0DH. 52F4H comes back here.
52C0
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5801H) on the video.
52C3
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A. 52CDH loops back here.
52C6
CP 01H FE 01
Compare Register A (the key) against 01H, the BREAK key.
52C8
If the Z FLAG is set (BREAK), JUMP to 5C37H to put the system back and end QFB.
52CB
CP 0DH FE 0D
Compare Register A (the key) against 0DH, the ENTER key.
52CD
If the NZ FLAG is set (any other key), JUMP back to 52C3H to wait for the next key.
52CF
LD SP,(5698H) ED 7B 98 56
Load the Stack Pointer from 5698H, the value saved at the start: the stack is empty again. 54CBH and 55EBH come here.
52D3
LD A,(5684H) 3A 84 56
Fetch the source drive's digit from 5684H into Register A.
52D6
SUB 30H D6 30
SUBtract 30H from Register A: the digit becomes the drive number 0-7.
52D8
LD C,A 4F
Copy Register A (the source drive number) into Register C.
52D9
PUSH BC C5
Save Register Pair BC (Register C = the source drive number) to the stack for 5A04H.
52DA
GOSUB to 615BH to point Index Register IY at the drive code table of drive Register A in DCT$.
52DD
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of byte +03H of the drive code table at Index Register IY: set for a hard disk.
52E1
If the NZ FLAG is set (a hard disk), JUMP to 5620H to display This program requires floppy disks! and end.
52E4
LD (5689H),IY FD 22 89 56
Store Index Register IY (the source drive code table) at 5689H, the first entry of the table of drives.
52E8
POP BC C1
Restore Register Pair BC from the stack: Register C = the source drive number.
52E9
GOSUB to 5A04H to test the drive at Index Register IY for index pulses: the Z FLAG when the drive is ready.
52EC
If the Z FLAG is set (the source is ready), JUMP to 52F6H to read its boot sector.
52EE
LD HL,57EAH 21 EA 57
Point Register Pair HL to 57EAH, the text Source Disk not ready!, ended by 0DH. 52FFH and 5317H come here too.
52F1
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (57EAH) on the video.
52F4
JUMP back to 52BDH to wait for the disks again.
52F6
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0, the boot sector.
52F9
LD HL,6500H 21 00 65
Point Register Pair HL to 6500H, outside the file, the buffer of the boot sector and the allocation table.
52FC
GOSUB to 5CB2H to read sector Register E of cylinder Register D into the buffer at Register Pair HL (6500H): the NZ FLAG for an error.
52FF
If the NZ FLAG is set (a read error), JUMP to 52EEH to display Source Disk not ready!.
5301
LD A,(IY+03H) FD 7E 03
Fetch byte +03H of the drive code table at Index Register IY into Register A, the source's flags.
5304
LD (5691H),A 32 91 56
Store Register A (the source's flags) at 5691H; no instruction of QFB reads 5691H.
5307
INC HL 23
INCrement Register Pair HL to 6501H in the boot sector.
5308
INC HL 23
INCrement Register Pair HL to 6502H, the boot sector's byte that holds the directory cylinder.
5309
LD A,(HL) 7E
Fetch the directory cylinder from 6502H at Register Pair HL into Register A.
530A
AND 7FH E6 7F
Mask Register A with 7FH: bit 7 of the boot sector's byte is not part of the cylinder.
530C
DEC HL 2B
DECrement Register Pair HL back to 6501H, on the way back to the buffer.
530D
DEC HL 2B
DECrement Register Pair HL back to 6500H, the buffer for the allocation table.
530E
LD (IY+09H),A FD 77 09
Store Register A (the directory cylinder) at byte +09H of the drive code table at Index Register IY.
5311
LD D,A 57
Copy Register A (the directory cylinder) into Register D; Register E is still 00H, the allocation table's sector.
5312
GOSUB to 5CB2H to read sector Register E of cylinder Register D into Register Pair HL (6500H): Register A = 06H for the deleted data mark.
5315
CP 06H FE 06
Compare Register A (the result of the read) against 06H: a directory sector must have the deleted data mark.
5317
If the NZ FLAG is set (no error or another error), JUMP to 52EEH to display Source Disk not ready!.
5319
LD HL,(65CCH) 2A CC 65
Fetch bytes CCH and CDH of the allocation table from 65CCH into Register Pair HL: Register L = the cylinders above 35, Register H = the disk flags.
531C
BIT 4,H CB 64
Test bit 4 of Register H, byte CDH of the source's allocation table: QFB takes it as the mark of protected files.
531E
If the NZ FLAG is set (bit 4 set), JUMP to 5C18H to display Cannot duplicate disk with protected files. and end.
5321
LD A,22H 3E 22
Load Register A with 22H, 34: the highest cylinder is 34 plus the cylinders above 35.
5323
ADD A,L 85
ADD Register L (the cylinders above 35, byte CCH) to Register A: Register A = the highest cylinder of the source.
5324
LD (IY+06H),A FD 77 06
Store Register A (the highest cylinder) at byte +06H of the drive code table at Index Register IY.
5327
RES 5,(IY+04H) FD CB 04 AE
Reset bit 5 of byte +04H of the drive code table at Index Register IY: one side unless the table says two.
532B
BIT 5,H CB 6C
Test bit 5 of Register H, byte CDH of the allocation table: set for a disk with two sides.
532D
If the Z FLAG is set (one side), JUMP to 5333H.
532F
SET 5,(IY+04H) FD CB 04 EE
Set bit 5 of byte +04H of the drive code table at Index Register IY: the source has two sides.
5333
GOSUB to 5507H to test the memory for the cylinder buffer and choose the format table for the source's density and size.
5336
LD SP,(5698H) ED 7B 98 56
Load the Stack Pointer from 5698H, the value saved at the start: the stack is empty again.

533AH - The Destination Drives

Each destination digit is copied to 5687H and checked by 535FH: the drive must not be write protected or a hard disk, and must be of the same size as the source; its drive code table then takes the source's density, size, sides, cylinders and sectors. The tables of the drives go to 5689H (the source) and 568BH (the destination). The code is written for a list of destinations ended by 00H, but 5578H takes only one.

533A
LD DE,5685H 11 85 56
Point Register Pair DE to 5685H, the destination digits; 5686H, which stays 00H, ends them.
533D
LD BC,5687H 01 87 56
Point Register Pair BC to 5687H, the copy of the destination digits that 54DAH and 55F6H use.
5340
LD HL,568BH 21 8B 56
Point Register Pair HL to 568BH, the place of the first destination's drive code table address.
5343
LD A,(DE) 1A
Fetch the next destination digit at Register Pair DE into Register A. 535DH loops back here.
5344
LD (BC),A 02
Store Register A (the digit) at Register Pair BC in the copy at 5687H; the 00H at the end is copied too.
5345
SUB 30H D6 30
SUBtract 30H from Register A: the digit becomes the drive number; the 00H at the end gives the CARRY FLAG.
5347
If the CARRY FLAG is set (the end of the digits), JUMP to 53C4H to start the copy.
534A
PUSH HL E5
Save Register Pair HL (the place in the table of drives) to the stack across 535FH.
534B
GOSUB to 535FH to check the destination drive Register A against the source and set its drive code table.
534E
POP HL E1
Restore Register Pair HL from the stack: the place in the table of drives.
534F
If the NZ FLAG is set (the drive is not of the source's size), JUMP to 561CH to display Incorrect destination drive type! and end.
5352
PUSH BC C5
Save Register Pair BC (the place in the copy of the digits) to the stack.
5353
PUSH IY FD E5
Save Index Register IY (the destination drive code table) to the stack.
5355
POP BC C1
Restore Register Pair BC from the stack: Register Pair BC = the destination drive code table.
5356
LD (HL),C 71
Store Register C (the low byte of the table address) at Register Pair HL in the table of drives.
5357
INC HL 23
INCrement Register Pair HL to the high byte of the entry.
5358
LD (HL),B 70
Store Register B (the high byte of the table address) at Register Pair HL.
5359
INC HL 23
INCrement Register Pair HL to the next entry of the table of drives.
535A
POP BC C1
Restore Register Pair BC from the stack: the place in the copy of the digits.
535B
INC BC 03
INCrement Register Pair BC to the next place of the copy of the digits.
535C
INC DE 13
INCrement Register Pair DE to the next destination digit.
535D
JUMP back to 5343H for the next destination digit of the list.
535F
PUSH BC C5
Save Register Pair BC (the place in the copy of the digits) to the stack.
5360
GOSUB to 615BH to point Index Register IY at the drive code table of drive Register A in DCT$.
5363
BIT 7,(IY+03H) FD CB 03 7E
Test bit 7 of byte +03H of the drive code table at Index Register IY: set when the drive is software write protected.
5367
If the NZ FLAG is set (write protected), JUMP to 5618H to display Destination drive has software write-protect! and end.
536A
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of byte +03H of the drive code table at Index Register IY: set for a hard disk.
536E
If the NZ FLAG is set (a hard disk), JUMP to 5620H to display This program requires floppy disks! and end.
5371
LD HL,(5689H) 2A 89 56
Fetch the source's drive code table address from 5689H into Register Pair HL.
5374
INC HL 23
INCrement Register Pair HL to byte +01H of the source's table.
5375
INC HL 23
INCrement Register Pair HL to byte +02H of the source's table.
5376
INC HL 23
INCrement Register Pair HL to byte +03H of the source's table, its flags.
5377
LD C,(HL) 4E
Fetch the source's flags (byte +03H) at Register Pair HL into Register C.
5378
LD A,28H 3E 28
Load Register A with 28H, the mask of bit 5 (8 inch) and bit 3 (hard disk).
537A
AND C A1
AND Register C (the source's flags) into Register A: the source's bits 5 and 3.
537B
LD B,A 47
Copy Register A (the source's bits 5 and 3) into Register B.
537C
LD A,(IY+03H) FD 7E 03
Fetch byte +03H of the drive code table at Index Register IY into Register A, the destination's flags.
537F
AND 28H E6 28
Mask Register A with 28H: the destination's bit 5 (8 inch) and bit 3 (hard disk).
5381
XOR B A8
Exclusive OR Register B (the source's bits) into Register A: the NZ FLAG when the two drives differ in these bits.
5382
If the NZ FLAG is set (a drive of another size), JUMP to 53C0H to return with the NZ FLAG.
5384
LD A,78H 3E 78
Load Register A with 78H, the mask of bits 6-3: double density, 8 inch, side and hard disk.
5386
AND C A1
AND Register C (the source's flags) into Register A: the source's bits 6-3.
5387
LD B,A 47
Copy Register A (the source's bits 6-3) into Register B.
5388
LD A,07H 3E 07
Load Register A with 07H, the mask of bits 2-0: the motor delay bit and the step rate.
538A
AND (IY+03H) FD A6 03
AND byte +03H of the drive code table at Index Register IY into Register A: the destination keeps its own bits 2-0.
538D
OR B B0
OR Register B (the source's bits 6-3) into Register A.
538E
LD (IY+03H),A FD 77 03
Store Register A at byte +03H of the drive code table at Index Register IY: the destination takes the source's density and size.
5391
INC HL 23
INCrement Register Pair HL to byte +04H of the source's table.
5392
BIT 6,C CB 71
Test bit 6 of Register C (the source's flags): set for a double density source.
5394
If the Z FLAG is set (single density), JUMP to 539CH to copy the sides.
5396
BIT 6,(IY+04H) FD CB 04 76
Test bit 6 of byte +04H of the drive code table at Index Register IY: set when the drive can do double density.
539A
If the Z FLAG is set (it cannot), JUMP to 53BEH: the return keeps the Z FLAG, the drive is taken without the rest of the copy.
539C
RES 5,(IY+04H) FD CB 04 AE
Reset bit 5 of byte +04H of the drive code table at Index Register IY: one side unless the source has two.
53A0
BIT 5,(HL) CB 6E
Test bit 5 of the byte at Register Pair HL, byte +04H of the source's table: set for two sides.
53A2
If the Z FLAG is set (one side), JUMP to 53A8H.
53A4
SET 5,(IY+04H) FD CB 04 EE
Set bit 5 of byte +04H of the drive code table at Index Register IY: the destination has two sides too.
53A8
INC HL 23
INCrement Register Pair HL to byte +05H of the source's table.
53A9
INC HL 23
INCrement Register Pair HL to byte +06H of the source's table, the highest cylinder.
53AA
PUSH DE D5
Save Register Pair DE (the place in the destination digits) to the stack.
53AB
LD B,06H 06 06
Load Register B with 06H, the count of the steps from the table to its byte +06H.
53AD
PUSH IY FD E5
Save Index Register IY (the destination drive code table) to the stack.
53AF
POP DE D1
Restore Register Pair DE from the stack: Register Pair DE = the destination drive code table.
53B0
INC DE 13
INCrement Register Pair DE, one of the six steps to byte +06H. 53B1H loops back here.
53B1
DECrement Register B and loop back to 53B0H until it reaches 0: Register Pair DE = byte +06H of the destination's table.
53B3
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H: bytes +06H-+09H, the highest cylinder, the sectors, the granules and the directory cylinder.
53B6
LDIR ED B0
Copy the four bytes from Register Pair HL (the source's +06H) to Register Pair DE (the destination's +06H), Register Pair BC counting (LDIR).
53B8
POP DE D1
Restore Register Pair DE from the stack: the place in the destination digits.
53B9
OR FFH F6 FF
OR Register A with FFH: Register A = FFH and the NZ FLAG; the call of function 00H below sets the flags again.
53BB
GOSUB to 5C7AH, function 00H of the driver at Index Register IY: the floppy driver returns Register A = 00H with the Z FLAG.
53BE
POP BC C1
Restore Register Pair BC from the stack: the place in the copy of the digits. 53C2H comes here.
53BF
RET C9
RETurn to 534EH with the Z FLAG (the drive is taken) or the NZ FLAG (the wrong size).
53C0
OR FFH F6 FF
OR Register A with FFH: Register A = FFH and the NZ FLAG, the drive is of another size.
53C2
JUMP to 53BEH to restore Register Pair BC and return with the NZ FLAG.

53C4H - The Copy, Cylinder by Cylinder

For each cylinder from 0 to the highest (byte +06H): every destination is formatted (5A33H; cylinder 0 only after the index pulse test of 5A04H), then the source cylinder is read into memory from 6700H (60CFH), then it is written to each destination (5B6FH) and, with V1, verified at once (5B90H); a verify error writes the cylinder once more. A destination with an error is dropped with the message Bad disk in drive (55F6H). The cylinders that are not in use are not read or written unless ALL was given. 4012H gets C9H, a RET for the RST 38H interrupt: the clock interrupt is off while QFB copies. SHIFT @ pauses, BREAK stops (61C1H).

53C4
XOR A AF
Clear Register A (XOR A) to 00H for the counters of the copy.
53C5
LD (569BH),A 32 9B 56
Store Register A (00H) at 569BH, the index of the drive in the table of drives: 0, the source.
53C8
LD (569AH),A 32 9A 56
Store Register A (00H) at 569AH, the cylinder being copied: cylinder 0 first.
53CB
LD (5696H),A 32 96 56
Store Register A (00H) at 5696H, the count of errors of the current step.
53CE
LD A,C9H 3E C9
Load Register A with C9H, the RET instruction.
53D0
LD (4012H),A 32 12 40
Store Register A (C9H) at 4012H, the RST 38H vector: an interrupt now returns at once and the clock stops (5C3DH puts the byte back).
53D3
LD A,0FH 3E 0F
Load Register A with 0FH, the control code that turns the cursor off.
53D5
GOSUB to 0033H, the ROM's display of the character in Register A (0FH).
53D8
GOSUB to 61C1H to test the keyboard for SHIFT @ (pause) and BREAK (stop). 53FFH, 5407H and 545FH come back here.
53DB
GOSUB to 54DAH to take the next destination: Index Register IY = its drive code table and the NZ FLAG, or the Z FLAG when all are done.
53DE
If the Z FLAG is set (every destination has its cylinder formatted), JUMP to 5409H to read and write the cylinder.
53E0
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
53E3
OR A B7
OR Register A with itself to set the Z FLAG for cylinder 0.
53E4
If the NZ FLAG is set (not cylinder 0), JUMP to 5401H to format the cylinder.
53E6
GOSUB to 5A04H to restore the destination and test it for index pulses: the Z FLAG when it is ready.
53E9
If the NZ FLAG is set (no index pulses), JUMP to 53F6H to drop the destination.
53EB
GOSUB to 5C99H, function 07H, to wait until the controller is not busy.
53EE
LD BC,0A8EH 01 8E 0A
Load Register Pair BC with 0A8EH, the count of the ROM's delay before the first format.
53F1
GOSUB to 0060H, the ROM's delay, which counts Register Pair BC down to 0.
53F4
JUMP to 5401H to format cylinder 0 of the destination.
53F6
LD HL,5F84H 21 84 5F
Point Register Pair HL to 5F84H, the text Disk not ready at the start of the line, ended by 03H.
53F9
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5F84H) on the video.
53FC
GOSUB to 55F6H to display Bad disk in drive with the drive's digit and drop the destination.
53FF
JUMP back to 53D8H for the next destination; this one is dropped.
5401
GOSUB to 5A33H to build the track image of the cylinder at 6700H and write it to the destination at Index Register IY (both sides).
5404
GOSUB to 55EEH: when the format had errors, the destination is dropped with the message Bad disk in drive.
5407
JUMP back to 53D8H for the next destination of this cylinder.
5409
GOSUB to 60CFH to read the source cylinder into memory from 6700H and keep its sum, when a destination is left and the cylinder is copied.
540C
GOSUB to 55C2H: when the read had errors, the cylinder is read once more; a second failure ends the copy with Source disk error.
540F
GOSUB to 54DAH to take the next destination: Index Register IY = its drive code table and the NZ FLAG, or the Z FLAG. 544CH and 5451H come back here.
5412
If the Z FLAG is set (every destination has the cylinder), JUMP to 5453H for the next cylinder.
5414
XOR A AF
Clear Register A (XOR A) to 00H, the count of the writes again after a verify error.
5415
LD (5697H),A 32 97 56
Store Register A (00H) at 5697H, the count of the tries of this cylinder.
5418
GOSUB to 5B6FH to write the cylinder from 6700H to the destination, when the cylinder is copied. 5438H comes back here.
541B
GOSUB to 55EEH: when the write had errors, the destination is dropped (the NZ FLAG); else the Z FLAG.
541E
If the NZ FLAG is set (the destination was dropped), JUMP to 543DH.
5420
LD A,(567FH) 3A 7F 56
Fetch the V1 switch from 567FH into Register A: FFH (the default) for a verify after each write.
5423
OR A B7
OR Register A with itself to set the Z FLAG when V1 is 00H (N).
5424
If the Z FLAG is set (no verify on the same pass), JUMP to 543DH.
5426
GOSUB to 5B90H to read the cylinder back from the destination and compare its sum with the source's.
5429
LD A,(5696H) 3A 96 56
Fetch the count of errors from 5696H into Register A.
542C
OR A B7
OR Register A with itself to set the Z FLAG when the verify had no error.
542D
If the Z FLAG is set (the cylinder is good), JUMP to 543DH.
542F
LD A,(5697H) 3A 97 56
Fetch the count of tries from 5697H into Register A.
5432
INC A 3C
INCrement Register A: one more try of this cylinder.
5433
LD (5697H),A 32 97 56
Store Register A (the tries of this cylinder) at 5697H.
5436
CP 02H FE 02
Compare Register A (the tries) against 02H: the CARRY FLAG while fewer than two were made.
5438
If the CARRY FLAG is set (the first failure), JUMP back to 5418H to write the cylinder again.
543A
GOSUB to 55EEH: the second verify error drops the destination with the message Bad disk in drive.
543D
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
5440
CP (IY+06H) FD BE 06
Compare Register A (the cylinder) against byte +06H of the drive code table at Index Register IY, the highest cylinder.
5443
If the NZ FLAG is set (not the last cylinder), JUMP to 544EH to step the head in.
5445
LD A,(5681H) 3A 81 56
Fetch the V2 switch from 5681H into Register A: 00H (the default) when there is no second pass.
5448
OR A B7
OR Register A with itself to set the Z FLAG when V2 is 00H.
5449
If the Z FLAG is set (no second pass), GOSUB to 5C84H, function 04H, to restore the destination's head to cylinder 0.
544C
JUMP back to 540FH for the next destination of this cylinder.
544E
GOSUB to 5C89H to wait and step the destination's head in by one cylinder (function 05H).
5451
JUMP back to 540FH for the next destination of this cylinder.
5453
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
5456
CP (IY+06H) FD BE 06
Compare Register A (the cylinder) against byte +06H of the drive code table at Index Register IY, the highest cylinder.
5459
If the Z FLAG is set (the last cylinder is done), JUMP to 5462H.
545B
INC A 3C
INCrement Register A, the cylinder, to the next cylinder of the disk.
545C
LD (569AH),A 32 9A 56
Store Register A (the next cylinder) at 569AH.
545F
JUMP back to 53D8H to format the next cylinder.

5462H - The Second Pass and the End

With V2 each destination is read back from its highest cylinder down to cylinder 0, and the sums of the copied cylinders are compared (5B90H). An error of this pass stops the pass for that disk but gives no message and does not drop it. Then the destinations that are left are counted into 5692H, the disks made since QFB started, and the count is shown with Duplication complete. ENTER copies again to new disks with the same drives and parameters, R starts again with the questions, BREAK ends QFB.

5462
LD A,(5681H) 3A 81 56
Fetch the V2 switch from 5681H into Register A.
5465
OR A B7
OR Register A with itself to set the Z FLAG when V2 is 00H.
5466
If the Z FLAG is set (no second pass), JUMP to 5484H to count the disks.
5468
GOSUB to 54DAH to take the next destination: Index Register IY = its drive code table and the NZ FLAG, or the Z FLAG. 5476H and 547CH come back here.
546B
If the Z FLAG is set (every destination is verified), JUMP to 5484H to count the disks.
546D
LD A,(IY+06H) FD 7E 06
Fetch byte +06H of the drive code table at Index Register IY into Register A, the highest cylinder.
5470
LD (569AH),A 32 9A 56
Store Register A (the highest cylinder) at 569AH: the second pass starts there.
5473
GOSUB to 5B90H to verify the cylinder at 569AH on the destination: the NZ FLAG when its sum differs. 5482H loops back here.
5476
If the NZ FLAG is set (a sum differs), JUMP back to 5468H: the pass ends for this disk without a message.
5478
LD A,(569AH) 3A 9A 56
Fetch the cylinder from 569AH into Register A.
547B
OR A B7
OR Register A with itself to set the Z FLAG for cylinder 0, the last of the pass.
547C
If the Z FLAG is set (cylinder 0 is verified), JUMP back to 5468H for the next destination.
547E
DEC A 3D
DECrement Register A, the cylinder, to the cylinder below it.
547F
LD (569AH),A 32 9A 56
Store Register A (the cylinder below) at 569AH.
5482
JUMP back to 5473H to verify the cylinder below on this disk.
5484
LD HL,(5692H) 2A 92 56
Fetch the count of the disks made from 5692H into Register Pair HL.
5487
PUSH HL E5
Save Register Pair HL (the count) to the stack across 54DAH. 548FH loops back here.
5488
GOSUB to 54DAH to take the next destination: the NZ FLAG for each one that is left, the Z FLAG at the end.
548B
POP HL E1
Restore Register Pair HL from the stack: the count of the disks made.
548C
If the Z FLAG is set (no destination left), JUMP to 5491H.
548E
INC HL 23
INCrement Register Pair HL: one more disk made.
548F
JUMP back to 5487H for the next destination still in the copy.
5491
LD (5692H),HL 22 92 56
Store Register Pair HL (the count of the disks made since QFB started) at 5692H.
5494
LD A,H 7C
Copy Register H (the high byte of the count) into Register A.
5495
OR L B5
OR Register L into Register A: the Z FLAG is set when the count in Register Pair HL is 0000H.
5496
If the Z FLAG is set (no disk made yet), JUMP to 54B3H without Duplication complete.
5498
LD (5694H),A 32 94 56
Store Register A (Register H OR Register L) at 5694H; no instruction of QFB reads 5694H.
549B
LD E,A 5F
Copy Register A (Register H OR Register L) into Register E for the test of the plural.
549C
LD A,01H 3E 01
Load Register A with 01H for the comparison with the count.
549E
CP E BB
Compare Register A (01H) against Register E: the NO CARRY FLAG when Register E is not above 01H.
549F
If the NO CARRY FLAG is set (one disk), JUMP to 54A6H.
54A1
LD A,73H 3E 73
Load Register A with 73H, the letter s of the plural disks.
54A3
LD (5979H),A 32 79 59
Store Register A (73H) at 5979H, the place after disk in the text: disks created.
54A6
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the count of the disks.
54A7
LD HL,596FH 21 6F 59
Point Register Pair HL to 596FH, the five places of the count in the text at 5958H.
54AA
GOSUB to 616CH to write Register Pair DE in decimal at Register Pair HL (596FH), with spaces for the leading zeros.
54AD
LD HL,5958H 21 58 59
Point Register Pair HL to 5958H, two new lines and Duplication complete, the count, disk created, ended by 0DH.
54B0
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5958H) on the video.
54B3
LD HL,5983H 21 83 59
Point Register Pair HL to 5983H, the three lines Replace destination disk, R to restart and BREAK to exit, ended by 0DH.
54B6
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5983H) on the video.
54B9
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A. 54D2H loops back here.
54BC
CP 01H FE 01
Compare Register A (the key) against 01H, the BREAK key.
54BE
If the Z FLAG is set (BREAK), JUMP to 5C37H to put the system back and end QFB.
54C1
CP 0DH FE 0D
Compare Register A (the key) against 0DH, the ENTER key.
54C3
If the NZ FLAG is set (not ENTER), JUMP to 54CEH to test for R.
54C5
LD HL,571CH 21 1C 57
Point Register Pair HL to 571CH, the banner text: the screen is cleared.
54C8
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (571CH) on the video.
54CB
JUMP to 52CFH to copy the source again, with the same drives and parameters, without the prompt to load the disks.
54CE
AND 5FH E6 5F
Mask Register A with 5FH: a small letter becomes a capital.
54D0
CP 52H FE 52
Compare Register A against 52H, the letter R.
54D2
If the NZ FLAG is set (any other key), JUMP back to 54B9H to wait for the next key.
54D4
GOSUB to 565EH to put the defaults of the parameters back (QUERY on) and clear the drives.
54D7
JUMP to 522EH to clear the screen and ask for the drives and the parameters.

54DAH - The Next Destination

569BH is the index of the current drive in the table at 5689H: 0 the source, 1 the destination. 54DAH steps to the next index whose digit in the copy at 5687H is not 00H (a dropped destination has 00H), puts the drive number into the driver call (5CBEH) and points Index Register IY at the drive's table, with the NZ FLAG. At index 2 it puts 0 back and returns with the Z FLAG.

54DA
LD B,00H 06 00
Load Register B with 00H, the high byte for the index in Register Pair BC.
54DC
LD A,(569BH) 3A 9B 56
Fetch the index of the current drive from 569BH into Register A.
54DF
INC A 3C
INCrement Register A to the next index. 54ECH loops back here.
54E0
LD C,A 4F
Copy Register A (the next index) into Register C: Register Pair BC = the index.
54E1
SUB 02H D6 02
SUBtract 02H from Register A: the Z FLAG is set at index 2, past the one destination.
54E3
If the Z FLAG is set (past the last destination), JUMP to 54EEH to store index 0 and return with the Z FLAG.
54E5
LD HL,5686H 21 86 56
Point Register Pair HL to 5686H, the place before the copy of the digits.
54E8
ADD HL,BC 09
ADD Register Pair BC (the index) to Register Pair HL: Register Pair HL = the digit of that destination.
54E9
LD A,(HL) 7E
Fetch the destination's digit at Register Pair HL into Register A.
54EA
OR A B7
OR Register A with itself to set the Z FLAG when the digit is 00H (the destination was dropped).
54EB
LD A,C 79
Copy Register C (the index) into Register A; LD leaves the flags.
54EC
If the Z FLAG is set (a dropped destination), JUMP back to 54DFH for the next index.
54EE
LD (569BH),A 32 9B 56
Store Register A (the index, 00H at the end) at 569BH.
54F1
RET Z C8
If the Z FLAG is set (no destination left), RETurn with the Z FLAG.
54F2
PUSH AF F5
Save Register Pair AF (Register A = the index) to the stack.
54F3
LD A,(HL) 7E
Fetch the destination's digit at Register Pair HL into Register A.
54F4
OR 07H F6 07
OR 07H into Register A: the digit 30H-37H gives 37H. The floppy driver selects by byte +04H and does not use the value.
54F6
LD (5CBEH),A 32 BE 5C
Store Register A at 5CBEH, the operand of LD C,00H at 5CBDH: the drive number given to the driver.
54F9
LD HL,5689H 21 89 56
Point Register Pair HL to 5689H, the table of the drives' drive code table addresses.
54FC
POP AF F1
Restore Register Pair AF from the stack: Register A = the index.
54FD
ADD A,A 87
Double Register A (ADD A,A): two bytes an entry.
54FE
LD C,A 4F
Copy Register A (the offset of the entry) into Register C; Register B is still 00H.
54FF
ADD HL,BC 09
ADD Register Pair BC (the offset) to Register Pair HL: Register Pair HL = the entry of the drive.
5500
LD C,(HL) 4E
Fetch the low byte of the drive code table address at Register Pair HL into Register C.
5501
INC HL 23
INCrement Register Pair HL to the high byte of the entry.
5502
LD B,(HL) 46
Fetch the high byte of the drive code table address at Register Pair HL into Register B.
5503
PUSH BC C5
Save Register Pair BC (the drive code table address) to the stack.
5504
POP IY FD E1
Restore Index Register IY from the stack: Index Register IY = the drive code table of the destination.
5506
RET C9
RETurn with the NZ FLAG (from the test of the digit): Index Register IY is the destination's table.

5507H - The Memory Test and the Format Table

The cylinder buffer runs from 6700H, one page of 256 bytes for each sector of the cylinder, and HIGH$ must not be below its end plus two pages. The sectors are taken from byte +07H of the source's drive code table with the mask 0FH, which drops bit 4: a track of 18 sectors (11H) counts as two, one of 30 (1DH) as 14. The format table is chosen by bit 5 (8 inch) and bit 6 (double density) of byte +03H, and for double density by bit 3 of SFLAG$ (FAST), which gives the tables with the closer interleave.

5507
LD A,(IY+07H) FD 7E 07
Fetch byte +07H of the drive code table at Index Register IY into Register A: bits 4-0 the highest sector of a track.
550A
AND 0FH E6 0F
Mask Register A with 0FH: bits 3-0 only, so that bit 4 of the highest sector is lost.
550C
INC A 3C
INCrement Register A: the count of sectors of a track as QFB takes it.
550D
LD (5CF2H),A 32 F2 5C
Store Register A (the sectors of a track) at 5CF2H, outside the file; 5A3CH stores the format table's count there later.
5510
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of byte +04H of the drive code table at Index Register IY: set for two sides.
5514
If the Z FLAG is set (one side), JUMP to 5517H with the count of one track.
5516
ADD A,A 87
Double Register A (ADD A,A): the sectors of the cylinder, both sides.
5517
LD (5CF1H),A 32 F1 5C
Store Register A (the sectors of the cylinder) at 5CF1H, outside the file.
551A
LD D,A 57
Copy Register A (the sectors of the cylinder) into Register D, the pages of the buffer.
551B
INC D 14
INCrement Register D: one page more than the sectors of the cylinder.
551C
INC D 14
INCrement Register D: two pages more than the sectors of the cylinder.
551D
LD E,00H 1E 00
Load Register E with 00H: Register Pair DE = the pages in bytes.
551F
LD HL,6700H 21 00 67
Point Register Pair HL to 6700H, the start of the cylinder buffer.
5522
ADD HL,DE 19
ADD Register Pair DE (the pages) to Register Pair HL: Register Pair HL = the end the buffer needs.
5523
LD D,H 54
Copy Register H into Register D: Register Pair DE takes the end of the buffer.
5524
LD E,L 5D
Copy Register L into Register E: Register Pair DE = the end of the buffer.
5525
LD HL,(568FH) 2A 8F 56
Fetch HIGH$, saved at 568FH by 6201H, into Register Pair HL.
5528
XOR A AF
Clear Register A (XOR A) to 00H and the CARRY FLAG for the subtraction.
5529
SBC HL,DE ED 52
SUBtract Register Pair DE (the end of the buffer) from Register Pair HL (HIGH$): the CARRY FLAG when HIGH$ is below it.
552B
LD HL,579CH 21 9C 57
Point Register Pair HL to 579CH, the text Insufficient memory for specified drive!, ended by 0DH.
552E
If the CARRY FLAG is set (not enough memory), JUMP to 5C1BH to display the text at Register Pair HL and end with Program aborted!.
5531
LD A,(442BH) 3A 2B 44
Fetch SFLAG$ from 442BH into Register A: bit 3 is set by SYSTEM (FAST); 6201H puts 430FH here on the Model I.
5534
LD C,A 4F
Copy Register A (SFLAG$) into Register C for the tests of bit 3.
5535
LD A,(IY+03H) FD 7E 03
Fetch byte +03H of the drive code table at Index Register IY into Register A, the source's flags.
5538
LD HL,5CF3H 21 F3 5C
Point Register Pair HL to 5CF3H, the format table of the 5 inch single density track.
553B
BIT 5,A CB 6F
Test bit 5 of Register A (the source's flags): set for an 8 inch drive.
553D
If the Z FLAG is set (5 inch), JUMP to 5552H for the 5 inch tables.
553F
LD HL,5D90H 21 90 5D
Point Register Pair HL to 5D90H, the format table of the 8 inch single density track.
5542
BIT 6,A CB 77
Test bit 6 of Register A (the source's flags): set for double density.
5544
If the Z FLAG is set (8 inch single density), JUMP to 5560H with that table.
5546
LD HL,5DD5H 21 D5 5D
Point Register Pair HL to 5DD5H, the format table of the 8 inch double density track.
5549
BIT 3,C CB 59
Test bit 3 of Register C (SFLAG$): set when SYSTEM (FAST) is on.
554B
If the Z FLAG is set (not FAST), JUMP to 5560H with that table.
554D
LD HL,5EACH 21 AC 5E
Point Register Pair HL to 5EACH, the 8 inch double density table with the closer interleave for FAST.
5550
JUMP to 5560H with that table, the 8 inch double density one for FAST.
5552
BIT 6,A CB 77
Test bit 6 of Register A (the source's flags): set for double density.
5554
If the Z FLAG is set (5 inch single density), JUMP to 5560H with the table 5CF3H.
5556
LD HL,5D34H 21 34 5D
Point Register Pair HL to 5D34H, the format table of the 5 inch double density track.
5559
BIT 3,C CB 59
Test bit 3 of Register C (SFLAG$): set when SYSTEM (FAST) is on.
555B
If the Z FLAG is set (not FAST), JUMP to 5560H with that table.
555D
LD HL,5E55H 21 55 5E
Point Register Pair HL to 5E55H, the 5 inch double density table with the closer interleave for FAST.
5560
LD (5A38H),HL 22 38 5A
Store Register Pair HL (the format table) at 5A38H, the operand of LD DE at 5A37H in the format routine.
5563
RET C9
RETurn to 5336H with the format table chosen and the memory tested.

5564H - A Decimal Number Not Used

5564H takes the decimal digits at Register Pair HL into Register E (the value times ten plus the digit, until a character that is not a digit). No instruction of QFB calls it.

5564
LD E,00H 1E 00
Load Register E with 00H, the value so far, before the first digit.
5566
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A. 5575H loops back here.
5567
INC HL 23
INCrement Register Pair HL to the next character.
5568
SUB 30H D6 30
SUBtract 30H from Register A: a digit becomes its value 0-9.
556A
LD B,A 47
Copy Register A (the value of the character) into Register B.
556B
CP 0AH FE 0A
Compare Register A against 0AH: the NO CARRY FLAG when the character is not a digit.
556D
LD A,E 7B
Copy Register E (the value so far) into Register A; LD leaves the flags.
556E
RET NC D0
If the NO CARRY FLAG is set (not a digit), RETurn with the value in Register A and Register E.
556F
ADD A,A 87
Double Register A (ADD A,A): two times the value.
5570
ADD A,A 87
Double Register A again (ADD A,A): four times the value.
5571
ADD A,E 83
ADD Register E to Register A: five times the value.
5572
ADD A,A 87
Double Register A (ADD A,A): ten times the value.
5573
ADD A,B 80
ADD Register B (the digit) to Register A: the new value of the number.
5574
LD E,A 5F
Copy Register A (the new value) into Register E.
5575
JUMP back to 5566H for the next character of the number.

5577H - Collecting the Drive Digits

5577H starts at Register Pair HL, 5578H at the character after it. Colons, spaces and other characters below the digit 0 are passed over; the digits 0-7 are stored at Register Pair DE until 5686H. The left parenthesis or ENTER ends the search with the Z FLAG; a character from 8 up gives the NZ FLAG, the error; when 5686H is reached the rest is not looked at.

5577
DEC HL 2B
DECrement Register Pair HL by one, so that the INC HL below starts at the first character of the answer.
5578
INC HL 23
INCrement Register Pair HL to the next character. 5582H, 5586H and 5597H loop back here.
5579
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A.
557A
CP 28H FE 28
Compare Register A against 28H, the left parenthesis of the parameters.
557C
RET Z C8
If the Z FLAG is set (the parameters start), RETurn with the Z FLAG.
557D
CP 0DH FE 0D
Compare Register A against 0DH, ENTER, the end of the line.
557F
RET Z C8
If the Z FLAG is set (the end of the line), RETurn with the Z FLAG.
5580
CP 3AH FE 3A
Compare Register A against 3AH, the colon before a drive number.
5582
If the Z FLAG is set (a colon), JUMP back to 5578H to pass over it.
5584
CP 30H FE 30
Compare Register A against 30H, the digit 0, the lowest drive number.
5586
If the CARRY FLAG is set (a space or another character below 0), JUMP back to 5578H to pass over it.
5588
CP 38H FE 38
Compare Register A against 38H, the digit 8, one above the highest drive.
558A
If the NO CARRY FLAG is set (8 or above: not a drive), JUMP to 5599H to return with the NZ FLAG.
558D
LD (DE),A 12
Store Register A (the digit 0-7) at Register Pair DE.
558E
INC DE 13
INCrement Register Pair DE to the next place.
558F
PUSH HL E5
Save Register Pair HL (the place in the line) to the stack.
5590
XOR A AF
Clear Register A (XOR A) to 00H and the CARRY FLAG for the subtraction.
5591
LD HL,5686H 21 86 56
Point Register Pair HL to 5686H, the end of the places of the digits.
5594
SBC HL,DE ED 52
SUBtract Register Pair DE from Register Pair HL (5686H): the Z FLAG when Register Pair DE has reached 5686H.
5596
POP HL E1
Restore Register Pair HL from the stack: the place in the line.
5597
If the NZ FLAG is set (a place is left), JUMP back to 5578H for the next character.
5599
OR A B7
OR Register A with itself: the Z FLAG for Register A = 00H (5686H reached), the NZ FLAG for a character from 8 up.
559A
RET C9
RETurn with the Z FLAG (good) or the NZ FLAG (a bad character).

559BH - The Questions and the Answers

559BH asks a question with Y or N for an answer: FFH for Y, 00H for N, any other answer asks again. 55B2H displays the question at Register Pair HL and takes a line of up to Register B characters at 56ECH by the ROM's line input; it returns with the CARRY FLAG for BREAK, or with the first character as a capital in Register A.

559B
LD B,01H 06 01
Load Register B with 01H: the answer is one character. 55ADH loops back here.
559D
PUSH HL E5
Save Register Pair HL (the question) to the stack across the input.
559E
GOSUB to 55B2H to display the question at Register Pair HL and take the answer: Register A = its first character as a capital.
55A1
POP HL E1
Restore Register Pair HL from the stack: the question.
55A2
If the CARRY FLAG is set (BREAK was pressed), JUMP to 5C37H to put the system back and end QFB.
55A5
CP 4EH FE 4E
Compare Register A (the answer) against 4EH, the letter N.
55A7
If the NZ FLAG is set (not N), JUMP to 55ABH to test for Y.
55A9
XOR A AF
Clear Register A (XOR A) to 00H, the answer N.
55AA
RET C9
RETurn to the caller with Register A = 00H, the answer N.
55AB
CP 59H FE 59
Compare Register A (the answer) against 59H, the letter Y.
55AD
If the NZ FLAG is set (neither Y nor N), JUMP back to 559BH to ask again.
55AF
LD A,FFH 3E FF
Load Register A with FFH, the value of the answer Y for the caller.
55B1
RET C9
RETurn to the caller with Register A = FFH, the answer Y.
55B2
PUSH DE D5
Save Register Pair DE (the caller's place of the drive digits) to the stack.
55B3
GOSUB to 4467H, @DSPLY, to display the question at Register Pair HL on the video; it ends with 03H, the cursor stays after it.
55B6
LD HL,56ECH 21 EC 56
Point Register Pair HL to 56ECH, outside the file, the buffer of the answer.
55B9
GOSUB to 0040H, the ROM's line input of up to Register B characters into the buffer at Register Pair HL: the CARRY FLAG for BREAK.
55BC
POP DE D1
Restore Register Pair DE from the stack: the caller's place of the drive digits.
55BD
RET C D8
If the CARRY FLAG is set (BREAK), RETurn with the CARRY FLAG.
55BE
LD A,(HL) 7E
Fetch the first character of the answer at Register Pair HL (56ECH) into Register A.
55BF
AND 5FH E6 5F
Mask Register A with 5FH: a small letter becomes a capital; the CARRY FLAG is cleared.
55C1
RET C9
RETurn with the first character of the answer in Register A.

55C2H - The Errors of a Step

5696H counts the errors of the step just made (5CCAH). After the source read (55C2H) one more read of the cylinder is made; if that fails too, Source disk error is shown and ENTER starts the copy again from the source's boot sector (BREAK ends QFB). After a format, write or verify of a destination (55EEH), the destination is dropped: its digit in the copy at 5687H becomes 00H and Bad disk in drive is shown with the digit.

55C2
LD HL,5696H 21 96 56
Point Register Pair HL to 5696H, the count of errors.
55C5
LD A,(HL) 7E
Fetch the count of errors at Register Pair HL into Register A.
55C6
LD (HL),00H 36 00
Store 00H at Register Pair HL (5696H): the count starts again.
55C8
OR A B7
OR Register A with itself to set the Z FLAG when the read had no error.
55C9
RET Z C8
If the Z FLAG is set (the read was good), RETurn.
55CA
GOSUB to 60CFH to read the source cylinder once more.
55CD
LD HL,5696H 21 96 56
Point Register Pair HL to 5696H, the count of errors.
55D0
LD A,(HL) 7E
Fetch the count of errors of the second read at Register Pair HL into Register A.
55D1
LD (HL),00H 36 00
Store 00H at Register Pair HL (5696H): the count starts again.
55D3
OR A B7
OR Register A with itself to set the Z FLAG when the second read was good.
55D4
RET Z C8
If the Z FLAG is set (the second read was good), RETurn.
55D5
LD HL,602AH 21 2A 60
Point Register Pair HL to 602AH, the text Source disk error and Press ENTER to restart program or BREAK to exit.
55D8
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (602AH) on the video.
55DB
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A. 55E5H loops back here.
55DE
CP 01H FE 01
Compare Register A (the key) against 01H, the BREAK key.
55E0
If the Z FLAG is set (BREAK), JUMP to 5C1EH to display Program aborted! and the count of the disks, and end.
55E3
CP 0DH FE 0D
Compare Register A (the key) against 0DH, the ENTER key.
55E5
If the NZ FLAG is set (any other key), JUMP back to 55DBH to wait for the next key.
55E7
XOR A AF
Clear Register A (XOR A) to 00H before the start again from the source.
55E8
LD (5694H),A 32 94 56
Store Register A (00H) at 5694H; no instruction of QFB reads 5694H.
55EB
JUMP to 52CFH to start the copy again from the source's boot sector.
55EE
LD HL,5696H 21 96 56
Point Register Pair HL to 5696H, the count of errors.
55F1
LD A,(HL) 7E
Fetch the count of errors at Register Pair HL into Register A.
55F2
LD (HL),00H 36 00
Store 00H at Register Pair HL (5696H): the count starts again.
55F4
OR A B7
OR Register A with itself to set the Z FLAG when the step had no error.
55F5
RET Z C8
If the Z FLAG is set (no error), RETurn with the Z FLAG.
55F6
PUSH HL E5
Save Register Pair HL to the stack. 53FCH and 61ECH come here with a message of their own already shown.
55F7
PUSH DE D5
Save Register Pair DE to the stack across the display of the message.
55F8
LD HL,5938H 21 38 59
Point Register Pair HL to 5938H, the text =========> Bad disk in drive, ended by 03H.
55FB
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5938H) on the video.
55FE
LD A,(569BH) 3A 9B 56
Fetch the index of the current drive from 569BH into Register A.
5601
LD D,00H 16 00
Load Register D with 00H, the high byte for the index in Register Pair DE.
5603
LD E,A 5F
Copy Register A (the index) into Register E: Register Pair DE = the index.
5604
LD HL,5686H 21 86 56
Point Register Pair HL to 5686H, the place before the copy of the digits.
5607
ADD HL,DE 19
ADD Register Pair DE (the index) to Register Pair HL: Register Pair HL = the digit of the destination.
5608
LD A,(HL) 7E
Fetch the destination's digit at Register Pair HL into Register A.
5609
LD (HL),00H 36 00
Store 00H at Register Pair HL: the destination is dropped for the rest of this copy.
560B
GOSUB to 0033H, the ROM's display of the character in Register A, the drive's digit.
560E
LD A,0DH 3E 0D
Load Register A with 0DH, a new line after the digit of the drive.
5610
GOSUB to 0033H, the ROM's display of the character in Register A (0DH).
5613
POP DE D1
Restore Register Pair DE from the stack: the caller's value again.
5614
POP HL E1
Restore Register Pair HL from the stack: the caller's value again.
5615
OR FFH F6 FF
OR Register A with FFH: Register A = FFH and the NZ FLAG, the destination was dropped.
5617
RET C9
RETurn to the caller with the NZ FLAG: the destination is dropped.

5618H - The Errors That End QFB

Four texts, displayed by @LOGOT before 5C37H puts the system back and ends QFB. The entries 561CH, 5620H and 5624H lie inside LD IX instructions: each DD byte makes the LD HL after it a part of an LD IX, which loads Index Register IX and changes nothing that counts.

5618
LD HL,58F5H 21 F5 58
Point Register Pair HL to 58F5H, the text Destination drive has software write-protect!, ended by 0DH.
561B
LD IX,58D3H DD 21 D3 58
Load Index Register IX with 58D3H. Nothing uses Index Register IX here: 534FH enters at 561CH, LD HL,58D3H, the text Incorrect destination drive type!.
561F
LD IX,5823H DD 21 23 58
Load Index Register IX with 5823H. Nothing uses Index Register IX here: 52E1H and 536EH enter at 5620H, LD HL,5823H, the text This program requires floppy disks!.
5623
LD IX,570CH DD 21 0C 57
Load Index Register IX with 570CH. Nothing uses Index Register IX here: 5221H and 522BH enter at 5624H, LD HL,570CH, the text Parameter error.
5627
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL and write it to the job log; 6201H puts 447BH here on the Model I.
562A
JUMP to 5C37H to put the system back and end QFB.

562DH - The Parameter Table and the Values

The table of @PARAM in the form of LDOS 5: six characters of the name, padded with spaces, and the address of the value, ended by 00H. @PARAM stores FFFFH (or 0000H for =N) at the address of each parameter given. 565EH puts the defaults back for the restart R; 5669H clears the drives and the tables of drives. The values in the file are those of a first start: each parameter's low byte 01H means not given, the high byte is its default.

562D-5632
DEFM "QUERY " 51 55 45 52 59 20
562DH-5632H: the name QUERY, padded to six characters with a space.
5633-5634
DEFW 5682H 82 56
5633H-5634H: 5682H, the value of QUERY: with it, the questions are asked.
5635-563A
DEFM "Q " 51 20 20 20 20 20
5635H-563AH: the name Q, the short form of QUERY, padded to six characters.
563B-563C
DEFW 5682H 82 56
563BH-563CH: 5682H, the same value as QUERY, for the short form Q.
563D-5642
DEFM "ALL " 41 4C 4C 20 20 20
563DH-5642H: the name ALL, padded to six characters: copy the cylinders that are not in use too.
5643-5644
DEFW 567CH 7C 56
5643H-5644H: 567CH, the value of ALL, two bytes that @PARAM stores.
5645-564A
DEFM "A " 41 20 20 20 20 20
5645H-564AH: the name A, the short form of ALL, padded to six characters.
564B-564C
DEFW 567CH 7C 56
564BH-564CH: 567CH, the same value as ALL, for the short form A.
564D-5652
DEFM "V1 " 56 31 20 20 20 20
564DH-5652H: the name V1, padded to six characters: verify each cylinder on the same pass.
5653-5654
DEFW 567EH 7E 56
5653H-5654H: 567EH, the value of V1, two bytes that @PARAM stores.
5655-565A
DEFM "V2 " 56 32 20 20 20 20
5655H-565AH: the name V2, padded to six characters: verify the disk on a second pass.
565B-565C
DEFW 5680H 80 56
565BH-565CH: 5680H, the value of V2, two bytes that @PARAM stores.
565D
DEFB 00H 00
565DH: 00H, the end of the parameter table for @PARAM.
565E
LD HL,5674H 21 74 56
Point Register Pair HL to 5674H, the defaults of the four values: ALL, V1, V2 and QUERY.
5661
LD DE,567CH 11 7C 56
Point Register Pair DE to 567CH, the four values.
5664
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the eight bytes of the four values.
5667
LDIR ED B0
Copy the defaults from Register Pair HL (5674H) to Register Pair DE (567CH), Register Pair BC counting (LDIR).
5669
LD HL,5684H 21 84 56
Point Register Pair HL to 5684H, the drive digits and the tables of drives. 525AH comes here.
566C
LD B,09H 06 09
Load Register B with 09H, the nine bytes 5684H-568CH.
566E
LD (HL),00H 36 00
Store 00H at Register Pair HL. 5671H loops back here.
5670
INC HL 23
INCrement Register Pair HL to the next byte of the drives and tables.
5671
DECrement Register B and loop back to 566EH until the nine bytes are clear.
5673
RET C9
RETurn to the caller with the drives cleared.
5674-5675
DEFB 01H, 00H 01 00
5674H-5675H: the default of ALL for the restart R: 01H not given, 00H copy only the cylinders in use.
5676-5677
DEFB 01H, FFH 01 FF
5676H-5677H: the default of V1 for the restart R: 01H not given, FFH verify on the same pass.
5678-5679
DEFB 01H, 00H 01 00
5678H-5679H: the default of V2 for the restart R: 01H not given, 00H no second pass.
567A-567B
DEFB FFH, FFH FF FF
567AH-567BH: the default of QUERY for the restart R: FFFFH, the questions are asked.
567C-567D
DEFB 01H, 00H 01 00
567CH-567DH: the value of ALL: 01H not given, 00H the default; 52B6H complements the high byte 567DH.
567E-567F
DEFB 01H, FFH 01 FF
567EH-567FH: the value of V1: 01H not given, FFH the default, verify after each write.
5680-5681
DEFB 01H, 00H 01 00
5680H-5681H: the value of V2: 01H not given, 00H the default, no second pass.
5682-5683
DEFB 00H x 2 00 x 2
5682H-5683H: the value of QUERY: 0000H unless QUERY or Q is given (or the restart R).
5684
DEFB 00H 00
5684H: the source drive's digit, 30H-37H, from the command line or the question.
5685
DEFB 00H 00
5685H: the destination drive's digit, 30H-37H.
5686
DEFB 00H 00
5686H: 00H, the end of the destination digits; 54E5H and 55FEH index from it.
5687-5688
DEFB 00H x 2 00 x 2
5687H-5688H: the copy of the destination digit and its end, made by 533AH; 00H when the destination is dropped.
5689-568A
DEFB 00H x 2 00 x 2
5689H-568AH: the address of the source's drive code table, the first entry of the table of drives.
568B-568C
DEFB 00H x 2 00 x 2
568BH-568CH: the address of the destination's drive code table, the second entry.
568D-568E
DEFB 00H x 2 00 x 2
568DH-568EH: DCT$, 4700H, stored by 6201H: the first drive code table.
568F-5690
DEFB 00H x 2 00 x 2
568FH-5690H: HIGH$, stored by 6201H, for the memory test 5525H.
5691
DEFB 00H 00
5691H: the source's byte +03H, stored by 5304H; no instruction reads it.
5692-5693
DEFB 00H x 2 00 x 2
5692H-5693H: the count of the disks made since QFB was started (5491H); it is never cleared.
5694
DEFB 00H 00
5694H: written by 5498H and 55E8H; no instruction reads it.
5695
DEFB 00H 00
5695H: the step of the sector loop 5BA6H: 00H write, 01H verify, FFH read.
5696
DEFB 00H 00
5696H: the count of the errors of the current step, counted by 5CCAH.
5697
DEFB 00H 00
5697H: the count of the writes of a cylinder after a verify error (5433H).
5698-5699
DEFS 2
5698H-5699H: not in the file. The Stack Pointer at the start (5200H), loaded again by 52CFH and 5336H.
569A
DEFS 1
569AH: not in the file. The cylinder being copied (53C8H, 545CH).
569B
DEFS 1
569BH: not in the file. The index of the current drive in the table of drives: 0 the source, 1 the destination.
569C-56EB
DEFS 80
569CH-56EBH: not in the file. The copy of the eight drive code tables of DCT$ (6241H), put back by 5C3DH at the end.
56EC-570B
DEFS 32
56ECH-570BH: not in the file. The buffer of the answers for the ROM's line input (55B6H): ten characters and ENTER at most.

570CH - The Texts

The banner, the questions and the messages of QFB. A text ends with 0DH (a new line after it) or 03H (the cursor stays after it); 1CH puts the cursor at the top left of the screen and 1FH clears the screen from the cursor down. The count of the disks is written into the text at 596FH and the letter s at 5979H.

570C-571A
DEFM "Parameter error" 50 61 72 61 6D 65 74 65 72 20 65 72 72 6F 72
570CH-571AH: the text of 5624H for a bad parameter or a bad drive on the command line.
571B
DEFB 0DH 0D
571BH: 0DH, the end of the text Parameter error.
571C-571D
DEFB 1CH, 1FH 1C 1F
571CH-571DH: 1CH, the cursor to the top left, and 1FH, the screen cleared: the start of the banner (5208H, 522EH, 54C5H).
571E-574F
DEFM "QFB - LDOS Quick Format and Backup - Version 5.3.1" 51 46 42 20 2D 20 4C 44 4F 53 20 51 75 69 63 6B 20 46 6F 72 6D 61 74 20 61 6E 64 20 42 61 63 6B 75 70 20 2D 20 56 65 72 73 69 6F 6E 20 35 2E 33 2E 31
571EH-574FH: the name of the program, what it does and its version.
5750
DEFB 0AH 0A
5750H: 0AH, a new line: the copyright goes on the next line.
5751-5783
DEFM "Copyright 1991 MISOSYS, Inc., All rights reserved." 43 6F 70 79 72 69 67 68 74 20 31 39 39 31 20 4D 49 53 4F 53 59 53 2C 20 49 6E 63 2E 2C 20 20 41 6C 6C 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 2E
5751H-5783H: the copyright line of the banner, with two spaces after the comma.
5784-5785
DEFB 0AH, 0DH 0A 0D
5784H-5785H: 0AH, a new line, and 0DH, the end of the banner.
5786-579B
DEFB 20H x 22 20 x 22
5786H-579BH: 22 spaces before the text of the memory test; no instruction points at 5786H, 552BH points past them at 579CH.
579C-57C3
DEFM "Insufficient memory for specified drive!" 49 6E 73 75 66 66 69 63 69 65 6E 74 20 6D 65 6D 6F 72 79 20 66 6F 72 20 73 70 65 63 69 66 69 65 64 20 64 72 69 76 65 21
579CH-57C3H: the text of 552EH when HIGH$ is below the end of the cylinder buffer.
57C4
DEFB 0DH 0D
57C4H: 0DH, the end of the text Insufficient memory for specified drive!.
57C5-57D3
DEFM "Source drive ? " 53 6F 75 72 63 65 20 64 72 69 76 65 20 3F 20
57C5H-57D3H: the question of 523DH when the command line gives no source drive.
57D4
DEFB 03H 03
57D4H: 03H, the end of the question: the answer is typed after it.
57D5-57E8
DEFM "Destination drive ? " 44 65 73 74 69 6E 61 74 69 6F 6E 20 64 72 69 76 65 20 3F 20
57D5H-57E8H: the question of 5269H when the command line gives no destination drive.
57E9
DEFB 03H 03
57E9H: 03H, the end of the question: the answer is typed after it.
57EA-57FF
DEFM "Source Disk not ready!" 53 6F 75 72 63 65 20 44 69 73 6B 20 6E 6F 74 20 72 65 61 64 79 21
57EAH-57FFH: the text of 52EEH: no index pulses, or the boot sector or the allocation table could not be read.
5800
DEFB 0DH 0D
5800H: 0DH, the end of the text Source Disk not ready!.
5801-5820
DEFM "Load diskettes and press <ENTER>" 4C 6F 61 64 20 64 69 73 6B 65 74 74 65 73 20 61 6E 64 20 70 72 65 73 73 20 3C 45 4E 54 45 52 3E
5801H-5820H: the prompt of 52BDH before the copy starts.
5821-5822
DEFB 0AH, 0DH 0A 0D
5821H-5822H: 0AH, a new line, and 0DH, the end of the prompt.
5823-5845
DEFM "This program requires floppy disks!" 54 68 69 73 20 70 72 6F 67 72 61 6D 20 72 65 71 75 69 72 65 73 20 66 6C 6F 70 70 79 20 64 69 73 6B 73 21
5823H-5845H: the text of 5620H when the source or the destination is a hard disk.
5846
DEFB 0DH 0D
5846H: 0DH, the end of the text This program requires floppy disks!.
5847-5872
DEFM "Source and destinations drives are the same!" 53 6F 75 72 63 65 20 61 6E 64 20 64 65 73 74 69 6E 61 74 69 6F 6E 73 20 64 72 69 76 65 73 20 61 72 65 20 74 68 65 20 73 61 6D 65 21
5847H-5872H: the text of 5254H when a destination is the source drive.
5873
DEFB 0DH 0D
5873H: 0DH, the end of the text Source and destinations drives are the same!.
5874-5897
DEFM "Duplicate unallocated tracks? (Y/N) " 44 75 70 6C 69 63 61 74 65 20 75 6E 61 6C 6C 6F 63 61 74 65 64 20 74 72 61 63 6B 73 3F 20 28 59 2F 4E 29 20
5874H-5897H: the question of ALL (528FH): Y copies every cylinder, N only those in use.
5898
DEFB 03H 03
5898H: 03H, the end of the question: the answer is typed after it.
5899-58B3
DEFM "Verify on same pass? (Y/N) " 56 65 72 69 66 79 20 6F 6E 20 73 61 6D 65 20 70 61 73 73 3F 20 28 59 2F 4E 29 20
5899H-58B3H: the question of V1 (529EH): Y reads each cylinder back after it is written.
58B4
DEFB 03H 03
58B4H: 03H, the end of the question: the answer is typed after it.
58B5-58D1
DEFM "Verify on second pass? (Y/N) " 56 65 72 69 66 79 20 6F 6E 20 73 65 63 6F 6E 64 20 70 61 73 73 3F 20 28 59 2F 4E 29 20
58B5H-58D1H: the question of V2 (52ADH): Y reads the whole disk back after the copy.
58D2
DEFB 03H 03
58D2H: 03H, the end of the question: the answer is typed after it.
58D3-58F3
DEFM "Incorrect destination drive type!" 49 6E 63 6F 72 72 65 63 74 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 64 72 69 76 65 20 74 79 70 65 21
58D3H-58F3H: the text of 561CH when the destination is not of the source's size (5 or 8 inch).
58F4
DEFB 0DH 0D
58F4H: 0DH, the end of the text Incorrect destination drive type!.
58F5-5921
DEFM "Destination drive has software write-protect!" 44 65 73 74 69 6E 61 74 69 6F 6E 20 64 72 69 76 65 20 68 61 73 20 73 6F 66 74 77 61 72 65 20 77 72 69 74 65 2D 70 72 6F 74 65 63 74 21
58F5H-5921H: the text of 5618H when bit 7 of byte +03H of the destination's drive code table is set.
5922
DEFB 0DH 0D
5922H: 0DH, the end of the text Destination drive has software write-protect!.
5923-5936
DEFM "Invalid drive entry!" 49 6E 76 61 6C 69 64 20 64 72 69 76 65 20 65 6E 74 72 79 21
5923H-5936H: the text of 527AH when the answer to Destination drive ? has a bad character.
5937
DEFB 0DH 0D
5937H: 0DH, the end of the text Invalid drive entry!.
5938-5956
DEFM " =========> Bad disk in drive " 20 20 3D 3D 3D 3D 3D 3D 3D 3D 3D 3E 20 42 61 64 20 64 69 73 6B 20 69 6E 20 64 72 69 76 65 20
5938H-5956H: the text of 55F8H when a destination is dropped; 560BH adds the drive's digit.
5957
DEFB 03H 03
5957H: 03H, the end of the text: the digit follows on the same line.
5958-5959
DEFB 0AH, 0AH 0A 0A
5958H-5959H: two new lines before the text Duplication complete (54ADH).
595A-596E
DEFM "Duplication complete " 44 75 70 6C 69 63 61 74 69 6F 6E 20 63 6F 6D 70 6C 65 74 65 20
595AH-596EH: the start of the text of the count of the disks made.
596F-5973
DEFB 20H x 5 20 x 5
596FH-5973H: the five places of the count, written by 616CH with spaces for the leading zeros (54AAH, 5C30H).
5974-5978
DEFM " disk" 20 64 69 73 6B
5974H-5978H: a space and the word disk after the count.
5979-597A
DEFB 20H x 2 20 x 2
5979H-597AH: two spaces: 54A3H writes the letter s at 5979H when more than one disk was made; it stays there.
597B-5981
DEFM "created" 63 72 65 61 74 65 64
597BH-5981H: the word created, the end of the text of the count.
5982
DEFB 0DH 0D
5982H: 0DH, the end of the text of the count; @LOGOT shows it from 596FH at 5C34H.
5983
DEFB 0AH 0A
5983H: 0AH, a new line: the start of the text of 54B3H.
5984-59B7
DEFM "Replace destination disk and press <ENTER> to repeat" 52 65 70 6C 61 63 65 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 64 69 73 6B 20 61 6E 64 20 70 72 65 73 73 20 3C 45 4E 54 45 52 3E 20 74 6F 20 72 65 70 65 61 74
5984H-59B7H: the first line of 54B3H: ENTER makes another copy (54C1H).
59B8
DEFB 0AH 0A
59B8H: 0AH, a new line after the first line of the question of the end.
59B9-59DD
DEFM " ..<R> to restart with new parameters" 20 2E 2E 3C 52 3E 20 74 6F 20 72 65 73 74 61 72 74 20 77 69 74 68 20 6E 65 77 20 70 61 72 61 6D 65 74 65 72 73
59B9H-59DDH: the second line: R asks for the drives and the parameters again (54D0H).
59DE
DEFB 0AH 0A
59DEH: 0AH, a new line after the second line.
59DF-5A02
DEFM " ...or....<BREAK> to exit program." 20 20 20 2E 2E 2E 6F 72 2E 2E 2E 2E 3C 42 52 45 41 4B 3E 20 74 6F 20 65 78 69 74 20 70 72 6F 67 72 61 6D 2E
59DFH-5A02H: the third line: BREAK ends QFB (54BCH).
5A03
DEFB 0DH 0D
5A03H: 0DH, the end of the text of 54B3H, the question of the end.

5A04H - The Index Pulse Test

A drive is ready when its index pulse (bit 1 of the controller's status) goes off, on and off again within 1000H status reads after a restore. A drive with its own driver (bit 4 of byte +04H, a MemDISK) is taken as ready at once. 5A21H counts Register Pair BC down; at 0000H it drops its return address and gives the NZ FLAG and Register A = 20H to the caller of 5A04H.

5A04
XOR A AF
Clear Register A (XOR A) to 00H and set the Z FLAG, the answer for a drive with its own driver.
5A05
BIT 4,(IY+04H) FD CB 04 66
Test bit 4 of byte +04H of the drive code table at Index Register IY: set for a drive with its own driver.
5A09
If the NZ FLAG is set (its own driver), JUMP to 5A31H to return with the Z FLAG: ready.
5A0B
GOSUB to 5C84H, function 04H, to restore the drive's head to cylinder 0.
5A0E
LD BC,1000H 01 00 10
Load Register Pair BC with 1000H, the status reads allowed for the three changes of the index pulse.
5A11
GOSUB to 5A21H to read the status: bit 1 the index pulse. 5A14H loops back here.
5A14
If the NZ FLAG is set (the index pulse is on), JUMP back to 5A11H to wait until it goes off.
5A16
GOSUB to 5A21H to read the status: bit 1 the index pulse. 5A19H loops back here.
5A19
If the Z FLAG is set (the index pulse is off), JUMP back to 5A16H to wait until it comes.
5A1B
GOSUB to 5A21H to read the status: bit 1 the index pulse. 5A1EH loops back here.
5A1E
If the NZ FLAG is set (the index pulse is on), JUMP back to 5A1BH to wait until it goes off again.
5A20
RET C9
RETurn with the Z FLAG and Register A = the status: the drive turns and is ready.
5A21
LD A,B 78
Copy Register B (the high byte of the count) into Register A.
5A22
OR C B1
OR Register C into Register A: the Z FLAG is set when the count in Register Pair BC is 0000H.
5A23
EX (SP),HL E3
Exchange Register Pair HL with the top of the stack, a delay (the Stack Pointer is not changed).
5A24
EX (SP),HL E3
Exchange Register Pair HL with the top of the stack again: Register Pair HL and the return address are back (the Stack Pointer is not changed).
5A25
DEC BC 0B
DECrement Register Pair BC, the count; DEC of a register pair leaves the flags of the OR.
5A26
If the Z FLAG is set (the count had run out), JUMP to 5A2EH to give up.
5A28
GOSUB to 5C99H, function 07H, to wait until the controller is not busy: Register A = the status.
5A2B
BIT 1,A CB 4F
Test bit 1 of Register A, the index pulse of the controller's status.
5A2D
RET C9
RETurn with the Z FLAG when the index pulse is off, the NZ FLAG when it is on.
5A2E
POP HL E1
Restore Register Pair HL from the stack: the return address into 5A04H is dropped, the next RET goes to its caller.
5A2F
LD A,20H 3E 20
Load Register A with 20H, the answer for a drive that is not ready.
5A31
OR A B7
OR Register A with itself: the Z FLAG for 00H (5A09H), the NZ FLAG for 20H (not ready).
5A32
RET C9
RETurn to the caller of 5A04H with the Z FLAG (ready) or the NZ FLAG (not ready).

5A33H - Formatting a Cylinder

The format table (5A38H, chosen by 5507H) starts with the sectors of a track, the step of the sector numbers from one cylinder to the next, the sector numbers in the order on the track and the bytes that wrap their pointer back. The program after them builds the image of one track at 6700H: a count byte and a value give the value that many times (00H 256 times); F1H and F2H repeat what is between them once for each sector; F3H keeps the place of the sector's three identification bytes in the list at 6600H; F4H ends the track with 256 bytes FFH and leaves the order of the sectors for the read and the write; F5H with a count and two bytes gives the two bytes that many times (6DH B6H, the double density fill). Then each side is written with the Write Track command.

5A33
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
5A36
LD C,A 4F
Copy Register A (the cylinder) into Register C for the test of cylinder 0.
5A37
LD DE,0000H 11 00 00
Point Register Pair DE to the format table: 5560H stores its address in this operand at 5A38H (0000H in the file).
5A3A
LD A,(DE) 1A
Fetch the first byte of the table at Register Pair DE into Register A: the sectors of a track.
5A3B
INC DE 13
INCrement Register Pair DE to the second byte of the table.
5A3C
LD (5CF2H),A 32 F2 5C
Store Register A (the sectors of a track) at 5CF2H: the loop 5BA6H changes sides after that many sectors.
5A3F
LD B,A 47
Copy Register A (the sectors of a track) into Register B.
5A40
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of byte +04H of the drive code table at Index Register IY: set for two sides.
5A44
If the Z FLAG is set (one side), JUMP to 5A47H.
5A46
ADD A,A 87
Double Register A (ADD A,A): the sectors of the cylinder, both sides.
5A47
LD (5CF1H),A 32 F1 5C
Store Register A (the sectors of the cylinder) at 5CF1H: the loop 5BA6H ends after that many sectors.
5A4A
LD A,(DE) 1A
Fetch the second byte of the table at Register Pair DE into Register A: the step of the sector numbers from cylinder to cylinder.
5A4B
INC DE 13
INCrement Register Pair DE to the sector numbers.
5A4C
LD (5B4CH),A 32 4C 5B
Store Register A (the step) at 5B4CH, the operand of LD A,00H at 5B4BH.
5A4F
INC C 0C
INCrement Register C (the cylinder), the first half of the test for 0.
5A50
DEC C 0D
DECrement Register C back: the Z FLAG is set for cylinder 0.
5A51
If the NZ FLAG is set (not cylinder 0), JUMP to 5A57H: the pointer into the sector numbers goes on from the last cylinder.
5A53
LD (5AD1H),DE ED 53 D1 5A
Store Register Pair DE (the first sector number) at 5AD1H, the operand of LD BC at 5AD0H: cylinder 0 starts at the first number.
5A57
INC A 3C
INCrement Register A (the step): the wrap bytes are one more than the step.
5A58
ADD A,B 80
ADD Register B (the sectors of a track) to Register A: the length of the sector numbers and the wrap bytes.
5A59
ADD A,E 83
ADD Register E to Register A: the low byte of the program's address.
5A5A
LD E,A 5F
Copy Register A (the low byte of the program's address) into Register E.
5A5B
ADC A,D 8A
ADD Register D and the CARRY FLAG to Register A (ADC A,D).
5A5C
SUB E 93
SUBtract Register E from Register A: Register A = Register D plus the carry.
5A5D
LD D,A 57
Copy Register A into Register D: Register Pair DE = the program of the track, after the wrap bytes.
5A5E
LD HL,6700H 21 00 67
Point Register Pair HL to 6700H, where the image of the track is built.
5A61
LD BC,6600H 01 00 66
Point Register Pair BC to 6600H, the list of the places of the identification bytes.
5A64
LD A,(DE) 1A
Fetch the next byte of the program at Register Pair DE into Register A. 5A92H, 5A99H, 5AA3H and 5AABH loop back here.
5A65
INC DE 13
INCrement Register Pair DE past the byte of the program just taken.
5A66
CP F1H FE F1
Compare Register A against F1H, the start of the part repeated for each sector.
5A68
If the Z FLAG is set (F1H), JUMP to 5A94H to keep the place and the count of the repeat.
5A6A
CP F2H FE F2
Compare Register A against F2H, the end of the part repeated for each sector.
5A6C
If the Z FLAG is set (F2H), JUMP to 5A9BH to repeat the part or go on.
5A6E
CP F3H FE F3
Compare Register A against F3H, the place of the identification bytes.
5A70
If the Z FLAG is set (F3H), JUMP to 5AA5H to keep the place in Register Pair HL.
5A72
CP F4H FE F4
Compare Register A against F4H, the end of the track.
5A74
If the Z FLAG is set (F4H), JUMP to 5AADH to end the track.
5A76
CP F5H FE F5
Compare Register A against F5H, the two byte fill.
5A78
PUSH BC C5
Save Register Pair BC (the place in the list at 6600H) to the stack; PUSH leaves the flags of the comparison.
5A79
If the NZ FLAG is set (a count), JUMP to 5A8AH to give the next byte that many times.
5A7B
LD A,(DE) 1A
Fetch the count of the two byte fill at Register Pair DE into Register A.
5A7C
INC DE 13
INCrement Register Pair DE to the first byte of the fill.
5A7D
LD B,A 47
Copy Register A (the count of the pairs) into Register B for the loop.
5A7E
LD A,(DE) 1A
Fetch the first byte of the fill at Register Pair DE into Register A.
5A7F
INC DE 13
INCrement Register Pair DE to the second byte of the fill.
5A80
LD C,A 4F
Copy Register A (the first byte) into Register C.
5A81
LD A,(DE) 1A
Fetch the second byte of the fill at Register Pair DE into Register A; 5A91H passes over it.
5A82
LD (HL),C 71
Store Register C (the first byte) at Register Pair HL in the image of the track. 5A86H loops back here.
5A83
INC HL 23
INCrement Register Pair HL to the next place of the image.
5A84
LD (HL),A 77
Store Register A (the second byte) at Register Pair HL.
5A85
INC HL 23
INCrement Register Pair HL to the next place of the image.
5A86
DECrement Register B and loop back to 5A82H until the pairs are all written.
5A88
JUMP to 5A90H to take the place in the list back.
5A8A
LD B,A 47
Copy Register A (the count, 00H for 256) into Register B.
5A8B
LD A,(DE) 1A
Fetch the value at Register Pair DE into Register A.
5A8C
LD (HL),A 77
Store Register A (the value) at Register Pair HL in the image of the track. 5A8EH loops back here.
5A8D
INC HL 23
INCrement Register Pair HL to the next place of the image.
5A8E
DECrement Register B and loop back to 5A8CH until the value is written Register B times.
5A90
POP BC C1
Restore Register Pair BC from the stack: the place in the list at 6600H.
5A91
INC DE 13
INCrement Register Pair DE past the value, to the next byte of the program.
5A92
JUMP back to 5A64H for the next byte of the program.
5A94
LD A,(5CF2H) 3A F2 5C
Fetch the sectors of a track from 5CF2H into Register A, the count of the repeat.
5A97
PUSH DE D5
Save Register Pair DE (the program after F1H) to the stack. 5AA0H comes back here.
5A98
PUSH AF F5
Save Register Pair AF (Register A = the repeats left) to the stack.
5A99
JUMP back to 5A64H for the first byte of the repeated part.
5A9B
POP AF F1
Restore Register Pair AF from the stack: Register A = the repeats left.
5A9C
DEC A 3D
DECrement Register A: the Z FLAG when the last sector is done.
5A9D
If the Z FLAG is set (the last sector), JUMP to 5AA2H to go on after F2H.
5A9F
POP DE D1
Restore Register Pair DE from the stack: the program after F1H.
5AA0
JUMP back to 5A97H to keep it again and build the next sector.
5AA2
POP AF F1
Restore Register Pair AF from the stack: the kept place of the program is dropped.
5AA3
JUMP back to 5A64H for the byte of the program after F2H.
5AA5
LD A,L 7D
Copy Register L (the low byte of the place in the image) into Register A.
5AA6
LD (BC),A 02
Store Register A at Register Pair BC in the list at 6600H.
5AA7
INC BC 03
INCrement Register Pair BC to the next place of the list.
5AA8
LD A,H 7C
Copy Register H (the high byte of the place in the image) into Register A.
5AA9
LD (BC),A 02
Store Register A at Register Pair BC in the list at 6600H.
5AAA
INC BC 03
INCrement Register Pair BC to the next place of the list.
5AAB
JUMP back to 5A64H for the next byte of the program.
5AAD
LD (5BCBH),DE ED 53 CB 5B
Store Register Pair DE (the order of the sectors after F4H) at 5BCBH, the operand of LD BC at 5BCAH.
5AB1
XOR A AF
Clear Register A (XOR A) to 00H for the end of the list.
5AB2
LD (BC),A 02
Store Register A (00H) at Register Pair BC: the low byte of the end of the list.
5AB3
INC BC 03
INCrement Register Pair BC to the high byte of the end of the list.
5AB4
LD (BC),A 02
Store Register A (00H) at Register Pair BC: the list at 6600H ends with 0000H.
5AB5
LD B,00H 06 00
Load Register B with 00H: the loop below writes 256 bytes.
5AB7
LD A,FFH 3E FF
Load Register A with FFH, the fill after the last sector.
5AB9
LD (HL),A 77
Store Register A (FFH) at Register Pair HL in the image of the track. 5ABBH loops back here.
5ABA
INC HL 23
INCrement Register Pair HL to the next place of the image.
5ABB
DECrement Register B and loop back to 5AB9H until 256 bytes FFH are written.
5ABD
LD HL,5F24H 21 24 5F
Point Register Pair HL to 5F24H, the text Formatting cylinder at the start of the line, ended by 03H.
5AC0
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5F24H) on the video.
5AC3
LD A,(IY+05H) FD 7E 05
Fetch byte +05H of the drive code table at Index Register IY into Register A, the cylinder the head is on.
5AC6
GOSUB to 5CD2H to make the two digits of Register A in Register C and Register B.
5AC9
GOSUB to 5CDFH to write the two digits over the last two places of the text.
5ACC
RES 4,(IY+03H) FD CB 03 A6
Reset bit 4 of byte +03H of the drive code table at Index Register IY: side 0 first.
5AD0
LD BC,0000H 01 00 00
Point Register Pair BC to the next sector number: 5A53H and 5B52H store it in this operand at 5AD1H (0000H in the file).
5AD3
LD HL,6600H 21 00 66
Point Register Pair HL to 6600H, the list of the places of the identification bytes. 5B45H comes back here for side 1.
5AD6
LD E,(HL) 5E
Fetch the low byte of the next place in the list at Register Pair HL into Register E. 5AFCH loops back here.
5AD7
INC HL 23
INCrement Register Pair HL to the high byte of the place in the list.
5AD8
LD D,(HL) 56
Fetch the high byte of the place at Register Pair HL into Register D.
5AD9
INC HL 23
INCrement Register Pair HL to the next entry of the list.
5ADA
LD A,D 7A
Copy Register D (the high byte of the place) into Register A for the test.
5ADB
OR E B3
OR Register E into Register A: the Z FLAG is set when the place in Register Pair DE is 0000H, the end of the list.
5ADC
If the Z FLAG is set (the end of the list), JUMP to 5AFEH to keep the pointer and write the track.
5ADE
LD A,(IY+05H) FD 7E 05
Fetch byte +05H of the drive code table at Index Register IY into Register A, the cylinder.
5AE1
LD (DE),A 12
Store Register A (the cylinder) at Register Pair DE, the first identification byte of the sector.
5AE2
INC DE 13
INCrement Register Pair DE to the second identification byte.
5AE3
LD A,(IY+03H) FD 7E 03
Fetch byte +03H of the drive code table at Index Register IY into Register A.
5AE6
AND 10H E6 10
Mask Register A with 10H: bit 4, the side being formatted.
5AE8
RRCA 0F
Rotate Register A right (RRCA): the side bit moves from bit 4 to bit 3.
5AE9
RRCA 0F
Rotate Register A right (RRCA): the side bit moves to bit 2.
5AEA
RRCA 0F
Rotate Register A right (RRCA): the side bit moves to bit 1.
5AEB
RRCA 0F
Rotate Register A right (RRCA): Register A = 00H for side 0, 01H for side 1.
5AEC
LD (DE),A 12
Store Register A (the side) at Register Pair DE, the second identification byte.
5AED
INC DE 13
INCrement Register Pair DE to the third identification byte, the sector number.
5AEE
LD A,(BC) 0A
Fetch the byte at Register Pair BC, the next sector number, into Register A.
5AEF
OR A B7
OR Register A with itself to set the SIGN FLAG for a wrap byte (F6H, EEH, F0H or E2H, minus the sectors of a track).
5AF0
If the POSITIVE FLAG is set (a sector number), JUMP to 5AF8H to store it.
5AF3
ADD A,C 81
ADD Register C to Register A: the low byte of the pointer minus the sectors of a track.
5AF4
LD C,A 4F
Copy Register A into Register C, the low byte of the pointer moved back.
5AF5
If the CARRY FLAG is set (no borrow from Register B), JUMP to 5AF8H.
5AF7
DEC B 05
DECrement Register B: Register Pair BC = the pointer moved back by the sectors of a track.
5AF8
LD A,(BC) 0A
Fetch the sector number at Register Pair BC into Register A.
5AF9
LD (DE),A 12
Store Register A (the sector number) at Register Pair DE, the third identification byte.
5AFA
INC DE 13
INCrement Register Pair DE past the sector number; the value is not used.
5AFB
INC BC 03
INCrement Register Pair BC to the next sector number.
5AFC
JUMP back to 5AD6H for the next sector of the track.
5AFE
LD (5AD1H),BC ED 43 D1 5A
Store Register Pair BC (the pointer into the sector numbers) at 5AD1H, the operand of LD BC at 5AD0H.
5B02
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
5B05
LD D,A 57
Copy Register A (the cylinder) into Register D.
5B06
LD E,00H 1E 00
Load Register E with 00H: Register Pair DE = the cylinder and sector 0 for the seek.
5B08
PUSH DE D5
Save Register Pair DE (the cylinder) to the stack.
5B09
BIT 4,(IY+03H) FD CB 03 66
Test bit 4 of byte +03H of the drive code table at Index Register IY: set for side 1.
5B0D
If the NZ FLAG is set (side 1), JUMP to 5B14H to select the drive with its other side.
5B0F
GOSUB to 5C94H, function 06H, to seek cylinder Register D for sector Register E (0).
5B12
JUMP to 5B17H, past the select of side 1, to wait for the controller.
5B14
GOSUB to 5C7FH, function 01H, to select the drive: bit 4 of byte +03H gives the side.
5B17
GOSUB to 5C99H, function 07H, to wait until the controller is not busy.
5B1A
PUSH BC C5
Save Register Pair BC (the pointer into the sector numbers) to the stack.
5B1B
LD BC,0258H 01 58 02
Load Register Pair BC with 0258H, the count of the ROM's delay before the Write Track.
5B1E
GOSUB to 0060H, the ROM's delay, which counts Register Pair BC down to 0.
5B21
POP BC C1
Restore Register Pair BC from the stack: the pointer into the sector numbers.
5B22
POP DE D1
Restore Register Pair DE from the stack: the cylinder and sector 0.
5B23
LD HL,6700H 21 00 67
Point Register Pair HL to 6700H, the image of the track.
5B26
GOSUB to 5C9EH, function 0FH, the Write Track of the image at Register Pair HL: the NZ FLAG for an error.
5B29
If the NZ FLAG is set (an error), GOSUB to 5CCAH to count it at 5696H.
5B2C
PUSH BC C5
Save Register Pair BC (the pointer into the sector numbers) to the stack.
5B2D
LD BC,00C8H 01 C8 00
Load Register Pair BC with 00C8H, the count of the ROM's delay after the Write Track.
5B30
GOSUB to 0060H, the ROM's delay, which counts Register Pair BC down to 0.
5B33
POP BC C1
Restore Register Pair BC from the stack: the pointer into the sector numbers.
5B34
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of byte +04H of the drive code table at Index Register IY: set for two sides.
5B38
If the Z FLAG is set (one side), JUMP to 5B47H: the cylinder is done.
5B3A
BIT 4,(IY+03H) FD CB 03 66
Test bit 4 of byte +03H of the drive code table at Index Register IY: set when side 1 was just written.
5B3E
If the NZ FLAG is set (side 1 is done), JUMP to 5B47H.
5B40
SET 4,(IY+03H) FD CB 03 E6
Set bit 4 of byte +03H of the drive code table at Index Register IY: side 1.
5B44
INC BC 03
INCrement Register Pair BC: side 1 starts one sector number further on.
5B45
JUMP back to 5AD3H to fill in the identification bytes of side 1.
5B47
RES 4,(IY+03H) FD CB 03 A6
Reset bit 4 of byte +03H of the drive code table at Index Register IY: side 0 again.
5B4B
LD A,00H 3E 00
Load Register A with the step of the sector numbers: 5A4CH stores it in this operand at 5B4CH (00H in the file).
5B4D
ADD A,C 81
ADD Register C to Register A: the low byte of the pointer plus the step.
5B4E
LD C,A 4F
Copy Register A into Register C, the low byte of the pointer for the next cylinder.
5B4F
ADC A,B 88
ADD Register B and the CARRY FLAG to Register A (ADC A,B).
5B50
SUB C 91
SUBtract Register C from Register A: Register A = Register B plus the carry.
5B51
LD B,A 47
Copy Register A into Register B: Register Pair BC = the pointer for the next cylinder.
5B52
LD (5AD1H),BC ED 43 D1 5A
Store Register Pair BC (the pointer) at 5AD1H, the operand of LD BC at 5AD0H.
5B56
RET C9
RETurn to the caller with the cylinder formatted.

5B57H - Is the Cylinder Copied?

5B57H returns the Z FLAG when the cylinder at 569AH is not copied: when the source's allocation table (6500H) gives it the same bits in use (65xxH) as locked out (6560H + the cylinder). With ALL every cylinder but cylinder 0 is copied without the test. 5B6FH writes, 5B81H reads and 5B90H verifies a cylinder through 5BA6H, which goes through the sectors in the order the format table gives.

5B57
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
5B5A
LD L,A 6F
Copy Register A (the cylinder) into Register L.
5B5B
OR A B7
OR Register A with itself to set the Z FLAG for cylinder 0.
5B5C
If the Z FLAG is set (cylinder 0), JUMP to 5B64H: its table bytes are always tested.
5B5E
LD A,(567DH) 3A 7D 56
Fetch the complemented ALL byte from 567DH into Register A: FFH unless ALL was given.
5B61
CP FFH FE FF
Compare Register A (the complemented ALL byte) against FFH.
5B63
RET NZ C0
If the NZ FLAG is set (ALL: every cylinder), RETurn with the NZ FLAG: the cylinder is copied.
5B64
LD H,65H 26 65
Load Register H with 65H: Register Pair HL = 65xxH, the cylinder's byte of the allocation table.
5B66
PUSH HL E5
Save Register Pair HL (the cylinder's byte of the allocation table) to the stack.
5B67
LD A,L 7D
Copy Register L (the cylinder) into Register A.
5B68
ADD A,60H C6 60
ADD 60H to Register A: the place of the cylinder's byte in the lock out table.
5B6A
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the cylinder's lock out byte.
5B6B
LD A,(HL) 7E
Fetch the cylinder's lock out byte at Register Pair HL into Register A.
5B6C
POP HL E1
Restore Register Pair HL from the stack: the cylinder's byte of the allocation table.
5B6D
CP (HL) BE
Compare Register A (the lock out byte) against the byte at Register Pair HL: the Z FLAG when no granule is in use.
5B6E
RET C9
RETurn with the Z FLAG (not copied) or the NZ FLAG (copied).
5B6F
GOSUB to 5B57H to test whether the cylinder is copied: the Z FLAG when it is not.
5B72
RET Z C8
If the Z FLAG is set (the cylinder is not copied), RETurn with the Z FLAG.
5B73
LD HL,5F54H 21 54 5F
Point Register Pair HL to 5F54H, the text Writing cylinder at the start of the line, ended by 03H.
5B76
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5F54H) on the video.
5B79
XOR A AF
Clear Register A (XOR A) to 00H, the step write.
5B7A
LD (5695H),A 32 95 56
Store Register A (00H) at 5695H, the step of the sector loop.
5B7D
GOSUB to 5BA6H to write the sectors of the cylinder from 6700H.
5B80
RET C9
RETurn to the caller with the flags of the sector loop of the write.
5B81
LD HL,5F6CH 21 6C 5F
Point Register Pair HL to 5F6CH, the text Reading cylinder at the start of the line, ended by 03H.
5B84
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5F6CH) on the video.
5B87
LD A,FFH 3E FF
Load Register A with FFH, the step read, for the sector loop.
5B89
LD (5695H),A 32 95 56
Store Register A (FFH) at 5695H, the step of the sector loop.
5B8C
GOSUB to 5BA6H to read the sectors of the cylinder into memory from 6700H and sum them.
5B8F
RET C9
RETurn with the flags of the sector loop: the NZ FLAG after an error.
5B90
LD HL,5F3CH 21 3C 5F
Point Register Pair HL to 5F3CH, the text Verifying cylinder at the start of the line, ended by 03H.
5B93
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5F3CH) on the video.
5B96
LD A,01H 3E 01
Load Register A with 01H, the step verify, for the sector loop.
5B98
LD (5695H),A 32 95 56
Store Register A (01H) at 5695H, the step of the sector loop.
5B9B
GOSUB to 5BA6H to read the sectors of the cylinder into 6600H, one after the other, and sum them.
5B9E
GOSUB to 5B57H to test whether the cylinder is copied: the Z FLAG when it is not.
5BA1
RET Z C8
If the Z FLAG is set (not copied), RETurn with the Z FLAG: there is no sum to compare.
5BA2
GOSUB to 6130H to compare the sum with the source's: the NZ FLAG and one error more when it differs.
5BA5
RET C9
RETurn to the caller with the flags of the comparison of the sums.
5BA6
EXX D9
Exchange the register pairs with the alternate set (EXX): the alternate Register Pair BC holds the sum.
5BA7
LD BC,0000H 01 00 00
Load Register Pair BC (the alternate set) with 0000H, the sum of the cylinder.
5BAA
EXX D9
Exchange the register pairs back with the alternate set (EXX).
5BAB
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
5BAE
LD D,A 57
Copy Register A (the cylinder) into Register D for the sector calls.
5BAF
ADD A,60H C6 60
ADD 60H to Register A: the place of the cylinder's byte in the lock out table.
5BB1
LD L,A 6F
Copy Register A (the place of the lock out byte) into Register L.
5BB2
LD H,65H 26 65
Load Register H with 65H: Register Pair HL = the cylinder's lock out byte in the allocation table at 6500H.
5BB4
LD A,(HL) 7E
Fetch the cylinder's lock out byte at Register Pair HL into Register A.
5BB5
INC A 3C
INCrement Register A: the Z FLAG is set for FFH, a cylinder that is not on the disk.
5BB6
RET Z C8
If the Z FLAG is set (the cylinder is locked out), RETurn with the Z FLAG.
5BB7
LD A,D 7A
Copy Register D (the cylinder) into Register A for the display.
5BB8
GOSUB to 5CD2H to make the two digits of Register A in Register C and Register B.
5BBB
PUSH DE D5
Save Register Pair DE (Register D = the cylinder) to the stack.
5BBC
GOSUB to 5CDFH to write the two digits over the last two places of the text.
5BBF
POP DE D1
Restore Register Pair DE from the stack: Register D = the cylinder.
5BC0
XOR A AF
Clear Register A (XOR A) to 00H for the counters of the sector loop.
5BC1
LD (5BD8H),A 32 D8 5B
Store Register A (00H) at 5BD8H, the operand of LD A,00H at 5BD7H: the count of the sectors done.
5BC4
LD (5BCFH),A 32 CF 5B
Store Register A (00H) at 5BCFH, the operand of ADD A,00H at 5BCEH: side 0, no sectors to add.
5BC7
GOSUB to 60F1H to point Register Pair HL and its alternate at the buffer of the step and clear the sum.
5BCA
LD BC,0000H 01 00 00
Point Register Pair BC to the order of the sectors: 5AADH stores it in this operand at 5BCBH (0000H in the file). 5BEDH comes back here.
5BCD
LD A,(BC) 0A
Fetch the next sector number of the order at Register Pair BC into Register A. 5BE7H loops back here.
5BCE
ADD A,00H C6 00
ADD the sectors of side 0 to Register A: 5BE9H stores them in this operand at 5BCFH for side 1.
5BD0
LD E,A 5F
Copy Register A (the sector of the cylinder) into Register E.
5BD1
GOSUB to 5BF3H to read, verify or write sector Register E of cylinder Register D at Register Pair HL.
5BD4
If the NZ FLAG is set (an error), JUMP to 5BEFH to count it and end the cylinder.
5BD6
INC BC 03
INCrement Register Pair BC to the next number of the order.
5BD7
LD A,00H 3E 00
Load Register A with the count of the sectors done: 5BC1H and 5BDAH store it in this operand at 5BD8H (00H in the file).
5BD9
INC A 3C
INCrement Register A: one sector more is done.
5BDA
LD (5BD8H),A 32 D8 5B
Store Register A (the count) at 5BD8H, the operand of LD A,00H at 5BD7H.
5BDD
LD E,A 5F
Copy Register A (the count) into Register E for the comparisons.
5BDE
LD A,(5CF1H) 3A F1 5C
Fetch the sectors of the cylinder from 5CF1H into Register A.
5BE1
CP E BB
Compare Register A against Register E (the count): the Z FLAG when the whole cylinder is done.
5BE2
RET Z C8
If the Z FLAG is set (the cylinder is done), RETurn with the Z FLAG.
5BE3
LD A,(5CF2H) 3A F2 5C
Fetch the sectors of a track from 5CF2H into Register A.
5BE6
CP E BB
Compare Register A against Register E (the count): the Z FLAG when side 0 is done.
5BE7
If the NZ FLAG is set (more sectors on this side), JUMP back to 5BCDH.
5BE9
LD (5BCFH),A 32 CF 5B
Store Register A (the sectors of a track) at 5BCFH, the operand of ADD A,00H at 5BCEH: the sectors of side 1 follow those of side 0.
5BEC
INC BC 03
INCrement Register Pair BC; 5BCAH loads Register Pair BC again, so the value is not used.
5BED
JUMP back to 5BCAH to take the order of the sectors again for side 1.
5BEF
GOSUB to 5CCAH to count the error at 5696H; Register A = the new count, the NZ FLAG.
5BF2
RET C9
RETurn with the NZ FLAG: the rest of the cylinder is not done.
5BF3
LD A,(5695H) 3A 95 56
Fetch the step of the sector loop from 5695H into Register A: 00H write, 01H verify, FFH read.
5BF6
OR A B7
OR Register A with itself to set the Z FLAG for the write.
5BF7
If the Z FLAG is set (the write), JUMP to 5C06H.
5BF9
GOSUB to 5CB2H, function 09H, to read sector Register E of cylinder Register D into the buffer at Register Pair HL.
5BFC
If the Z FLAG is set (no error), JUMP to 5C01H to add the sector to the sum.
5BFE
CP 06H FE 06
Compare Register A (the error) against 06H, the deleted data mark of a directory sector, which is not an error here.
5C00
RET NZ C0
If the NZ FLAG is set (a real error), RETurn with the NZ FLAG.
5C01
GOSUB to 6105H to add the sector at the alternate Register Pair HL to the sum and step to the next page for the read.
5C04
XOR A AF
Clear Register A (XOR A) to 00H and set the Z FLAG: the sector is good.
5C05
RET C9
RETurn to the caller with the Z FLAG: the sector was read without error.
5C06
LD A,(IY+09H) FD 7E 09
Fetch byte +09H of the drive code table at Index Register IY into Register A, the directory cylinder.
5C09
CP D BA
Compare Register A against Register D (the cylinder): the Z FLAG on the directory cylinder.
5C0A
If the NZ FLAG is set (another cylinder), JUMP to 5C11H for the normal data mark.
5C0C
GOSUB to 5CADH, function 0EH, to write sector Register E at Register Pair HL with the deleted data mark of the directory.
5C0F
JUMP to 5C14H, past the normal write, with the result of the write.
5C11
GOSUB to 5CA8H, function 0DH, to write sector Register E of cylinder Register D from Register Pair HL.
5C14
PUSH AF F5
Save Register Pair AF (the result of the write) to the stack.
5C15
INC H 24
INCrement Register H: Register Pair HL = the next page of the cylinder buffer.
5C16
POP AF F1
Restore Register Pair AF from the stack: the result of the write.
5C17
RET C9
RETurn with the flags of the write: the NZ FLAG for an error.

5C18H - The End of QFB

5C18H and 5C1BH display an error with @LOGOT, then Program aborted! and, when disks were made, their count. 5C37H puts the RST 38H vector back (and EI), turns the cursor on, puts the eight drive code tables back as they were at the start (each keeps the cylinder its head is on), asks for the system disk and ends through @EXIT. The note that the clock is no longer right is shown every time.

5C18
LD HL,608FH 21 8F 60
Point Register Pair HL to 608FH, the text Cannot duplicate disk with protected files., ended by 0DH.
5C1B
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL and write it to the job log; 6201H puts 447BH here on the Model I.
5C1E
LD HL,607DH 21 7D 60
Point Register Pair HL to 607DH, the text Program aborted!, ended by 0DH. 55E0H comes here.
5C21
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL (607DH); 6201H puts 447BH here on the Model I.
5C24
LD DE,(5692H) ED 5B 92 56
Fetch the count of the disks made from 5692H into Register Pair DE.
5C28
LD A,D 7A
Copy Register D (the high byte of the count) into Register A.
5C29
OR E B3
OR Register E into Register A: the Z FLAG is set when the count in Register Pair DE is 0000H.
5C2A
If the Z FLAG is set (no disk made), JUMP to 5C37H.
5C2C
LD HL,596FH 21 6F 59
Point Register Pair HL to 596FH, the places of the count in the text of the disks made.
5C2F
PUSH HL E5
Save Register Pair HL (596FH) to the stack across 616CH.
5C30
GOSUB to 616CH to write Register Pair DE in decimal at Register Pair HL (596FH).
5C33
POP HL E1
Restore Register Pair HL from the stack: 596FH.
5C34
GOSUB to 428AH, @LOGOT, to display the count and disk created from Register Pair HL (596FH); 6201H puts 447BH here on the Model I.
5C37
GOSUB to 5C3DH to put the system back. The errors, BREAK at the questions and the prompts come here.
5C3A
JUMP to 402DH, @EXIT: QFB ends and LDOS Ready comes back.
5C3D
LD A,00H 3E 00
Load Register A with the byte of the RST 38H vector at the start: 6238H stores (4012H) in this operand at 5C3EH.
5C3F
OR A B7
OR Register A with itself to set the Z FLAG when the byte is 00H.
5C40
If the Z FLAG is set (00H), JUMP to 5C46H without changing the vector.
5C42
LD (4012H),A 32 12 40
Store Register A (the old byte) at 4012H: the RST 38H interrupt works again.
5C45
EI FB
Enable interrupts: the clock and the other tasks run again.
5C46
LD A,0EH 3E 0E
Load Register A with 0EH, the control code that turns the cursor on.
5C48
GOSUB to 0033H, the ROM's display of the character in Register A (0EH).
5C4B
LD HL,569CH 21 9C 56
Point Register Pair HL to 569CH, the copy of the drive code tables made by 6201H.
5C4E
LD DE,(568DH) ED 5B 8D 56
Fetch DCT$ from 568DH into Register Pair DE: the first drive code table.
5C52
LD B,08H 06 08
Load Register B with 08H, the eight drive code tables.
5C54
PUSH DE D5
Save Register Pair DE (the next drive code table) to the stack. 5C64H loops back here.
5C55
POP IY FD E1
Restore Index Register IY from the stack: Index Register IY = the drive code table.
5C57
LD A,(IY+05H) FD 7E 05
Fetch byte +05H of the drive code table at Index Register IY into Register A, the cylinder its head is on now.
5C5A
PUSH BC C5
Save Register Pair BC (Register B = the tables left) to the stack.
5C5B
LD BC,000AH 01 0A 00
Load Register Pair BC with 000AH, the ten bytes of a drive code table.
5C5E
LDIR ED B0
Copy the table from Register Pair HL (the copy) to Register Pair DE (DCT$), Register Pair BC counting (LDIR).
5C60
POP BC C1
Restore Register Pair BC from the stack: Register B = the tables left.
5C61
LD (IY+05H),A FD 77 05
Store Register A (the cylinder its head is on) at byte +05H of the drive code table at Index Register IY.
5C64
DECrement Register B and loop back to 5C54H until the eight tables are put back.
5C66
LD HL,5FB4H 21 B4 5F
Point Register Pair HL to 5FB4H, a new line and Load SYSTEM diskette and press <ENTER>, ended by 0DH.
5C69
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5FB4H) on the video.
5C6C
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A. 5C71H loops back here.
5C6F
CP 0DH FE 0D
Compare Register A (the key) against 0DH, the ENTER key; BREAK does not end the wait.
5C71
If the NZ FLAG is set (not ENTER), JUMP back to 5C6CH to wait for the next key.
5C73
LD HL,5FDCH 21 DC 5F
Point Register Pair HL to 5FDCH, a new line and Note: Realtime clock no longer accurate, ended by 0DH.
5C76
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5FDCH) on the video.
5C79
RET C9
RETurn to 5C3AH, which ends QFB through @EXIT.

5C7AH - The Calls of the Disk Driver

Each entry loads Register B with a function of the driver and goes through 5CBCH: interrupts off, Register C the drive number (5CBEH), CALL 5CC8H, JP (IY), which jumps to the driver through byte +00H of the drive code table; Register Pair HL, Register Pair DE and Register Pair BC come back as they were. The functions of the Model III's floppy driver: 00H nothing, 01H select, 04H restore, 05H step in, 06H seek, 07H wait until not busy, 09H read, 0AH verify, 0CH and 0DH write, 0EH write with the deleted data mark, 0FH Write Track. 5CCAH counts an error, 5CD2H and 5CDFH show a cylinder as two digits.

5C7A
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C7B
LD B,00H 06 00
Load Register B with 00H, function 00H of the driver: nothing is done, Register A = 00H.
5C7D
JUMP to 5CBDH, past the DI, to call the driver.
5C7F
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C80
LD B,01H 06 01
Load Register B with 01H, function 01H of the driver: select the drive, its side and density.
5C82
JUMP to 5CBCH to call the driver with the interrupts off.
5C84
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C85
LD B,04H 06 04
Load Register B with 04H, function 04H of the driver: restore the head to cylinder 0.
5C87
JUMP to 5CBCH to call the driver with the interrupts off.
5C89
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C8A
LD BC,0064H 01 64 00
Load Register Pair BC with 0064H, the count of the ROM's delay before the step.
5C8D
GOSUB to 0060H, the ROM's delay, which counts Register Pair BC down to 0.
5C90
LD B,05H 06 05
Load Register B with 05H, function 05H of the driver: step the head in by one cylinder.
5C92
JUMP to 5CBCH to call the driver with the interrupts off.
5C94
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C95
LD B,06H 06 06
Load Register B with 06H, function 06H of the driver: seek cylinder Register D for sector Register E.
5C97
JUMP to 5CBCH to call the driver with the interrupts off.
5C99
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C9A
LD B,07H 06 07
Load Register B with 07H, function 07H of the driver: wait until the controller is not busy, the status in Register A.
5C9C
JUMP to 5CBCH to call the driver with the interrupts off.
5C9E
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5C9F
LD B,0FH 06 0F
Load Register B with 0FH, function 0FH of the driver: Write Track from the buffer at Register Pair HL.
5CA1
JUMP to 5CBCH to call the driver with the interrupts off.
5CA3
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back. No instruction of QFB calls 5CA3H.
5CA4
LD B,0CH 06 0C
Load Register B with 0CH, function 0CH of the driver: write a sector, the same as 0DH.
5CA6
JUMP to 5CBCH to call the driver with the interrupts off.
5CA8
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5CA9
LD B,0DH 06 0D
Load Register B with 0DH, function 0DH of the driver: write sector Register E of cylinder Register D from Register Pair HL.
5CAB
JUMP to 5CBCH to call the driver with the interrupts off.
5CAD
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5CAE
LD B,0EH 06 0E
Load Register B with 0EH, function 0EH of the driver: write a sector with the deleted data mark.
5CB0
JUMP to 5CBCH to call the driver with the interrupts off.
5CB2
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back.
5CB3
LD B,09H 06 09
Load Register B with 09H, function 09H of the driver: read sector Register E of cylinder Register D into Register Pair HL.
5CB5
JUMP to 5CBCH to call the driver with the interrupts off.
5CB7
PUSH BC C5
Save Register Pair BC to the stack; 5CC5H takes it back. No instruction of QFB calls 5CB7H.
5CB8
LD B,0AH 06 0A
Load Register B with 0AH, function 0AH of the driver: verify a sector without keeping its bytes.
5CBA
JUMP to 5CBCH, the next instruction, to call the driver.
5CBC
DI F3
Disable interrupts for the driver call; 5CC6H enables them again.
5CBD
LD C,00H 0E 00
Load Register C with the drive number: 54F6H and 60E1H store it in this operand at 5CBEH (00H in the file).
5CBF
LD A,20H 3E 20
Load Register A with 20H; the driver takes its function from Register B.
5CC1
OR A B7
OR Register A with itself: the NZ FLAG; the driver sets the flags itself.
5CC2
GOSUB to 5CC8H, which jumps to the driver; the driver's RET comes back here.
5CC5
POP BC C1
Restore Register Pair BC from the stack: the caller's value.
5CC6
EI FB
Enable interrupts again; the RST 38H vector is a RET during the copy, so the clock stays off.
5CC7
RET C9
RETurn to the caller with Register A and the flags of the driver.
5CC8
JP (IY) FD E9
JUMP to the address in Index Register IY, the drive code table, whose byte +00H is the JP to the driver.
5CCA
LD A,(5696H) 3A 96 56
Fetch the count of errors from 5696H into Register A.
5CCD
INC A 3C
INCrement Register A: one error more; the NZ FLAG.
5CCE
LD (5696H),A 32 96 56
Store Register A (the count of errors) at 5696H for 55C2H and 55EEH.
5CD1
RET C9
RETurn to the caller with the NZ FLAG: an error was counted.
5CD2
LD C,30H 0E 30
Load Register C with 30H, the digit 0 for the tens.
5CD4
SUB 0AH D6 0A
SUBtract 0AH from Register A: ten less. 5CD9H loops back here.
5CD6
If the CARRY FLAG is set (less than ten was left), JUMP to 5CDBH.
5CD8
INC C 0C
INCrement Register C, the tens digit, for each ten taken away.
5CD9
JUMP back to 5CD4H to take the next ten from Register A.
5CDB
ADD A,3AH C6 3A
ADD 3AH to Register A: the units (less ten) plus 30H plus ten, the units digit.
5CDD
LD B,A 47
Copy Register A (the units digit) into Register B.
5CDE
RET C9
RETurn with the tens digit in Register C and the units digit in Register B.
5CDF
LD A,08H 3E 08
Load Register A with 08H, the backspace, the first of two.
5CE1
GOSUB to 0033H, the ROM's display of the character in Register A (08H): the cursor goes back one place.
5CE4
LD A,08H 3E 08
Load Register A with 08H, the backspace, the second of two.
5CE6
GOSUB to 0033H, the ROM's display of the character in Register A (08H): the cursor goes back to the first of the two places.
5CE9
LD A,C 79
Copy Register C (the tens digit) into Register A.
5CEA
GOSUB to 0033H, the ROM's display of the character in Register A, the tens digit.
5CED
LD A,B 78
Copy Register B (the units digit) into Register A.
5CEE
JUMP to 0033H, the ROM's display of the character in Register A, the units digit; it returns to the caller.
5CF1
DEFS 1
5CF1H: not in the file. The sectors of a cylinder (both sides), from 5517H and 5A47H; the loop 5BA6H ends after them.
5CF2
DEFS 1
5CF2H: not in the file. The sectors of a track, from 550DH and 5A3CH: the repeat F1H and the change of side.

5CF3H - The Format Table: 5 Inch Single Density

10 sectors a track, the sector numbers two apart on the track (5538H): the count of the sectors, the step from cylinder to cylinder, the sector numbers as they follow one another on the track, the wrap bytes, the program of the track and, after F4H, the order in which the sectors are read and written.

5CF3
DEFB 0AH 0A
5CF3H: 0AH, 10 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5CF4
DEFB 08H 08
5CF4H: 08H, the step: the next cylinder starts 8 sector numbers further on in the list (5B4BH).
5CF5-5CFE
DEFB 00H, 05H, 01H, 06H, 02H, 07H, 03H, 08H, 04H, 09H 00 05 01 06 02 07 03 08 04 09
5CF5H-5CFEH: the 10 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5CFF-5D07
DEFB F6H x 9 F6 x 9
5CFFH-5D07H: 9 wrap bytes F6H, minus 10: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5D08-5D09
DEFB 0EH, FFH 0E FF
5D08H-5D09H: 14 bytes FFH, the gap after the index pulse.
5D0A
DEFB F1H F1
5D0AH: F1H, the start of the part built once for each of the 10 sectors (5A94H).
5D0B-5D0C
DEFB 06H, 00H 06 00
5D0BH-5D0CH: 6 bytes 00H, the sync field before the identification address mark.
5D0D-5D0E
DEFB 01H, FEH 01 FE
5D0DH-5D0EH: FEH, the identification address mark of the sector.
5D0F
DEFB F3H F3
5D0FH: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5D10-5D11
DEFB 03H, 00H 03 00
5D10H-5D11H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5D12-5D13
DEFB 01H, 01H 01 01
5D12H-5D13H: 01H, the length code of the sector: 256 bytes.
5D14-5D15
DEFB 01H, F7H 01 F7
5D14H-5D15H: F7H: the controller writes the two CRC bytes of the identification.
5D16-5D17
DEFB 01H, FFH 01 FF
5D16H-5D17H: 1 byte FFH, the gap between the identification and the data field.
5D18-5D19
DEFB 0BH, FFH 0B FF
5D18H-5D19H: 11 bytes FFH, the gap between the identification and the data field.
5D1A-5D1B
DEFB 06H, 00H 06 00
5D1AH-5D1BH: 6 bytes 00H, the sync field before the data address mark.
5D1C-5D1D
DEFB 01H, FBH 01 FB
5D1CH-5D1DH: FBH, the data address mark that starts the data field of the sector.
5D1E-5D1F
DEFB 00H, E5H 00 E5
5D1EH-5D1FH: 256 bytes E5H, the data field of a single density sector.
5D20-5D21
DEFB 01H, F7H 01 F7
5D20H-5D21H: F7H: the controller writes the two CRC bytes of the data field.
5D22-5D23
DEFB 01H, FFH 01 FF
5D22H-5D23H: 1 byte FFH, the gap after the sector.
5D24-5D25
DEFB 0DH, FFH 0D FF
5D24H-5D25H: 13 bytes FFH, the gap after the sector.
5D26
DEFB F2H F2
5D26H: F2H, the end of the part built for each sector (5A9BH).
5D27-5D28
DEFB 47H, FFH 47 FF
5D27H-5D28H: 71 bytes FFH, the gap to the end of the track.
5D29
DEFB F4H F4
5D29H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5D2A-5D33
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H 00 01 02 03 04 05 06 07 08 09
5D2AH-5D33H: the order of the 10 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 10 added.

5D34H - The Format Table: 5 Inch Double Density

18 sectors a track, the sector numbers three apart (5556H): the count of the sectors, the step from cylinder to cylinder, the sector numbers as they follow one another on the track, the wrap bytes, the program of the track and, after F4H, the order in which the sectors are read and written.

5D34
DEFB 12H 12
5D34H: 12H, 18 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5D35
DEFB 0FH 0F
5D35H: 0FH, the step: the next cylinder starts 15 sector numbers further on in the list (5B4BH).
5D36-5D47
DEFB 00H, 06H, 0CH, 01H, 07H, 0DH, 02H, 08H, 0EH, 03H, 09H, 0FH, 04H, 0AH, 10H, 05H, 0BH, 11H 00 06 0C 01 07 0D 02 08 0E 03 09 0F 04 0A 10 05 0B 11
5D36H-5D47H: the 18 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5D48-5D57
DEFB EEH x 16 EE x 16
5D48H-5D57H: 16 wrap bytes EEH, minus 18: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5D58-5D59
DEFB 20H, 4EH 20 4E
5D58H-5D59H: 32 bytes 4EH, the gap after the index pulse.
5D5A
DEFB F1H F1
5D5AH: F1H, the start of the part built once for each of the 18 sectors (5A94H).
5D5B-5D5C
DEFB 0CH, 00H 0C 00
5D5BH-5D5CH: 12 bytes 00H, the sync field before the identification address mark.
5D5D-5D5E
DEFB 03H, F5H 03 F5
5D5DH-5D5EH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5D5F-5D60
DEFB 01H, FEH 01 FE
5D5FH-5D60H: FEH, the identification address mark of the sector.
5D61
DEFB F3H F3
5D61H: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5D62-5D63
DEFB 03H, 00H 03 00
5D62H-5D63H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5D64-5D65
DEFB 01H, 01H 01 01
5D64H-5D65H: 01H, the length code of the sector: 256 bytes.
5D66-5D67
DEFB 01H, F7H 01 F7
5D66H-5D67H: F7H: the controller writes the two CRC bytes of the identification.
5D68-5D69
DEFB 16H, 4EH 16 4E
5D68H-5D69H: 22 bytes 4EH, the gap between the identification and the data field.
5D6A-5D6B
DEFB 0CH, 00H 0C 00
5D6AH-5D6BH: 12 bytes 00H, the sync field before the data address mark.
5D6C-5D6D
DEFB 03H, F5H 03 F5
5D6CH-5D6DH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5D6E-5D6F
DEFB 01H, FBH 01 FB
5D6EH-5D6FH: FBH, the data address mark that starts the data field of the sector.
5D70-5D73
DEFB F5H, 80H, 6DH, B6H F5 80 6D B6
5D70H-5D73H: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5D74-5D75
DEFB 01H, F7H 01 F7
5D74H-5D75H: F7H: the controller writes the two CRC bytes of the data field.
5D76-5D77
DEFB 01H, 4EH 01 4E
5D76H-5D77H: 1 byte 4EH, the gap after the sector.
5D78-5D79
DEFB 17H, 4EH 17 4E
5D78H-5D79H: 23 bytes 4EH, the gap after the sector.
5D7A
DEFB F2H F2
5D7AH: F2H, the end of the part built for each sector (5A9BH).
5D7B-5D7C
DEFB B6H, 4EH B6 4E
5D7BH-5D7CH: 182 bytes 4EH, the gap to the end of the track.
5D7D
DEFB F4H F4
5D7DH: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5D7E-5D8F
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11
5D7EH-5D8FH: the order of the 18 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 18 added.

5D90H - The Format Table: 8 Inch Single Density

16 sectors a track (553FH): the count of the sectors, the step from cylinder to cylinder, the sector numbers as they follow one another on the track, the wrap bytes, the program of the track and, after F4H, the order in which the sectors are read and written.

5D90
DEFB 10H 10
5D90H: 10H, 16 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5D91
DEFB 02H 02
5D91H: 02H, the step: the next cylinder starts 2 sector numbers further on in the list (5B4BH).
5D92-5DA1
DEFB 0AH, 05H, 00H, 0BH, 06H, 01H, 0CH, 07H, 02H, 0DH, 08H, 03H, 0EH, 09H, 04H, 0FH 0A 05 00 0B 06 01 0C 07 02 0D 08 03 0E 09 04 0F
5D92H-5DA1H: the 16 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5DA2-5DA4
DEFB F0H x 3 F0 x 3
5DA2H-5DA4H: 3 wrap bytes F0H, minus 16: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5DA5-5DA6
DEFB 28H, FFH 28 FF
5DA5H-5DA6H: 40 bytes FFH, the gap after the index pulse.
5DA7
DEFB F1H F1
5DA7H: F1H, the start of the part built once for each of the 16 sectors (5A94H).
5DA8-5DA9
DEFB 06H, 00H 06 00
5DA8H-5DA9H: 6 bytes 00H, the sync field before the identification address mark.
5DAA-5DAB
DEFB 01H, FEH 01 FE
5DAAH-5DABH: FEH, the identification address mark of the sector.
5DAC
DEFB F3H F3
5DACH: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5DAD-5DAE
DEFB 03H, 00H 03 00
5DADH-5DAEH: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5DAF-5DB0
DEFB 01H, 01H 01 01
5DAFH-5DB0H: 01H, the length code of the sector: 256 bytes.
5DB1-5DB2
DEFB 01H, F7H 01 F7
5DB1H-5DB2H: F7H: the controller writes the two CRC bytes of the identification.
5DB3-5DB4
DEFB 0BH, FFH 0B FF
5DB3H-5DB4H: 11 bytes FFH, the gap between the identification and the data field.
5DB5-5DB6
DEFB 06H, 00H 06 00
5DB5H-5DB6H: 6 bytes 00H, the sync field before the data address mark.
5DB7-5DB8
DEFB 01H, FBH 01 FB
5DB7H-5DB8H: FBH, the data address mark that starts the data field of the sector.
5DB9-5DBA
DEFB 00H, E5H 00 E5
5DB9H-5DBAH: 256 bytes E5H, the data field of a single density sector.
5DBB-5DBC
DEFB 01H, F7H 01 F7
5DBBH-5DBCH: F7H: the controller writes the two CRC bytes of the data field.
5DBD-5DBE
DEFB 01H, FFH 01 FF
5DBDH-5DBEH: 1 byte FFH, the gap after the sector.
5DBF-5DC0
DEFB 14H, FFH 14 FF
5DBFH-5DC0H: 20 bytes FFH, the gap after the sector.
5DC1
DEFB F2H F2
5DC1H: F2H, the end of the part built for each sector (5A9BH).
5DC2-5DC3
DEFB D0H, FFH D0 FF
5DC2H-5DC3H: 208 bytes FFH, the gap to the end of the track.
5DC4
DEFB F4H F4
5DC4H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5DC5-5DD4
DEFB 0AH, 00H, 06H, 0CH, 02H, 08H, 0EH, 04H, 05H, 0BH, 01H, 07H, 0DH, 03H, 09H, 0FH 0A 00 06 0C 02 08 0E 04 05 0B 01 07 0D 03 09 0F
5DC5H-5DD4H: the order of the 16 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 16 added.

5DD5H - The Format Table: 8 Inch Double Density

30 sectors a track, the sector numbers five apart (5546H): the count of the sectors, the step from cylinder to cylinder, the sector numbers as they follow one another on the track, the wrap bytes, the program of the track and, after F4H, the order in which the sectors are read and written.

5DD5
DEFB 1EH 1E
5DD5H: 1EH, 30 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5DD6
DEFB 14H 14
5DD6H: 14H, the step: the next cylinder starts 20 sector numbers further on in the list (5B4BH).
5DD7-5DF4
DEFB 00H, 06H, 0CH, 12H, 18H, 01H, 07H, 0DH, 13H, 19H, 02H, 08H, 0EH, 14H, 1AH, 03H, 09H, 0FH, 15H, 1BH, 04H, 0AH, 10H, 16H, 1CH, 05H, 0BH, 11H, 17H, 1DH 00 06 0C 12 18 01 07 0D 13 19 02 08 0E 14 1A 03 09 0F 15 1B 04 0A 10 16 1C 05 0B 11 17 1D
5DD7H-5DF4H: the 30 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5DF5-5E09
DEFB E2H x 21 E2 x 21
5DF5H-5E09H: 21 wrap bytes E2H, minus 30: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5E0A-5E0B
DEFB 14H, 4EH 14 4E
5E0AH-5E0BH: 20 bytes 4EH, the gap after the index pulse.
5E0C
DEFB F1H F1
5E0CH: F1H, the start of the part built once for each of the 30 sectors (5A94H).
5E0D-5E0E
DEFB 0CH, 00H 0C 00
5E0DH-5E0EH: 12 bytes 00H, the sync field before the identification address mark.
5E0F-5E10
DEFB 03H, F5H 03 F5
5E0FH-5E10H: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E11-5E12
DEFB 01H, FEH 01 FE
5E11H-5E12H: FEH, the identification address mark of the sector.
5E13
DEFB F3H F3
5E13H: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5E14-5E15
DEFB 03H, 00H 03 00
5E14H-5E15H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5E16-5E17
DEFB 01H, 01H 01 01
5E16H-5E17H: 01H, the length code of the sector: 256 bytes.
5E18-5E19
DEFB 01H, F7H 01 F7
5E18H-5E19H: F7H: the controller writes the two CRC bytes of the identification.
5E1A-5E1B
DEFB 16H, 4EH 16 4E
5E1AH-5E1BH: 22 bytes 4EH, the gap between the identification and the data field.
5E1C-5E1D
DEFB 0CH, 00H 0C 00
5E1CH-5E1DH: 12 bytes 00H, the sync field before the data address mark.
5E1E-5E1F
DEFB 03H, F5H 03 F5
5E1EH-5E1FH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E20-5E21
DEFB 01H, FBH 01 FB
5E20H-5E21H: FBH, the data address mark that starts the data field of the sector.
5E22-5E25
DEFB F5H, 80H, 6DH, B6H F5 80 6D B6
5E22H-5E25H: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5E26-5E27
DEFB 01H, F7H 01 F7
5E26H-5E27H: F7H: the controller writes the two CRC bytes of the data field.
5E28-5E29
DEFB 01H, FFH 01 FF
5E28H-5E29H: 1 byte FFH, the gap after the sector.
5E2A-5E2B
DEFB 11H, 4EH 11 4E
5E2AH-5E2BH: 17 bytes 4EH, the gap after the sector.
5E2C
DEFB F2H F2
5E2CH: F2H, the end of the part built for each sector (5A9BH).
5E2D-5E2E
DEFB 00H, 4EH 00 4E
5E2DH-5E2EH: 256 bytes 4EH, the gap to the end of the track.
5E2F-5E30
DEFB 3DH, 4EH 3D 4E
5E2FH-5E30H: 61 bytes 4EH, the gap to the end of the track.
5E31
DEFB F4H F4
5E31H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5E32-5E4F
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H, 12H, 13H, 14H, 15H, 16H, 17H, 18H, 19H, 1AH, 1BH, 1CH, 1DH 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D
5E32H-5E4FH: the order of the 30 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 30 added.
5E50-5E54
DEFB 00H x 5 00 x 5
5E50H-5E54H: 5 bytes 00H after the order of the sectors; no instruction reads them.

5E55H - The Format Table: 5 Inch Double Density with FAST

18 sectors a track, the sector numbers two apart, for the faster processor (555DH): the count of the sectors, the step from cylinder to cylinder, the sector numbers as they follow one another on the track, the wrap bytes, the program of the track and, after F4H, the order in which the sectors are read and written.

5E55
DEFB 12H 12
5E55H: 12H, 18 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5E56
DEFB 0AH 0A
5E56H: 0AH, the step: the next cylinder starts 10 sector numbers further on in the list (5B4BH).
5E57-5E68
DEFB 00H, 09H, 01H, 0AH, 02H, 0BH, 03H, 0CH, 04H, 0DH, 05H, 0EH, 06H, 0FH, 07H, 10H, 08H, 11H 00 09 01 0A 02 0B 03 0C 04 0D 05 0E 06 0F 07 10 08 11
5E57H-5E68H: the 18 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5E69-5E73
DEFB EEH x 11 EE x 11
5E69H-5E73H: 11 wrap bytes EEH, minus 18: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5E74-5E75
DEFB 20H, 4EH 20 4E
5E74H-5E75H: 32 bytes 4EH, the gap after the index pulse.
5E76
DEFB F1H F1
5E76H: F1H, the start of the part built once for each of the 18 sectors (5A94H).
5E77-5E78
DEFB 0CH, 00H 0C 00
5E77H-5E78H: 12 bytes 00H, the sync field before the identification address mark.
5E79-5E7A
DEFB 03H, F5H 03 F5
5E79H-5E7AH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E7B-5E7C
DEFB 01H, FEH 01 FE
5E7BH-5E7CH: FEH, the identification address mark of the sector.
5E7D
DEFB F3H F3
5E7DH: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5E7E-5E7F
DEFB 03H, 00H 03 00
5E7EH-5E7FH: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5E80-5E81
DEFB 01H, 01H 01 01
5E80H-5E81H: 01H, the length code of the sector: 256 bytes.
5E82-5E83
DEFB 01H, F7H 01 F7
5E82H-5E83H: F7H: the controller writes the two CRC bytes of the identification.
5E84-5E85
DEFB 16H, 4EH 16 4E
5E84H-5E85H: 22 bytes 4EH, the gap between the identification and the data field.
5E86-5E87
DEFB 0CH, 00H 0C 00
5E86H-5E87H: 12 bytes 00H, the sync field before the data address mark.
5E88-5E89
DEFB 03H, F5H 03 F5
5E88H-5E89H: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5E8A-5E8B
DEFB 01H, FBH 01 FB
5E8AH-5E8BH: FBH, the data address mark that starts the data field of the sector.
5E8C-5E8F
DEFB F5H, 80H, 6DH, B6H F5 80 6D B6
5E8CH-5E8FH: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5E90-5E91
DEFB 01H, F7H 01 F7
5E90H-5E91H: F7H: the controller writes the two CRC bytes of the data field.
5E92-5E93
DEFB 01H, 4EH 01 4E
5E92H-5E93H: 1 byte 4EH, the gap after the sector.
5E94-5E95
DEFB 17H, 4EH 17 4E
5E94H-5E95H: 23 bytes 4EH, the gap after the sector.
5E96
DEFB F2H F2
5E96H: F2H, the end of the part built for each sector (5A9BH).
5E97-5E98
DEFB B6H, 4EH B6 4E
5E97H-5E98H: 182 bytes 4EH, the gap to the end of the track.
5E99
DEFB F4H F4
5E99H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5E9A-5EAB
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11
5E9AH-5EABH: the order of the 18 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 18 added.

5EACH - The Format Table: 8 Inch Double Density with FAST

30 sectors a track, the sector numbers three apart (554DH): the count of the sectors, the step from cylinder to cylinder, the sector numbers as they follow one another on the track, the wrap bytes, the program of the track and, after F4H, the order in which the sectors are read and written.

5EAC
DEFB 1EH 1E
5EACH: 1EH, 30 sectors a track: 5A3CH stores it at 5CF2H, the count of the repeat and of a side.
5EAD
DEFB 0CH 0C
5EADH: 0CH, the step: the next cylinder starts 12 sector numbers further on in the list (5B4BH).
5EAE-5ECB
DEFB 00H, 0AH, 14H, 01H, 0BH, 15H, 02H, 0CH, 16H, 03H, 0DH, 17H, 04H, 0EH, 18H, 05H, 0FH, 19H, 06H, 10H, 1AH, 07H, 11H, 1BH, 08H, 12H, 1CH, 09H, 13H, 1DH 00 0A 14 01 0B 15 02 0C 16 03 0D 17 04 0E 18 05 0F 19 06 10 1A 07 11 1B 08 12 1C 09 13 1D
5EAEH-5ECBH: the 30 sector numbers in their order on the track; 5AEEH takes one for each sector and goes on from there on the next side and cylinder.
5ECC-5ED8
DEFB E2H x 13 E2 x 13
5ECCH-5ED8H: 13 wrap bytes E2H, minus 30: a pointer that reaches one moves back by the sectors of a track (5AF3H).
5ED9-5EDA
DEFB 14H, 4EH 14 4E
5ED9H-5EDAH: 20 bytes 4EH, the gap after the index pulse.
5EDB
DEFB F1H F1
5EDBH: F1H, the start of the part built once for each of the 30 sectors (5A94H).
5EDC-5EDD
DEFB 0CH, 00H 0C 00
5EDCH-5EDDH: 12 bytes 00H, the sync field before the identification address mark.
5EDE-5EDF
DEFB 03H, F5H 03 F5
5EDEH-5EDFH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5EE0-5EE1
DEFB 01H, FEH 01 FE
5EE0H-5EE1H: FEH, the identification address mark of the sector.
5EE2
DEFB F3H F3
5EE2H: F3H, the place of the identification bytes of the sector goes into the list at 6600H (5AA5H).
5EE3-5EE4
DEFB 03H, 00H 03 00
5EE3H-5EE4H: three bytes 00H, the places of the cylinder, side and sector numbers that 5AD3H fills in.
5EE5-5EE6
DEFB 01H, 01H 01 01
5EE5H-5EE6H: 01H, the length code of the sector: 256 bytes.
5EE7-5EE8
DEFB 01H, F7H 01 F7
5EE7H-5EE8H: F7H: the controller writes the two CRC bytes of the identification.
5EE9-5EEA
DEFB 16H, 4EH 16 4E
5EE9H-5EEAH: 22 bytes 4EH, the gap between the identification and the data field.
5EEB-5EEC
DEFB 0CH, 00H 0C 00
5EEBH-5EECH: 12 bytes 00H, the sync field before the data address mark.
5EED-5EEE
DEFB 03H, F5H 03 F5
5EEDH-5EEEH: 3 bytes F5H: the controller writes A1H, the sync marks of double density, before the address mark.
5EEF-5EF0
DEFB 01H, FBH 01 FB
5EEFH-5EF0H: FBH, the data address mark that starts the data field of the sector.
5EF1-5EF4
DEFB F5H, 80H, 6DH, B6H F5 80 6D B6
5EF1H-5EF4H: F5H, 128 pairs 6DH B6H: the 256 bytes of the data field, the fill of a double density sector.
5EF5-5EF6
DEFB 01H, F7H 01 F7
5EF5H-5EF6H: F7H: the controller writes the two CRC bytes of the data field.
5EF7-5EF8
DEFB 01H, FFH 01 FF
5EF7H-5EF8H: 1 byte FFH, the gap after the sector.
5EF9-5EFA
DEFB 11H, 4EH 11 4E
5EF9H-5EFAH: 17 bytes 4EH, the gap after the sector.
5EFB
DEFB F2H F2
5EFBH: F2H, the end of the part built for each sector (5A9BH).
5EFC-5EFD
DEFB 00H, 4EH 00 4E
5EFCH-5EFDH: 256 bytes 4EH, the gap to the end of the track.
5EFE-5EFF
DEFB 3DH, 4EH 3D 4E
5EFEH-5EFFH: 61 bytes 4EH, the gap to the end of the track.
5F00
DEFB F4H F4
5F00H: F4H, the end of the track: 256 bytes FFH follow, the address after it goes to 5BCBH (5AADH).
5F01-5F1E
DEFB 00H, 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH, 10H, 11H, 12H, 13H, 14H, 15H, 16H, 17H, 18H, 19H, 1AH, 1BH, 1CH, 1DH 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D
5F01H-5F1EH: the order of the 30 sectors of a side for the read, the write and the verify (5BCDH); side 1 takes it again with 30 added.
5F1F-5F23
DEFB 00H x 5 00 x 5
5F1FH-5F23H: 5 bytes 00H after the order of the sectors; no instruction reads them.

5F24H - The Texts of the Copy

The texts of the steps start with 1DH, the cursor to the start of the line, so that each step writes over the last; they end with three spaces and 03H, and 5CDFH writes the cylinder over the last two spaces. The texts of the end follow.

5F24
DEFB 1DH 1D
5F24H: 1DH, the cursor to the start of the line, before the text of the format step (5ABDH).
5F25-5F3A
DEFM "Formatting cylinder " 46 6F 72 6D 61 74 74 69 6E 67 20 63 79 6C 69 6E 64 65 72 20 20 20
5F25H-5F3AH: the text of the format step; the cylinder is written over the last two spaces.
5F3B
DEFB 03H 03
5F3BH: 03H, the end of the text: the cursor stays after it.
5F3C
DEFB 1DH 1D
5F3CH: 1DH, the cursor to the start of the line, before the text of the verify step (5B90H).
5F3D-5F52
DEFM "Verifying cylinder " 56 65 72 69 66 79 69 6E 67 20 20 63 79 6C 69 6E 64 65 72 20 20 20
5F3DH-5F52H: the text of the verify step, padded to the length of the others.
5F53
DEFB 03H 03
5F53H: 03H, the end of the text: the cursor stays after it.
5F54
DEFB 1DH 1D
5F54H: 1DH, the cursor to the start of the line, before the text of the write step (5B73H).
5F55-5F6A
DEFM "Writing cylinder " 57 72 69 74 69 6E 67 20 20 20 20 63 79 6C 69 6E 64 65 72 20 20 20
5F55H-5F6AH: the text of the write step, padded to the length of the others.
5F6B
DEFB 03H 03
5F6BH: 03H, the end of the text: the cursor stays after it.
5F6C
DEFB 1DH 1D
5F6CH: 1DH, the cursor to the start of the line, before the text of the read step (5B81H).
5F6D-5F82
DEFM "Reading cylinder " 52 65 61 64 69 6E 67 20 20 20 20 63 79 6C 69 6E 64 65 72 20 20 20
5F6DH-5F82H: the text of the read step of the source, padded to the length of the others.
5F83
DEFB 03H 03
5F83H: 03H, the end of the text: the cursor stays after it.
5F84
DEFB 1DH 1D
5F84H: 1DH, the cursor to the start of the line, before the text of 53F6H.
5F85-5F9A
DEFM "Disk not ready " 44 69 73 6B 20 6E 6F 74 20 72 65 61 64 79 20 20 20 20 20 20 20 20
5F85H-5F9AH: the text of 53F6H when a destination gives no index pulses; Bad disk in drive follows.
5F9B
DEFB 03H 03
5F9BH: 03H, the end of the text: the cursor stays after it.
5F9C
DEFB 1DH 1D
5F9CH: 1DH, the cursor to the start of the line, before the text of 61E6H.
5F9D-5FB2
DEFM "BREAK pressed " 42 52 45 41 4B 20 70 72 65 73 73 65 64 20 20 20 20 20 20 20 20 20
5F9DH-5FB2H: the text of 61E6H for each destination when BREAK stops the copy.
5FB3
DEFB 03H 03
5FB3H: 03H, the end of the text: the cursor stays after it.
5FB4
DEFB 0AH 0A
5FB4H: 0AH, a new line before the prompt of 5C66H.
5FB5-5FDA
DEFM "Load SYSTEM diskette and press <ENTER>" 4C 6F 61 64 20 53 59 53 54 45 4D 20 64 69 73 6B 65 74 74 65 20 61 6E 64 20 70 72 65 73 73 20 3C 45 4E 54 45 52 3E
5FB5H-5FDAH: the prompt at the end of QFB: only ENTER goes on (5C6FH).
5FDB
DEFB 0DH 0D
5FDBH: 0DH, the end of the prompt Load SYSTEM diskette.
5FDC
DEFB 0AH 0A
5FDCH: 0AH, a new line before the note of 5C73H.
5FDD-6003
DEFM "Note: Realtime clock no longer accurate" 4E 6F 74 65 3A 20 52 65 61 6C 74 69 6D 65 20 63 6C 6F 63 6B 20 6E 6F 20 6C 6F 6E 67 65 72 20 61 63 63 75 72 61 74 65
5FDDH-6003H: the note at the end of QFB: the clock stopped while the RST 38H vector was a RET.
6004
DEFB 0DH 0D
6004H: 0DH, the end of the note Realtime clock no longer accurate.
6005
DEFB 0AH 0A
6005H: 0AH, a new line before the text of 6155H.
6006-6013
DEFM "MEMORY FAULT -" 4D 45 4D 4F 52 59 20 46 41 55 4C 54 20 2D
6006H-6013H: the text of 6155H when the two copies of a sum differ; Program aborted! follows.
6014
DEFB 03H 03
6014H: 03H, the end of the text: Program aborted! follows on the same line.
6015
DEFB 0AH 0A
6015H: 0AH, a new line before the text at 6016H, which no instruction points at.
6016-6028
DEFM "Source READ error -" 53 6F 75 72 63 65 20 52 45 41 44 20 65 72 72 6F 72 20 2D
6016H-6028H: a text that no instruction of QFB displays.
6029
DEFB 03H 03
6029H: 03H, the end of the text Source READ error -.
602A-6045
DEFM " =======> Source disk error" 20 20 3D 3D 3D 3D 3D 3D 3D 3E 20 53 6F 75 72 63 65 20 64 69 73 6B 20 65 72 72 6F 72
602AH-6045H: the text of 55D5H when the source cylinder could not be read twice.
6046-6047
DEFB 0AH, 0AH 0A 0A
6046H-6047H: two new lines before the question of the source error.
6048-607B
DEFM "Press <ENTER> to restart program or <BREAK> to exit." 50 72 65 73 73 20 3C 45 4E 54 45 52 3E 20 74 6F 20 72 65 73 74 61 72 74 20 70 72 6F 67 72 61 6D 20 6F 72 20 3C 42 52 45 41 4B 3E 20 74 6F 20 65 78 69 74 2E
6048H-607BH: the question of 55DBH: ENTER copies again from the start, BREAK ends.
607C
DEFB 0DH 0D
607CH: 0DH, the end of the text of 55D5H, the source error.
607D-608D
DEFM " Program aborted!" 20 50 72 6F 67 72 61 6D 20 61 62 6F 72 74 65 64 21
607DH-608DH: the text of 5C1EH after an error that ends QFB.
608E
DEFB 0DH 0D
608EH: 0DH, the end of the text Program aborted!.
608F-60B9
DEFM "Cannot duplicate disk with protected files." 43 61 6E 6E 6F 74 20 64 75 70 6C 69 63 61 74 65 20 64 69 73 6B 20 77 69 74 68 20 70 72 6F 74 65 63 74 65 64 20 66 69 6C 65 73 2E
608FH-60B9H: the text of 5C18H when bit 4 of byte CDH of the source's allocation table is set.
60BA
DEFB 0DH 0D
60BAH: 0DH, the end of the text Cannot duplicate disk with protected files..

60BBH - Two Hex Digits, Not Used

60BBH writes Register A as two hex digits at Register Pair HL and steps Register Pair HL past them; 60C4H writes the low digit alone. No instruction of QFB calls them.

60BB
PUSH AF F5
Save Register Pair AF (Register A = the byte) to the stack for the low digit.
60BC
RRA 1F
Rotate Register A right through the CARRY FLAG (RRA): the first of four steps of the high digit to bits 3-0.
60BD
RRA 1F
Rotate Register A right through the CARRY FLAG (RRA): the second step.
60BE
RRA 1F
Rotate Register A right through the CARRY FLAG (RRA): the third step.
60BF
RRA 1F
Rotate Register A right through the CARRY FLAG (RRA): the high digit is in bits 3-0 of Register A.
60C0
GOSUB to 60C4H to write the digit in bits 3-0 of Register A at Register Pair HL.
60C3
POP AF F1
Restore Register Pair AF from the stack: Register A = the byte again, for the low digit.
60C4
AND 0FH E6 0F
Mask Register A with 0FH: the digit 0-15 in bits 3-0.
60C6
ADD A,90H C6 90
ADD 90H to Register A, the first step of the conversion to the character 0-9 or A-F.
60C8
DAA 27
Decimal adjust Register A (DAA): 90H-99H for 0-9, 00H-05H with the CARRY FLAG for 10-15.
60C9
ADC A,40H CE 40
ADD 40H and the CARRY FLAG to Register A (ADC A,40H).
60CB
DAA 27
Decimal adjust Register A (DAA): the character 30H-39H or 41H-46H.
60CC
LD (HL),A 77
Store Register A (the hex digit) at Register Pair HL.
60CD
INC HL 23
INCrement Register Pair HL past the digit, to the next place.
60CE
RET C9
RETurn to the caller with Register Pair HL after the digit.

60CFH - Reading the Source Cylinder

When a destination is left and the cylinder is copied, the cylinder is read from the source into memory from 6700H, a page for each sector, and the sum of its bytes is kept twice, at 6300H and 6400H plus two times the cylinder (611BH). 6130H compares a sum with the kept ones: the two copies must agree (else MEMORY FAULT), and a sum that differs counts as an error. 6105H adds a sector to the sum.

60CF
LD IY,(5689H) FD 2A 89 56
Fetch the source's drive code table address from 5689H into Index Register IY.
60D3
LD A,(5687H) 3A 87 56
Fetch the copy of the destination digit from 5687H into Register A: 00H when the destination was dropped.
60D6
OR A B7
OR Register A with itself to set the Z FLAG when no destination is left.
60D7
RET Z C8
If the Z FLAG is set (no destination), RETurn: nothing is read.
60D8
GOSUB to 5B57H to test whether the cylinder is copied: the Z FLAG when it is not.
60DB
RET Z C8
If the Z FLAG is set (the cylinder is not copied), RETurn without reading it.
60DC
LD A,(5684H) 3A 84 56
Fetch the source drive's digit from 5684H into Register A.
60DF
AND 07H E6 07
Mask Register A with 07H: the source's drive number 0-7.
60E1
LD (5CBEH),A 32 BE 5C
Store Register A (the drive number) at 5CBEH, the operand of LD C,00H at 5CBDH.
60E4
GOSUB to 5B81H to read the cylinder of the source into memory from 6700H and sum it: the NZ FLAG after an error.
60E7
If the NZ FLAG is set (an error), GOSUB to 5CCAH to count one more error at 5696H.
60EA
GOSUB to 611BH to keep the sum of the cylinder at 6300H and 6400H.
60ED
GOSUB to 6130H to read the sum back: MEMORY FAULT when the two copies differ.
60F0
RET C9
RETurn to the caller; 55C2H tests the count of errors.
60F1
LD A,(5695H) 3A 95 56
Fetch the step of the sector loop from 5695H into Register A: 00H write, 01H verify, FFH read.
60F4
LD HL,6700H 21 00 67
Point Register Pair HL to 6700H, the cylinder buffer, for the read and the write.
60F7
DEC A 3D
DECrement Register A: the Z FLAG for 01H, the verify.
60F8
If the NZ FLAG is set (not the verify), JUMP to 60FDH with Register Pair HL = 6700H.
60FA
LD HL,6600H 21 00 66
Point Register Pair HL to 6600H, the page that every sector of the verify is read into.
60FD
PUSH HL E5
Save Register Pair HL (the buffer) to the stack.
60FE
EXX D9
Exchange the register pairs with the alternate set (EXX): the alternate set keeps the buffer and the sum.
60FF
POP HL E1
Restore Register Pair HL of the alternate set from the stack: the alternate Register Pair HL = the buffer too.
6100
LD BC,0000H 01 00 00
Load Register Pair BC of the alternate set with 0000H, the sum of the cylinder.
6103
EXX D9
Exchange the register pairs back with the alternate set (EXX).
6104
RET C9
RETurn with Register Pair HL and the alternate Register Pair HL at the buffer.
6105
EXX D9
Exchange the register pairs with the alternate set (EXX): Register Pair HL = the sector just read, Register Pair BC = the sum.
6106
LD A,(HL) 7E
Fetch the byte at Register Pair HL (the alternate set) into Register A. 610DH loops back here.
6107
ADD A,C 81
ADD Register C (the low byte of the sum) to Register A.
6108
LD C,A 4F
Copy Register A into Register C, the low byte of the sum.
6109
If the NO CARRY FLAG is set (no carry), JUMP to 610CH.
610B
INC B 04
INCrement Register B, the high byte of the sum in Register Pair BC.
610C
INC L 2C
INCrement Register L to the next byte of the sector.
610D
If the NZ FLAG is set (Register L has not come round to 00H), JUMP back to 6106H: the 256 bytes of the page are summed.
610F
LD A,(5695H) 3A 95 56
Fetch the step of the sector loop from 5695H into Register A.
6112
DEC A 3D
DECrement Register A: the Z FLAG for 01H, the verify.
6113
If the Z FLAG is set (the verify), JUMP to 6119H: the next sector goes into the same page.
6115
INC H 24
INCrement Register H of the alternate set to the next page of the cylinder buffer.
6116
EXX D9
Exchange the register pairs back with the alternate set (EXX).
6117
INC H 24
INCrement Register H to the next page: Register Pair HL follows the alternate one.
6118
RET C9
RETurn to 5C04H with both buffer pointers on the next page.
6119
EXX D9
Exchange the register pairs back with the alternate set (EXX).
611A
RET C9
RETurn to 5C04H with the buffer pointers on the same page.
611B
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
611E
ADD A,A 87
Double Register A (ADD A,A): two bytes for each cylinder.
611F
EXX D9
Exchange the register pairs with the alternate set (EXX): Register Pair BC = the sum of the cylinder.
6120
PUSH HL E5
Save Register Pair HL of the alternate set to the stack.
6121
LD HL,6300H 21 00 63
Point Register Pair HL to 6300H, outside the file, the first copy of the sums.
6124
LD L,A 6F
Copy Register A (two times the cylinder) into Register L.
6125
LD (HL),C 71
Store Register C (the low byte of the sum) at Register Pair HL in the first copy.
6126
INC H 24
INCrement Register H to the second copy at 6400H.
6127
LD (HL),C 71
Store Register C (the low byte of the sum) at Register Pair HL in the second copy.
6128
DEC H 25
DECrement Register H back to the first copy at 6300H.
6129
INC L 2C
INCrement Register L to the high byte of the entry.
612A
LD (HL),B 70
Store Register B (the high byte of the sum) at Register Pair HL in the first copy.
612B
INC H 24
INCrement Register H to the second copy at 6400H.
612C
LD (HL),B 70
Store Register B (the high byte of the sum) at Register Pair HL in the second copy.
612D
POP HL E1
Restore Register Pair HL of the alternate set from the stack.
612E
EXX D9
Exchange the register pairs back with the alternate set (EXX).
612F
RET C9
RETurn to the caller with the sum kept twice.
6130
LD A,(569AH) 3A 9A 56
Fetch the cylinder being copied from 569AH into Register A.
6133
ADD A,A 87
Double Register A (ADD A,A): two bytes for each cylinder.
6134
EXX D9
Exchange the register pairs with the alternate set (EXX): Register Pair BC = the sum just made.
6135
PUSH HL E5
Save Register Pair HL of the alternate set to the stack.
6136
LD HL,6300H 21 00 63
Point Register Pair HL to 6300H, the first copy of the sums.
6139
LD L,A 6F
Copy Register A (two times the cylinder) into Register L.
613A
LD A,(HL) 7E
Fetch the low byte of the kept sum at Register Pair HL into Register A.
613B
INC H 24
INCrement Register H to the second copy at 6400H for the comparison.
613C
CP (HL) BE
Compare Register A against the byte at Register Pair HL, the low byte of the second copy.
613D
If the NZ FLAG is set (the two copies differ), JUMP to 6153H: MEMORY FAULT.
6140
DEC H 25
DECrement Register H back to the first copy at 6300H.
6141
INC L 2C
INCrement Register L to the high byte of the entry.
6142
CP C B9
Compare Register A (the low byte kept) against Register C, the low byte of the sum just made.
6143
If the NZ FLAG is set (the sums differ), JUMP to 614DH with the NZ FLAG.
6146
LD A,(HL) 7E
Fetch the high byte of the kept sum at Register Pair HL into Register A.
6147
INC H 24
INCrement Register H to the second copy at 6400H for the comparison.
6148
CP (HL) BE
Compare Register A against the byte at Register Pair HL, the high byte of the second copy.
6149
If the NZ FLAG is set (the two copies differ), JUMP to 6153H: MEMORY FAULT.
614C
CP B B8
Compare Register A (the high byte kept) against Register B, the high byte of the sum just made.
614D
POP HL E1
Restore Register Pair HL of the alternate set from the stack.
614E
EXX D9
Exchange the register pairs back with the alternate set (EXX).
614F
If the NZ FLAG is set (the sums differ), GOSUB to 5CCAH to count one more error at 5696H.
6152
RET C9
RETurn with the Z FLAG (the same sum) or the NZ FLAG.
6153
POP HL E1
Restore Register Pair HL of the alternate set from the stack.
6154
EXX D9
Exchange the register pairs back with the alternate set (EXX).
6155
LD HL,6005H 21 05 60
Point Register Pair HL to 6005H, a new line and MEMORY FAULT -, ended by 03H.
6158
JUMP to 5C1BH to display the text at Register Pair HL with @LOGOT, then Program aborted!, and end.

615BH - A Drive Code Table and a Decimal Number

615BH points Index Register IY at the drive code table of drive Register A: DCT$ plus ten times the drive. 616CH writes Register Pair DE as five decimal places at Register Pair HL, with spaces for the leading zeros, by the powers of ten at 61B7H.

615B
PUSH DE D5
Save Register Pair DE to the stack; it comes back unchanged.
615C
LD C,A 4F
Copy Register A (the drive) into Register C for the times five.
615D
ADD A,A 87
Double Register A (ADD A,A): two times the drive.
615E
ADD A,A 87
Double Register A (ADD A,A): four times the drive.
615F
ADD A,C 81
ADD Register C (the drive) to Register A: five times the drive.
6160
ADD A,A 87
Double Register A (ADD A,A): ten times the drive, the offset of its table.
6161
LD DE,(568DH) ED 5B 8D 56
Fetch DCT$ from 568DH into Register Pair DE: 4700H, the first drive code table.
6165
ADD A,E 83
ADD Register E to Register A: the low byte of the drive's table; the tables do not cross a page.
6166
LD E,A 5F
Copy Register A into Register E: Register Pair DE = the drive code table.
6167
PUSH DE D5
Save Register Pair DE (the drive code table) to the stack.
6168
POP IY FD E1
Restore Index Register IY from the stack: Index Register IY = the drive code table.
616A
POP DE D1
Restore Register Pair DE from the stack: the caller's value.
616B
RET C9
RETurn with Index Register IY at the drive code table.
616C
PUSH BC C5
Save Register Pair BC to the stack; it comes back unchanged.
616D
PUSH DE D5
Save Register Pair DE (the number) to the stack.
616E
PUSH IX DD E5
Save Index Register IX to the stack; it comes back unchanged.
6170
PUSH IY FD E5
Save Index Register IY to the stack; it comes back unchanged.
6172
LD C,00H 0E 00
Load Register C with 00H: no digit other than 0 has been written yet.
6174
PUSH HL E5
Save Register Pair HL (the places) to the stack.
6175
POP IX DD E1
Restore Index Register IX from the stack: Index Register IX = the places of the number.
6177
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the number.
6178
LD IY,61B7H FD 21 B7 61
Point Index Register IY to 61B7H, the powers of ten: 10000, 1000, 100, 10 and 1.
617C
XOR A AF
Clear Register A (XOR A) to 00H, the digit of this place. 61AEH comes back here.
617D
LD D,(IY+01H) FD 56 01
Fetch the high byte of the power of ten at Index Register IY +01H into Register D.
6180
LD E,(IY+00H) FD 5E 00
Fetch the low byte of the power of ten at Index Register IY +00H into Register E.
6183
OR A B7
Clear the CARRY FLAG (OR A) for the subtraction; Register A, the digit, does not change. 6189H loops back here.
6184
SBC HL,DE ED 52
SUBtract Register Pair DE (the power of ten) from Register Pair HL (the number).
6186
If the CARRY FLAG is set (too far), JUMP to 618BH.
6188
INC A 3C
INCrement Register A, the digit, for each power taken away.
6189
JUMP back to 6183H to subtract the power once more.
618B
ADD HL,DE 19
ADD Register Pair DE (the power of ten) back to Register Pair HL: the rest of the number.
618C
ADD A,30H C6 30
ADD 30H to Register A: the digit becomes its character.
618E
LD (IX+00H),A DD 77 00
Store Register A (the digit) at Index Register IX +00H.
6191
INC IY FD 23
INCrement Index Register IY to the high byte of the power.
6193
INC IY FD 23
INCrement Index Register IY to the next power of ten.
6195
LD A,E 7B
Copy Register E (the low byte of the power just used) into Register A.
6196
DEC A 3D
DECrement Register A: the Z FLAG when the power was 1, the last place.
6197
If the Z FLAG is set (the last place, always a digit), JUMP to 61B0H.
6199
BIT 0,C CB 41
Test bit 0 of Register C: set once a digit other than 0 has been written.
619B
If the NZ FLAG is set (a digit was written before), JUMP to 61AAH to keep this one.
619D
LD A,(IX+00H) DD 7E 00
Fetch the digit at Index Register IX +00H into Register A.
61A0
CP 30H FE 30
Compare Register A against 30H, the digit 0, a leading zero.
61A2
If the NZ FLAG is set (not 0), JUMP to 61AAH.
61A4
LD (IX+00H),20H DD 36 00 20
Store 20H, a space, at Index Register IX +00H for a leading zero.
61A8
JUMP to 61ACH, past the mark of a digit written, to the next place.
61AA
LD C,01H 0E 01
Load Register C with 01H: a digit other than 0 has been written.
61AC
INC IX DD 23
INCrement Index Register IX to the next place.
61AE
JUMP back to 617CH for the next power of ten.
61B0
POP IY FD E1
Restore Index Register IY from the stack: the caller's value.
61B2
POP IX DD E1
Restore Index Register IX from the stack: the caller's value.
61B4
POP DE D1
Restore Register Pair DE from the stack: the number again.
61B5
POP BC C1
Restore Register Pair BC from the stack: the caller's value.
61B6
RET C9
RETurn to the caller with the number written.
61B7-61C0
DEFW 2710H, 03E8H, 0064H, 000AH, 0001H 10 27 E8 03 64 00 0A 00 01 00
61B7H-61C0H: the powers of ten of 616CH: 10000, 1000, 100, 10 and 1.

61C1H - The Pause and BREAK

61C1H looks at the keyboard matrix between the cylinders. SHIFT and @ together (3880H, 3801H) wait for a key other than SHIFT @. BREAK (3840H bit 2) marks every destination as a bad disk, waits until BREAK is let go and goes to the count of the disks made (5484H): a disk stopped by BREAK is not counted.

61C1
LD A,(3840H) 3A 40 38
Fetch row 6 of the keyboard matrix from 3840H into Register A: bit 2 is BREAK.
61C4
BIT 2,A CB 57
Test bit 2 of Register A: set while BREAK is pressed.
61C6
If the NZ FLAG is set (BREAK), JUMP to 61DDH to stop the copy.
61C8
LD A,(3880H) 3A 80 38
Fetch row 7 of the keyboard matrix from 3880H into Register A: bits 1-0 are the SHIFT keys.
61CB
AND 03H E6 03
Mask Register A with 03H: the two SHIFT keys.
61CD
RET Z C8
If the Z FLAG is set (no SHIFT key), RETurn: the copy goes on.
61CE
LD A,(3801H) 3A 01 38
Fetch row 0 of the keyboard matrix from 3801H into Register A: bit 0 is the @ key.
61D1
RRCA 0F
Rotate Register A right (RRCA): bit 0, the @ key, goes into the CARRY FLAG.
61D2
RET NC D0
If the NO CARRY FLAG is set (no @ key), RETurn: the copy goes on.
61D3
PUSH DE D5
Save Register Pair DE to the stack across the ROM's wait. 61DAH loops back here.
61D4
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A.
61D7
POP DE D1
Restore Register Pair DE from the stack: the caller's value.
61D8
CP 60H FE 60
Compare Register A (the key) against 60H, the SHIFT @ of the pause itself.
61DA
If the Z FLAG is set (SHIFT @), JUMP back to 61D3H to wait for another key.
61DC
RET C9
RETurn: any other key goes on with the copy; the key is not used.
61DD
XOR A AF
Clear Register A (XOR A) to 00H, the index of the source.
61DE
LD (569BH),A 32 9B 56
Store Register A (00H) at 569BH: the next destination is the first one.
61E1
GOSUB to 54DAH to take the next destination: the NZ FLAG for each one that is left. 61EFH loops back here.
61E4
If the Z FLAG is set (no destination left), JUMP to 61F1H.
61E6
LD HL,5F9CH 21 9C 5F
Point Register Pair HL to 5F9CH, the text BREAK pressed at the start of the line, ended by 03H.
61E9
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5F9CH) on the video.
61EC
GOSUB to 55F6H to display Bad disk in drive with the drive's digit and drop the destination.
61EF
JUMP back to 61E1H for the next destination still in the copy.
61F1
LD A,(3840H) 3A 40 38
Fetch row 6 of the keyboard matrix from 3840H into Register A. 61F6H loops back here.
61F4
BIT 2,A CB 57
Test bit 2 of Register A, the BREAK key of row 6 of the keyboard.
61F6
If the NZ FLAG is set (BREAK is still pressed), JUMP back to 61F1H.
61F8
LD BC,00C8H 01 C8 00
Load Register Pair BC with 00C8H, the count of the ROM's delay.
61FB
GOSUB to 0060H, the ROM's delay, which counts Register Pair BC down to 0.
61FE
JUMP to 5484H to show the count of the disks made and the question of the end.

6201H - The Set-Up for the Model and the Drive Code Tables

QFB is one file for the Model I and the Model III. The byte at ROM 0125H is 49H in the Model III's ROM; with any other byte the Model I addresses of @PARAM (4476H), HIGH$ (4049H), @LOGOT (447BH) and SFLAG$ (430FH) are stored into the operands. Then DCT$ (4700H on both), HIGH$ and the byte of the RST 38H vector (4012H) are kept, and the eight drive code tables are copied to 569CH, to be put back at the end (5C3DH).

6201
LD A,(0125H) 3A 25 01
Fetch the byte at ROM 0125H into Register A: 49H in the ROM of the Model III.
6204
CP 49H FE 49
Compare Register A against 49H, the byte of the Model III ROM.
6206
If the Z FLAG is set (the Model III), JUMP to 6229H: the operands of the file stand.
6208
LD HL,4476H 21 76 44
Load Register Pair HL with 4476H, the address of @PARAM on the Model I.
620B
LD (521FH),HL 22 1F 52
Store Register Pair HL (4476H) at 521FH, the operand of CALL 4454H at 521EH.
620E
LD HL,4049H 21 49 40
Load Register Pair HL with 4049H, the address of HIGH$ on the Model I.
6211
LD (6230H),HL 22 30 62
Store Register Pair HL (4049H) at 6230H, the operand of LD HL,(4411H) at 622FH.
6214
LD HL,447BH 21 7B 44
Load Register Pair HL with 447BH, the address of @LOGOT on the Model I.
6217
LD (5628H),HL 22 28 56
Store Register Pair HL (447BH) at 5628H, the operand of CALL 428AH at 5627H.
621A
LD (5C1CH),HL 22 1C 5C
Store Register Pair HL (447BH) at 5C1CH, the operand of CALL 428AH at 5C1BH.
621D
LD (5C22H),HL 22 22 5C
Store Register Pair HL (447BH) at 5C22H, the operand of CALL 428AH at 5C21H.
6220
LD (5C35H),HL 22 35 5C
Store Register Pair HL (447BH) at 5C35H, the operand of CALL 428AH at 5C34H.
6223
LD HL,430FH 21 0F 43
Load Register Pair HL with 430FH, the system flags byte the Model I file tests for FAST.
6226
LD (5532H),HL 22 32 55
Store Register Pair HL (430FH) at 5532H, the operand of LD A,(442BH) at 5531H.
6229
LD HL,4700H 21 00 47
Point Register Pair HL to 4700H, DCT$, the first drive code table.
622C
LD (568DH),HL 22 8D 56
Store Register Pair HL (4700H) at 568DH, for 615BH and 5C4EH.
622F
LD HL,(4411H) 2A 11 44
Fetch HIGH$ from 4411H into Register Pair HL; on the Model I 6211H makes it 4049H.
6232
LD (568FH),HL 22 8F 56
Store Register Pair HL (HIGH$) at 568FH, for the memory test 5525H.
6235
LD A,(4012H) 3A 12 40
Fetch the first byte of the RST 38H vector from 4012H into Register A.
6238
LD (5C3EH),A 32 3E 5C
Store Register A at 5C3EH, the operand of LD A,00H at 5C3DH, which puts it back at the end.
623B
LD HL,(568DH) 2A 8D 56
Fetch DCT$ from 568DH into Register Pair HL, the source of the copy.
623E
LD DE,569CH 11 9C 56
Point Register Pair DE to 569CH, outside the file, the copy of the drive code tables.
6241
LD BC,0050H 01 50 00
Load Register Pair BC with 0050H, the 80 bytes of the eight tables.
6244
LDIR ED B0
Copy the tables from Register Pair HL (DCT$) to Register Pair DE (569CH), Register Pair BC counting (LDIR).
6246
RET C9
RETurn to 5208H, which displays the banner of QFB.
6247-62FF
DEFS 185
6247H-62FFH: not in the file and not used by QFB.
6300-63FF
DEFS 256
6300H-63FFH: not in the file. The first copy of the sums of the cylinders: two bytes for each, at 6300H plus two times the cylinder (611BH).
6400-64FF
DEFS 256
6400H-64FFH: not in the file. The second copy of the sums, which 6130H compares with the first.
6500-65FF
DEFS 256
6500H-65FFH: not in the file. The source's boot sector, then its allocation table: 65xxH the granules in use, 6560H up the lock out table, 65CCH-65CDH the cylinders and flags.
6600-66FF
DEFS 256
6600H-66FFH: not in the file. The list of the places of the identification bytes during a format, the page each sector of a verify is read into.
6700-67FF
DEFS 256
6700H-67FFH: not in the file. The first page of the cylinder buffer, which goes on up to HIGH$: the image of a track for the format, the sectors of the cylinder for the read and the write.