5200H - The Selection Cells and the Parameter Cells
The first load block holds 29 bytes of data: the cells the front end fills from the partspec and the DATE parameter, the date conversion flag, and five of the cells @PARAM writes (NEW, OLD, MOD, QUERY, SYS; the cells of MPW, INV, X and DATE are operands of instructions elsewhere). The file by file engine (6300H, run at 5A00H) reads them to choose the files.
5200
DEFB 00H 00
5200H: the DATE mode, 00H in the file. 5AAFH stores 80H when the DATE string starts with a date (a first date given), 5AD0H ORs in 01H when a second date follows a minus sign or the string is one date only; a string that starts with a minus sign gives 01H alone. Read by the file by file engine at 649BH and 64AFH (run 5B9BH, 5BAFH).
5201-5202
DEFW 0000H 00 00
5201H-5202H: the first date of the DATE parameter, packed by 5CCCH as a directory record keeps a date (stored by 5AB5H). The file by file engine compares it at 64A6H (run 5BA6H).
5203-5204
DEFW 0000H 00 00
5203H-5204H: the second date of the DATE parameter, packed the same way (stored by 5AD3H; for a single date the same date as 5201H). The file by file engine compares it at 64BAH (run 5BBAH).
5205-520C
DEFM " " 20 20 20 20 20 20 20 20
5205H-520CH: the file name of the partspec, 8 characters, blank filled; 24H ($) in a position matches any character. Filled by 5A1FH through 5CB1H; read by 5AF9H and by the file by file engine at 645CH and 646FH (run 5B5CH, 5B6FH).
520D-520F
DEFM " " 20 20 20
520DH-520FH: the extension of the partspec, 3 characters, blank filled, filled after a slash by 5A2DH; read by 5AFFH and by the file by file engine at 6463H (run 5B63H).
5210
DEFB 00H 00
5210H: the attribute selection byte built by 5AD7H-5AF6H: bit 6 for SYS, bit 3 for INV, bit 4 from the cell 5AEDH (never set, 5AECH). Read by the file by file engine at 6446H (run 5B46H).
5211
DEFB 00H 00
5211H: the exclusion flag, 00H in the file; 5A1AH stores 2DH when the partspec starts with a minus sign (all files but those that match). Read by the file by file engine at 6485H and 648EH (run 5B85H, 5B8EH).
5212
DEFB FEH FE
5212H: the date conversion count, FEH in the file. 5BC1H stores FFH when the source diskette's date flag bit is clear (bit 3 of its configuration byte), and 5C4AH INCrements it when the destination's bit is set: 00H only for a source without the bit copied to a destination with it. Read by the file by file engine at 67C2H (run 5EC2H).
5213-5214
DEFW 0000H 00 00
5213H-5214H: the cell of the NEW and N parameters (@PARAM table 6DD4H, 6DDCH): FFFFH when given. Read by 5B1FH and by the file by file engine at 64F8H and 6522H (run 5BF8H, 5C22H).
5215-5216
DEFW 0000H 00 00
5215H-5216H: the cell of the OLD and O parameters (@PARAM table 6DE4H, 6DECH): FFFFH when given. Read by 5B24H and by the file by file engine at 6384H, 64F5H and 652BH (run 5A84H, 5BF5H, 5C2BH).
5217-5218
DEFW 0000H 00 00
5217H-5218H: the cell of the MOD and M parameters (@PARAM table 6D9CH, 6DA4H): FFFFH when given. Read by 5B15H and by the file by file engine at 6439H (run 5B39H).
5219-521A
DEFW 0000H 00 00
5219H-521AH: the cell of the QUERY and Q parameters (@PARAM table 6DACH, 6DB4H): FFFFH when given. Only the high byte 521AH is read (5B29H, and the file by file engine at 653EH, run 5C3EH); the engine stores 00H there at 65EFH (run 5CEFH) when the reply is C, so the questions stop.
521B-521C
DEFW 0000H 00 00
521BH-521CH: the cell of the SYS and S parameters (@PARAM table 6D7CH, 6D84H): FFFFH when given. Read by 5AD9H, 5B06H and the file by file engine at 6354H (run 5A54H).
521D-523C
DEFS 32
521DH-523CH: not in the file. The file by file engine builds the source file specification here and uses it as the source file's control block (64CAH, 64FEH, 6536H, 65CBH, 65FAH, 682DH, 68E0H; run 5BCAH onwards); the cells 5220H, 5225H and 5229H of the control block are read and written at 6738H, 676EH, 66F0H and 6718H.
523D-525C
DEFS 32
523DH-525CH: not in the file. The file by file engine copies the specification here for the destination (6830H) and uses it as the destination file's control block (6514H, 6838H, 68E9H); 5240H, 5244H, 5245H and 5249H are addressed at 6757H, 6896H, 6712H, 6771H and 672FH.
525D
DEFS 1
525DH: not in the file. The reply of one character to the drive questions (5A3AH, 5A65H; the ROM puts 0DH after it at 525EH), the year of a DATE date (5D20H) and the start of the reply of the mirror image engine (5E19H, run 5A19H) and the file by file engine (6501H, 6533H: the 32 byte copy of the specification, 525DH-527CH).
525E-525F
DEFS 2
525EH-525FH: not in the file. The day (525EH) and the month (525FH) of a DATE date, stored by 5D20H from 525FH downwards; 5C78H takes the reply to the cylinder count question at 525EH.
5260-527C
DEFS 29
5260H-527CH: not in the file. The rest of the replies (up to 3 characters and 0DH from 525DH or 525EH) and of the copy of the specification the file by file engine keeps at 525DH-527CH (6501H, 6533H).
527D-5284
DEFS 8
527DH-5284H: not in the file. The date as text, 8 characters MM/DD/YY, written by the ROM's @DATE (3033H) from 5B43H; the mirror image engine copies it into the destination's allocation table at 604FH (run 5C4FH).
5285H - The Work Area Pointer and the Endings
The second load block starts with the pointer to the work area, then the code both engines share: it lies below 5A00H, so the move of an engine to 5A00H leaves it in place. 5287H ends a backup that is complete, 529BH-52AAH one with an error, 52ACH-52BDH one that is given up; all of them first put the clock back and clear the work area (52C0H).
5285-5286
DEFW 0000H 00 00
5285H-5286H: the start of the work area, 0000H in the file. The engine selector stores the page boundary above the engine it moved (6C61H); the engines take their buffers from here up to HIGH$ (4411H), and 52DFH clears that memory at the end.
5287
LD HL,55D7H 21 D7 55
Point Register Pair HL to 55D7H, the text Backup complete (a new line first, 0DH at the end). Both engines JUMP here when they are done: the mirror image engine at 613CH and 6145H, the file by file engine at 6400H.
528A
PUSH HL E5
Save Register Pair HL (55D7H) to the stack while 52C0H runs.
528B
GOSUB to 52C0H to put back the byte of 4012H, ask for the system diskette after an X backup or a backup on one drive, and clear the work area.
528E
POP HL E1
Restore Register Pair HL (55D7H) from the stack.
528F
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (55D7H): Backup complete.
5292
LD HL,5487H 21 87 54
Point Register Pair HL to 5487H, the text Note: Real time clock no longer accurate (a new line first, 0DH at the end).
5295
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5487H). It is shown at the end of every backup, whichever engine ran.
5298
JUMP to 402DH, @EXIT, back to LDOS. Register Pair HL is not set to 0000H first: it holds what @DSPLY left in it.
529B
LD A,11H 3E 11
Load Register A with 11H, error 11H, Directory read error: the entry of 5361H, 5BAEH, 5C3CH and the engines when a directory sector cannot be read. The next bytes are the operand of LD BC, so Register A keeps 11H.
529D
LD BC,203EH 01 3E 20
Load Register Pair BC with 203EH: the bytes 3EH 20H at 529EH are taken as the operand, so from 529BH Register A keeps 11H. Entered at 529EH the same bytes are LD A,20H: Register A = 20H, error 20H, Illegal drive number, for a drive number that is not 0-7 (5A4BH, 5A74H, 5A79H).
52A0
PUSH AF F5
Save Register Pair AF (Register A = the error number) to the stack while 52C0H runs. The entry for every error number the code has in Register A: the driver's results, 2CH from @PARAM (5A87H), 11H and 20H from above.
52A1
GOSUB to 52C0H to put back the byte of 4012H, ask for the system diskette when needed and clear the work area.
52A4
POP AF F1
Restore Register Pair AF (Register A = the error number) from the stack.
52A5
OR C0H F6 C0
Set bits 7 and 6 of Register A (OR C0H): bit 7 makes @ERROR return to the caller, bit 6 asks for the short message.
52A7
GOSUB to 4409H, @ERROR, to display the message of the error number in Register A (bits 5-0).
52AA
JUMP to 52B7H to display the clock note and end through @ABORT; Backup aborted is not shown, @ERROR has said what went wrong.
52AC
LD HL,55E8H 21 E8 55
Point Register Pair HL to 55E8H, the text Backup aborted (a new line first, 0DH at the end): the entry when the operator says no or presses BREAK.
52AF
PUSH HL E5
Save Register Pair HL (the text) to the stack while 52C0H runs. The entry for an end with a text of the caller's own in Register Pair HL (5A9EH, 5BF5H, 5C21H, 5CAEH, 5D1DH, and 6171H, 63A2H, 6904H in the engines).
52B0
GOSUB to 52C0H to put back the byte of 4012H, ask for the system diskette when needed and clear the work area.
52B3
POP HL E1
Restore Register Pair HL (the text) from the stack.
52B4
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL and write it to the job log.
52B7
LD HL,5487H 21 87 54
Point Register Pair HL to 5487H, the text Note: Real time clock no longer accurate.
52BA
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5487H).
52BD
JUMP to 4030H, @ABORT: the end with an error, which also ends a JCL job.
52C0H - Put the Clock Back, Ask for the System Diskette, Clear the Work Area
Called by all three endings. The mirror image engine stores the byte of 4012H it replaces at 52C1H (5ED6H); it is put back here with interrupts on. After an X backup, or a backup with source and destination on one drive, the system diskette is asked for in drive 0 (52FBH). Then the memory from the work area pointer (5285H) up to HIGH$ is filled with 00H, unless the pointer is still 0000H.
52C0
LD A,00H 3E 00
Load Register A with the operand at 52C1H: 00H in the file, the byte of 4012H that the mirror image engine stored there before it put C9H at 4012H (5ED6H).
52C2
OR A B7
Set the flags from Register A (OR A): the Z FLAG when 52C1H is still 00H.
52C3
If the Z FLAG is set (4012H was not changed), JUMP to 52C9H.
52C5
EI FB
Enable interrupts: the engine turned them off when it put C9H at 4012H.
52C6
LD (4012H),A 32 12 40
Store Register A (the saved byte) at 4012H, the start of the interrupt service that the ROM's vector at 0038H reaches: the clock and the other interrupt tasks run again.
52C9
LD DE,0000H 11 00 00
Load Register Pair DE with the operand at 52CAH-52CBH, the cell of the X parameter (@PARAM table 6DBCH): 0000H in the file, FFFFH for X.
52CC
INC E 1C
INCrement Register E: 00H, and the Z FLAG, only when the cell's low byte is FFH (X given).
52CD
If the NZ FLAG is set (no X: Register E was not FFH), JUMP to 52D8H for the test of one drive.
52CF
XOR A AF
Load Register A with 00H (XOR A), for the cell 53DCH: the X parameter was given, so the system diskette must be asked for.
52D0
LD (53DCH),A 32 DC 53
Store Register A (00H) at 53DCH, the operand of LD A at 53DBH: the prompt routine now takes source and destination as one drive and asks for the diskette.
52D3
GOSUB to 52FBH to ask for the system diskette in drive 0 until @CKDRV accepts the diskette there.
52D6
JUMP to 52DFH to clear the work area, past the test of one drive, which an X backup does not need.
52D8
LD A,(53DCH) 3A DC 53
Load Register A with the byte at 53DCH, the source drive XOR the destination drive (5A91H): 00H when both are one drive.
52DB
OR A B7
Set the flags from Register A (OR A): the Z FLAG when the source and destination drives are one drive.
52DC
If the Z FLAG is set (source and destination on one drive, so the system diskette may have been taken out), GOSUB to 52F6H to ask for it.
52DF
LD DE,(5285H) ED 5B 85 52
Load Register Pair DE with the work area pointer at 5285H-5286H (0000H until the engine selector ran).
52E3
LD A,D 7A
Copy Register D (the high byte of the work area start) into Register A for the test of 0000H.
52E4
OR E B3
OR Register E into Register A: the Z FLAG when Register Pair DE is 0000H.
52E5
RET Z C8
If the Z FLAG is set (no engine moved, nothing to clear), RETurn.
52E6
LD HL,(4411H) 2A 11 44
Load Register Pair HL with HIGH$ from 4411H-4412H, the top of the work area.
52E9
XOR A AF
Load Register A with 00H (XOR A), the fill byte; the CARRY FLAG is cleared for the SBC.
52EA
SBC HL,DE ED 52
SUBtract Register Pair DE (the work area start) from Register Pair HL (HIGH$): Register Pair HL = the bytes to clear.
52EC
LD B,H 44
Copy Register H (the high byte of the count) into Register B for the LDIR.
52ED
LD C,L 4D
Copy Register L into Register C: Register Pair BC = the byte count.
52EE
LD H,D 62
Copy Register D (the high byte of the work area start) into Register H.
52EF
LD L,E 6B
Copy Register E into Register L: Register Pair HL = the work area start.
52F0
INC DE 13
INCrement Register Pair DE to the byte above it.
52F1
LD (HL),A 77
Store Register A (00H) at Register Pair HL, the first byte of the work area.
52F2
DEC BC 0B
DECrement Register Pair BC: the first byte is done.
52F3
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL to Register Pair DE, one place higher (LDIR): the 00H is carried up to the byte below HIGH$.
52F5
RET C9
RETurn to the ending (5287H, 52A0H or 52ACH) with the work area filled with 00H.
52F6H - Ask for the System Diskette
Called at the end by 52DCH; 52D3H enters at 52FBH, past the test of 5302H. The drive state 20H (drive 0, bit 5) goes to the prompt routine with Insert SYSTEM disk <ENTER>; @CKDRV must then accept the diskette in drive 0, or the drive state is put back and the prompt comes again.
52F6
LD A,(5302H) 3A 02 53
Load Register A with the operand at 5302H, 00H: no code changes it, so the next test never returns.
52F9
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H, which the operand at 5302H always holds.
52FA
RET NZ C0
If the NZ FLAG is set, RETurn (never: 5302H is 00H).
52FB
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H (bits 2-0 the drive, bit 7 the source, bit 6 the destination is in it).
52FE
LD (5314H),A 32 14 53
Store Register A (the drive state) at 5314H, the operand of LD A at 5313H, to put it back if the diskette is not accepted.
5301
LD A,00H 3E 00
Load Register A with the operand at 5302H: 00H, drive 0.
5303
OR 20H F6 20
Set bit 5 in Register A (OR 20H): 20H, the drive state of the system diskette in drive 0.
5305
PUSH HL E5
Save Register Pair HL (the caller's pointer) to the stack while the prompt runs.
5306
LD HL,54D6H 21 D6 54
Point Register Pair HL to 54D6H, the prompt Insert SYSTEM disk <ENTER>.
5309
GOSUB to 53D4H with Register A = 20H: the drive state differs from 53D5H, so the prompt flashes until ENTER (53E0H).
530C
LD C,00H 0E 00
Load Register C with 00H, drive 0, the drive @CKDRV is to test for the system diskette.
530E
GOSUB to 4209H, @CKDRV, to test drive Register C (0): the Z FLAG when a diskette LDOS can read is there.
5311
POP HL E1
Restore Register Pair HL (the caller's pointer) from the stack; the flags of @CKDRV are kept.
5312
RET Z C8
If the Z FLAG is set (the diskette is accepted), RETurn.
5313
LD A,00H 3E 00
Load Register A with the operand at 5314H, the drive state saved at 52FEH.
5315
LD (53D5H),A 32 D5 53
Store Register A at 53D5H: the drive state as it was, so that 53D4H asks again.
5318
LOOP BACK to 5301H to ask for the system diskette again.
531AH - Ask for the Source Diskette
5327H is the call of the engines: when the source diskette is not the one in the drive (bit 7 of 53D5H clear), it is asked for (531AH), and on one drive its pack identity is then checked: the 10 bytes at 00CEH-00D7H of its allocation table (the master password hash and the diskette name) must equal those of the source diskette read at the start (57CEH). A diskette whose boot sector does not start with 00H, or another pack identity, is asked for again.
531A
LD A,00H 3E 00
Load Register A with the operand at 531BH, the source drive number (stored by 5A4EH).
531C
OR 80H F6 80
Set bit 7 in Register A (OR 80H): the drive state with the source diskette in the drive.
531E
PUSH HL E5
Save Register Pair HL (the caller's pointer) to the stack while the prompt runs.
531F
LD HL,54F5H 21 F5 54
Point Register Pair HL to 54F5H, the prompt Insert SOURCE disk <ENTER>.
5322
GOSUB to 53D4H with Register A = the drive state: when it is already the state at 53D5H, or the source and destination are two drives, only the drive is selected; else the prompt flashes until ENTER.
5325
POP HL E1
Restore Register Pair HL (the caller's pointer) from the stack after the prompt.
5326
RET C9
RETurn with Index Register IY at the source drive's drive code table.
5327
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H.
532A
BIT 7,A CB 7F
Test bit 7 of Register A: set when the source diskette is the one in the drive.
532C
If the NZ FLAG is set (the source diskette is in the drive), JUMP to 531AH: only the drive is selected.
532E
GOSUB to 531AH to ask for the source diskette.
5331
LD A,(53DCH) 3A DC 53
Load Register A with the byte at 53DCH, the source drive XOR the destination drive.
5334
OR A B7
Set the flags from Register A (OR A): the Z FLAG when source and destination are one drive.
5335
RET NZ C0
If the NZ FLAG is set (two drives: nothing was changed), RETurn.
5336
GOSUB to 545CH, function 04H: Restore the head of the drive to cylinder 0.
5339
PUSH BC C5
Save Register Pair BC (the caller's value) to the stack during the read of the boot sector.
533A
PUSH DE D5
Save Register Pair DE (the caller's value) to the stack during the read of the boot sector.
533B
PUSH HL E5
Save Register Pair HL (the caller's value) to the stack during the read of the boot sector.
533C
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
533F
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0.
5342
GOSUB to 546CH, function 09H, to read cylinder 0 sector 0 (the boot sector) into Register Pair HL (5900H).
5345
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
5348
POP HL E1
Restore Register Pair HL (the caller's value) from the stack after the read of the boot sector.
5349
POP DE D1
Restore Register Pair DE (the caller's value) from the stack after the read of the boot sector.
534A
POP BC C1
Restore Register Pair BC (the caller's value) from the stack after the read of the boot sector.
534B
LD A,(5900H) 3A 00 59
Load Register A with the first byte of the boot sector at 5900H.
534E
OR A B7
Set the flags from Register A (OR A): the Z FLAG when the boot sector starts with 00H.
534F
If the NZ FLAG is set (the first byte is not 00H, the first byte of an LDOS boot sector), JUMP to 5381H to ask again.
5351
PUSH BC C5
Save Register Pair BC (the caller's value) to the stack during the read of the allocation table.
5352
PUSH DE D5
Save Register Pair DE (the caller's value) to the stack during the read of the allocation table.
5353
PUSH HL E5
Save Register Pair HL (the caller's value) to the stack during the read of the allocation table.
5354
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the source diskette's directory cylinder (set from its boot sector by 5BA0H).
5357
LD E,00H 1E 00
Load Register E with 00H: sector 0 of the directory cylinder, the allocation table.
5359
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
535C
GOSUB to 546CH, function 09H, to read cylinder Register D sector 0 into Register Pair HL (5900H).
535F
CP 06H FE 06
Compare Register A (the result) against 06H: a directory sector carries the deleted data mark, which the driver reports as 06H.
5361
If the NZ FLAG is set (not the result of a directory sector), JUMP to 529BH: error 11H.
5364
LD HL,57CEH 21 CE 57
Point Register Pair HL to 57CEH, +CEH of the source diskette's allocation table read at the start (5BA9H).
5367
LD DE,59CEH 11 CE 59
Point Register Pair DE to 59CEH, +CEH of the allocation table just read.
536A
LD B,0AH 06 0A
Load Register B with 0AH: 10 bytes, the master password hash (+CEH-+CFH) and the diskette name (+D0H-+D7H).
536C
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE (the diskette in the drive).
536D
CP (HL) BE
Compare Register A against the byte at Register Pair HL (the source diskette).
536E
If the NZ FLAG is set (they differ), JUMP to 5378H: not the same source diskette.
5370
INC DE 13
INCrement Register Pair DE to the next byte of the pack identity of the diskette in the drive (59CEH onwards).
5371
INC HL 23
INCrement Register Pair HL to the next byte of the source diskette's pack identity (57CEH onwards).
5372
DECrement Register B and LOOP BACK to 536CH until the 10 bytes are compared.
5374
POP HL E1
Restore Register Pair HL (the caller's value) from the stack: the pack identities are the same.
5375
POP DE D1
Restore Register Pair DE (the caller's value) from the stack: the pack identities are the same.
5376
POP BC C1
Restore Register Pair BC (the caller's value) from the stack: the pack identities are the same.
5377
RET C9
RETurn to the engine: the source diskette is in the drive and Index Register IY is at its drive's table.
5378
LD HL,5538H 21 38 55
Point Register Pair HL to 5538H, the text A L E R T (between two asterisks), That's not the same source disk!
537B
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (5538H).
537E
POP HL E1
Restore Register Pair HL (the caller's value) from the stack before the source diskette is asked for again.
537F
POP DE D1
Restore Register Pair DE (the caller's value) from the stack before the source diskette is asked for again.
5380
POP BC C1
Restore Register Pair BC (the caller's value) from the stack before the source diskette is asked for again.
5381
XOR A AF
Load Register A with 00H (XOR A), the drive state that names no diskette and no drive.
5382
LD (53D5H),A 32 D5 53
Store Register A (00H) at 53D5H: no diskette is known to be in the drive, so 531AH asks again.
5385
LOOP BACK to 5327H to ask for the source diskette again.
5387H - Ask for the Destination Diskette
5394H is the call of the engines: when the destination diskette is not the one in the drive (bit 6 of 53D5H clear), it is asked for (5387H), and on one drive its boot sector must start with 76H, the byte the mirror image engine writes there (5E75H). The file by file engine stores C9H at 53BDH (6311H (run 5A11H)), so for it any diskette that can be read is taken.
5387
LD A,00H 3E 00
Load Register A with the operand at 5388H, the destination drive number (stored by 5A7CH).
5389
OR 40H F6 40
Set bit 6 in Register A (OR 40H): the drive state with the destination diskette in the drive.
538B
PUSH HL E5
Save Register Pair HL (the caller's pointer) to the stack while the prompt runs.
538C
LD HL,5514H 21 14 55
Point Register Pair HL to 5514H, the prompt Insert DESTINATION disk <ENTER>.
538F
GOSUB to 53D4H with Register A = the drive state: only the drive is selected when it is already the state, or the drives differ; else the prompt flashes until ENTER.
5392
POP HL E1
Restore Register Pair HL (the caller's pointer) from the stack after the prompt.
5393
RET C9
RETurn with Index Register IY at the destination drive's drive code table.
5394
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H.
5397
BIT 6,A CB 77
Test bit 6 of Register A: set when the destination diskette is the one in the drive.
5399
If the NZ FLAG is set (it is in the drive), JUMP to 5387H: only the drive is selected.
539B
GOSUB to 5387H to ask for the destination diskette.
539E
LD A,(53DCH) 3A DC 53
Load Register A with the byte at 53DCH, the source drive XOR the destination drive.
53A1
OR A B7
Set the flags from Register A (OR A): the Z FLAG when source and destination are one drive.
53A2
RET NZ C0
If the NZ FLAG is set (two drives: the destination diskette was not changed), RETurn.
53A3
GOSUB to 545CH, function 04H: Restore the head to cylinder 0.
53A6
PUSH BC C5
Save Register Pair BC (the caller's value) to the stack during the read of the boot sector.
53A7
PUSH DE D5
Save Register Pair DE (the caller's value) to the stack during the read of the boot sector.
53A8
PUSH HL E5
Save Register Pair HL (the caller's value) to the stack during the read of the boot sector.
53A9
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
53AC
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: cylinder 0 (Register D), sector 0 (Register E).
53AF
GOSUB to 546CH, function 09H, to read the boot sector into Register Pair HL (5900H).
53B2
POP HL E1
Restore Register Pair HL (the caller's value) from the stack; the flags of the read are kept.
53B3
POP DE D1
Restore Register Pair DE (the caller's value) from the stack; the flags of the read are kept.
53B4
POP BC C1
Restore Register Pair BC (the caller's value) from the stack; the flags of the read are kept.
53B5
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
53B8
LD A,(5900H) 3A 00 59
Load Register A with the first byte of the boot sector at 5900H.
53BB
CP 76H FE 76
Compare Register A against 76H, the byte the mirror image engine writes at the start of the destination's boot sector (5E75H).
53BD
RET Z C8
If the Z FLAG is set (76H: the same destination diskette), RETurn. The file by file engine changes this byte to C9H, a RET that always returns (6311H (run 5A11H)).
53BE
PUSH HL E5
Save Register Pair HL (the caller's value) to the stack while the alert is displayed.
53BF
PUSH DE D5
Save Register Pair DE (the caller's value) to the stack while the alert is displayed.
53C0
LD HL,556AH 21 6A 55
Point Register Pair HL to 556AH, the text A L E R T (between two asterisks), That's not the same destination disk!
53C3
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (556AH).
53C6
POP DE D1
Restore Register Pair DE (the caller's value) from the stack before the destination diskette is asked for again.
53C7
POP HL E1
Restore Register Pair HL (the caller's value) from the stack before the destination diskette is asked for again.
53C8
XOR A AF
Load Register A with 00H (XOR A), the drive state that names no diskette and no drive.
53C9
LD (53D5H),A 32 D5 53
Store Register A (00H) at 53D5H: no diskette is known to be in the drive.
53CC
LOOP BACK to 5394H to ask for the destination diskette again.
53CEH - The Prompt Routine
53D4H takes the wanted drive state in Register A (bits 2-0 the drive, bit 7 the source, bit 6 the destination, bit 5 the system diskette). When it is the state at 53D5H, or the source and destination are two drives (53DCH not 00H), the drive is only selected (5439H). Else the state is stored and the prompt at Register Pair HL flashes (shown, cleared, shown) until ENTER; BREAK gives up the backup. 53CEH (the front end) and 53E0H (the file by file engine) ask whatever the state.
53CE
LD A,C 79
Copy Register C (the drive state the front end wants) into Register A.
53CF
LD (53D5H),A 32 D5 53
Store Register A (the drive state) at 53D5H, the operand of CP at 53D4H.
53D2
JUMP to 53E0H to show the prompt at Register Pair HL, without the tests.
53D4
CP 00H FE 00
Compare Register A (the wanted drive state) against the operand at 53D5H: the drive state now, 00H in the file. Every routine of BACKUP that needs the drive state reads it here.
53D6
If the Z FLAG is set (the wanted diskette is already in the drive), JUMP to 5439H to select the drive.
53D8
LD (53D5H),A 32 D5 53
Store Register A (the wanted drive state) at 53D5H.
53DB
LD A,FFH 3E FF
Load Register A with the operand at 53DCH: the source drive XOR the destination drive, stored by 5A91H (FFH in the file); 52D0H stores 00H for the system diskette after an X backup.
53DD
OR A B7
Set the flags from Register A (OR A): the Z FLAG when source and destination are one drive.
53DE
If the NZ FLAG is set (two drives: no diskette is changed), JUMP to 5439H to select the drive.
53E0
PUSH BC C5
Save Register Pair BC (the caller's value) to the stack: the prompt can wait for a long time.
53E1
PUSH DE D5
Save Register Pair DE (the caller's value) to the stack: the prompt can wait for a long time.
53E2
PUSH HL E5
Save Register Pair HL (the prompt) to the stack.
53E3
LD A,0DH 3E 0D
Load Register A with 0DH, a new line, so that the prompt gets a line of its own.
53E5
GOSUB to 0033H, the ROM's display of the character in Register A (0DH).
53E8
GOSUB to 544CH to clear bits 0-2 of KFLAG$ (429FH).
53EB
LD BC,41FDH 01 FD 41
Load Register Pair BC with 41FDH, the count of the delay.
53EE
GOSUB to 0060H, the ROM's delay (on the Model III ROM a JP 01FBH to the loop): Register Pair BC counted down to 0.
53F1
GOSUB to 4DBEH, the keyboard scan of SYS0/SYS: bit 0 of KFLAG$ (429FH) for BREAK, bit 1 for SHIFT @, bit 2 for ENTER.
53F4
LD A,(429FH) 3A 9F 42
Load Register A with KFLAG$ from 429FH, as the keyboard scan left it.
53F7
AND 05H E6 05
Mask Register A to bits 2 and 0 (AND 05H): ENTER and BREAK.
53F9
If the NZ FLAG is set (ENTER or BREAK is still held), LOOP BACK to 53E8H: the prompt waits until both are released.
53FB
GOSUB to 544CH to clear bits 0-2 of KFLAG$ (429FH).
53FE
GOSUB to 4467H, @DSPLY, to display the prompt at Register Pair HL: 1DH (to the start of the line), 1EH (clear to the end of the line), the text, 1DH and 03H, so the cursor stays at the start of the line.
5401
LD BC,1555H 01 55 15
Load Register Pair BC with 1555H, the count for the time the prompt is shown.
5404
GOSUB to 5414H to count Register Pair BC down while the keyboard is watched.
5407
LD A,1EH 3E 1E
Load Register A with 1EH, clear to the end of the line.
5409
GOSUB to 0033H to display Register A (1EH): the prompt line is cleared.
540C
LD BC,1111H 01 11 11
Load Register Pair BC with 1111H, the count for the time the line stays empty.
540F
GOSUB to 5414H to count Register Pair BC down while the keyboard is watched.
5412
LOOP BACK to 53FEH to show the prompt again, until ENTER or BREAK is pressed.
5414
GOSUB to 4DBEH, the keyboard scan of SYS0/SYS, which sets the bits of KFLAG$ (429FH).
5417
LD A,(429FH) 3A 9F 42
Load Register A with KFLAG$ from 429FH, as the keyboard scan left it.
541A
RRCA 0F
Rotate Register A right one bit (RRCA): bit 0, BREAK, into the CARRY FLAG; bit 2, ENTER, to bit 1.
541B
If the CARRY FLAG is set (BREAK), JUMP to 5448H to give up the backup.
541D
BIT 1,A CB 4F
Test bit 1 of Register A: bit 2 of KFLAG$, ENTER.
541F
If the NZ FLAG is set (ENTER), JUMP to 5427H: the prompt is answered.
5421
DEC BC 0B
DECrement Register Pair BC, the count of the delay.
5422
LD A,B 78
Copy Register B (the high byte of the delay count) into Register A.
5423
OR C B1
OR Register C into Register A: the Z FLAG when Register Pair BC is 0000H.
5424
If the NZ FLAG is set (the count is not over), LOOP BACK to 5414H.
5426
RET C9
RETurn to the flashing loop (5404H or 540FH).
5427
POP AF F1
Discard the return address of the CALL 5414H from the stack (POP AF into Register Pair AF): the flashing loop is left.
5428
GOSUB to 002BH, the ROM's keyboard scan: Register A = the character of a key newly pressed, 00H when there is none.
542B
OR A B7
Set the flags from Register A (OR A): the Z FLAG when no key was returned.
542C
If the NZ FLAG is set (a key was returned), LOOP BACK to 5428H until the scan returns 00H: the ENTER that answered is not left for later.
542E
LD A,1EH 3E 1E
Load Register A with 1EH, clear to the end of the line.
5430
GOSUB to 0033H to display Register A (1EH): the prompt is cleared.
5433
GOSUB to 544CH to clear bits 0-2 of KFLAG$ (429FH).
5436
POP HL E1
Restore Register Pair HL (the prompt, saved at 53E2H) from the stack.
5437
POP DE D1
Restore Register Pair DE (the caller's value, saved at 53E1H) from the stack.
5438
POP BC C1
Restore Register Pair BC (the caller's value, saved at 53E0H) from the stack.
5439
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H.
543C
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the drive number.
543E
LD C,A 4F
Copy Register A (the drive number) into Register C.
543F
GOSUB to 478FH, GETDCT: Index Register IY = the drive code table of drive Register C (4700H + drive x 10).
5442
GOSUB to 5460H, function 07H: wait until the controller is not busy; Register A = its status.
5445
RLCA 07
Rotate Register A left one bit (RLCA): bit 7 of the status (NOT READY) to bit 0.
5446
RLCA 07
Rotate Register A left one bit (RLCA): bit 6 of the status (WRITE PROTECT) into the CARRY FLAG and bit 0; NOT READY is now bit 1.
5447
RET C9
RETurn with Index Register IY at the drive's table and the CARRY FLAG set when the diskette is write protected.
5448
POP AF F1
Discard the return address of the CALL 5414H from the stack (POP AF into Register Pair AF).
5449
JUMP to 52ACH to end with Backup aborted: BREAK was pressed at the prompt.
544CH - Clear the Keyboard Request Bits
Clears bits 0-2 of KFLAG$ (BREAK, SHIFT @, ENTER), which the keyboard scan 4DBEH only sets.
544C
LD A,(429FH) 3A 9F 42
Load Register A with KFLAG$ from 429FH, the keyboard flags of SYS0/SYS.
544F
AND F8H E6 F8
Clear bits 2-0 of Register A (AND F8H): ENTER, SHIFT @ and BREAK; the other bits (bit 5 the CAPS lock) are kept.
5451
LD (429FH),A 32 9F 42
Store Register A (the flags without bits 2-0) at KFLAG$, 429FH.
5454
RET C9
RETurn to the caller with bits 0-2 of KFLAG$ cleared.
5455H - The Disk Functions
Eight entries, each loading a function of the drive's driver into Register A, then the common part 5472H: Register B = the function, Register C = the drive number from the drive state at 53D5H (also stored at LDRV$, 4427H), Register A = 20H with the NZ FLAG, and a call through the drive code table at Index Register IY. A drive that is not present (its table starts with C9H, a RET) returns at once with Register A = 20H and the NZ FLAG: error 20H. Callers must have Index Register IY at the drive's table (5439H, 543FH).
5455
XOR A AF
Load Register A with 00H (XOR A), function 00H: the test for a drive that is present (SYS0/SYS's driver returns at once with the Z FLAG).
5456
JUMP to 5472H to call the driver with Register A = 00H, the function.
5458
LD A,01H 3E 01
Load Register A with 01H, function 01H: select the drive. No code of BACKUP calls this entry.
545A
JUMP to 5472H to call the driver with Register A = 01H, the function.
545C
LD A,04H 3E 04
Load Register A with 04H, function 04H: Restore, the head to cylinder 0.
545E
JUMP to 5472H to call the driver with Register A = 04H, the function.
5460
LD A,07H 3E 07
Load Register A with 07H, function 07H: wait until the controller is not busy, with the status in Register A.
5462
JUMP to 5472H to call the driver with Register A = 07H, the function.
5464
LD A,0DH 3E 0D
Load Register A with 0DH, function 0DH: write a sector.
5466
JUMP to 5472H to call the driver with Register A = 0DH, the function.
5468
LD A,0EH 3E 0E
Load Register A with 0EH, function 0EH: write a sector with the deleted data mark, as the directory sectors are written.
546A
JUMP to 5472H to call the driver with Register A = 0EH, the function.
546C
LD A,09H 3E 09
Load Register A with 09H, function 09H: read a sector.
546E
JUMP to 5472H to call the driver with Register A = 09H, the function.
5470
LD A,0AH 3E 0A
Load Register A with 0AH, function 0AH: verify a sector (read it without storing the bytes).
5472
PUSH BC C5
Save Register Pair BC (the caller's value) to the stack: Register B and Register C carry the function and the drive.
5473
LD B,A 47
Copy Register A (the function) into Register B, where the driver takes it.
5474
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H.
5477
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the drive number.
5479
LD C,A 4F
Copy Register A (the drive number) into Register C, where the driver takes it.
547A
LD (4427H),A 32 27 44
Store Register A (the drive number) at 4427H, LDRV$, the drive of the last disk call.
547D
LD A,20H 3E 20
Load Register A with 20H, error 20H: what Register A holds after the call when the drive's table starts with C9H (not present).
547F
OR A B7
Set the flags from Register A (OR A): NZ, CARRY clear.
5480
GOSUB to 5485H to enter the drive code table at Index Register IY.
5483
POP BC C1
Restore Register Pair BC (the caller's value) from the stack; Register A and the flags hold the result.
5484
RET C9
RETurn with the driver's result: the Z FLAG and Register A = 00H on success, else the error number in Register A with the NZ FLAG.
5485
JP (IY) FD E9
JUMP to the address in Index Register IY: the drive code table, whose bytes +00H-+02H are JP to the drive's driver (4583H for SYS0/SYS's), or C9H, a RET.
5487H - The Texts of Both Engines
Texts below 5A00H, so they stay in place when an engine is moved there. 0AH starts a new line, 0DH ends a text and its line, 03H ends a text and leaves the cursor where it is; 1DH puts the cursor at the start of its line and 1EH clears to the end of the line, so the prompts are written over one line again and again (53FEH).
5487
DEFB 0AH 0A
5487H: 0AH, a new line before the note. Displayed by 5292H at the end of a backup and by 52B7H after an error or Backup aborted.
5488-54AF
DEFM "Note: Real time clock no longer accurate" 4E 6F 74 65 3A 20 52 65 61 6C 20 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
5488H-54AFH: the note that the clock lost time: interrupts are off during the transfers of the mirror image engine (5ED2H).
54B0
DEFB 0DH 0D
54B0H: 0DH, the end of the note and of its line.
54B1
DEFB 0AH 0A
54B1H: 0AH, a new line before the text of 5BF2H, displayed through 52AFH when the destination diskette is write protected.
54B2-54D4
DEFM "Destination disk is write protected" 44 65 73 74 69 6E 61 74 69 6F 6E 20 64 69 73 6B 20 69 73 20 77 72 69 74 65 20 70 72 6F 74 65 63 74 65 64
54B2H-54D4H: the text Destination disk is write protected.
54D5
DEFB 0DH 0D
54D5H: 0DH, the end of the text and of its line.
54D6-54D7
DEFB 1DH, 1EH 1D 1E
54D6H-54D7H: 1DH, the cursor to the start of the line, and 1EH, clear to the end of the line: the prompt of 5306H starts on an empty line.
54D8-54F2
DEFM "Insert SYSTEM disk <ENTER>" 49 6E 73 65 72 74 20 53 59 53 54 45 4D 20 64 69 73 6B 20 20 3C 45 4E 54 45 52 3E
54D8H-54F2H: the prompt for the system diskette in drive 0, at the end of an X backup or of a backup on one drive (52F6H).
54F3-54F4
DEFB 1DH, 03H 1D 03
54F3H-54F4H: 1DH, the cursor back to the start of the line, and 03H, the end of the text: 5407H can clear the line from there.
54F5-54F6
DEFB 1DH, 1EH 1D 1E
54F5H-54F6H: 1DH and 1EH, the start of the prompt for the source diskette (531FH, 5B57H, 5B6AH).
54F7-5511
DEFM "Insert SOURCE disk <ENTER>" 49 6E 73 65 72 74 20 53 4F 55 52 43 45 20 64 69 73 6B 20 20 3C 45 4E 54 45 52 3E
54F7H-5511H: the prompt for the source diskette.
5512-5513
DEFB 1DH, 03H 1D 03
5512H-5513H: 1DH, the cursor to the start of the line, and 03H, the end of the text.
5514-5515
DEFB 1DH, 1EH 1D 1E
5514H-5515H: 1DH and 1EH, the start of the prompt for the destination diskette (538CH, 5BD2H, 5C05H).
5516-5535
DEFM "Insert DESTINATION disk <ENTER>" 49 6E 73 65 72 74 20 44 45 53 54 49 4E 41 54 49 4F 4E 20 64 69 73 6B 20 20 3C 45 4E 54 45 52 3E
5516H-5535H: the prompt for the destination diskette.
5536-5537
DEFB 1DH, 03H 1D 03
5536H-5537H: 1DH, the cursor to the start of the line, and 03H, the end of the text.
5538-5539
DEFB 1DH, 1EH 1D 1E
5538H-5539H: 1DH and 1EH, the start of the text of 5378H on the prompt's line.
553A-5568
DEFM "* A L E R T * That's not the same source disk!" 2A 20 41 20 4C 20 45 20 52 20 54 20 2A 20 20 54 68 61 74 27 73 20 6E 6F 74 20 74 68 65 20 73 61 6D 65 20 73 6F 75 72 63 65 20 64 69 73 6B 21
553AH-5568H: the text of 5378H, for a source diskette whose pack identity (allocation table +CEH-+D7H) is not the one read at the start.
5569
DEFB 0DH 0D
5569H: 0DH, the end of the text and of its line.
556A-556B
DEFB 1DH, 1EH 1D 1E
556AH-556BH: 1DH and 1EH, the start of the text of 53C0H on the prompt's line.
556C-559F
DEFM "* A L E R T * That's not the same destination disk!" 2A 20 41 20 4C 20 45 20 52 20 54 20 2A 20 20 54 68 61 74 27 73 20 6E 6F 74 20 74 68 65 20 73 61 6D 65 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 64 69 73 6B 21
556CH-559FH: the text of 53C0H, for a destination diskette whose boot sector does not start with 76H.
55A0
DEFB 0DH 0D
55A0H: 0DH, the end of the text and of its line.
55A1-55D5
DEFM "Source disk is write protected, can't clear mod flags" 53 6F 75 72 63 65 20 64 69 73 6B 20 69 73 20 77 72 69 74 65 20 70 72 6F 74 65 63 74 65 64 2C 20 63 61 6E 27 74 20 63 6C 65 61 72 20 6D 6F 64 20 66 6C 61 67 73
55A1H-55D5H: the text of the mirror image engine (6136H, run 5D36H) and of the file by file engine (6810H, run 5F10H) when the source diskette's directory cannot be written to clear the bits that mark the files changed.
55D6
DEFB 0DH 0D
55D6H: 0DH, the end of the text and of its line.
55D7
DEFB 0AH 0A
55D7H: 0AH, a new line before Backup complete (5287H).
55D8-55E6
DEFM "Backup complete" 42 61 63 6B 75 70 20 63 6F 6D 70 6C 65 74 65
55D8H-55E6H: the text of 5287H at the end of a backup.
55E7
DEFB 0DH 0D
55E7H: 0DH, the end of the text and of its line.
55E8
DEFB 0AH 0A
55E8H: 0AH, a new line before Backup aborted (52ACH).
55E9-55F6
DEFM "Backup aborted" 42 61 63 6B 75 70 20 61 62 6F 72 74 65 64
55E9H-55F6H: the text of 52ACH, displayed by @LOGOT.
55F7
DEFB 0DH 0D
55F7H: 0DH, the end of the text and the last byte of the second load block.
55F8H - The Buffers Below 5A00H
Memory not in the file, used by the front end and both engines: the bytes kept from the source's boot sector, the two allocation tables and a sector buffer. In the file by file engine 5800H holds the directory sector of the source being scanned.
55F8-5609
DEFS 18
55F8H-5609H: not in the file. Bytes 09H-0AH (55F8H-55F9H) and 16H-25H (55FAH-5609H) of the source's boot sector, kept by 5B95H and 5B9BH; the mirror image engine puts them in the destination's boot sector (5E69H, 5E6FH) when its cylinder 0 is in single density.
560A-56FF
DEFS 246
560AH-56FFH: not in the file. No instruction addresses these bytes.
5700-57FF
DEFS 256
5700H-57FFH: not in the file. The source's allocation table, read by 5BA9H: 5700H + cylinder the granules in use, 5760H + cylinder the lock out table, 57CCH-57CDH the cylinders less 35 and the configuration byte, 57CEH-57CFH the master password hash, 57D0H-57D7H the name, 57CEH-57FFH copied to the destination by 604DH.
5800-58FF
DEFS 256
5800H-58FFH: not in the file. The destination's allocation table, read by 5C37H, rebuilt by the mirror image engine (5EFFH) and written by 6066H; the file by file engine reads the destination's boot sector here (6348H) and then each directory sector of the source (641DH).
5900-59FF
DEFS 256
5900H-59FFH: not in the file. The sector buffer: the boot sectors (5342H, 53AFH, 5B87H, 5C29H, 5E53H, 60ADH), the allocation table read back at 535CH, the sector of E5H bytes (60F3H) and the 8 characters of a password (6C75H, 6C94H).
5A00H - The Front End: the Partspec and the Drives
The transfer address. LDOS runs BACKUP with Register Pair HL at the command line after the command's name. The stack goes to 41E5H, the banner is shown, and the line is read: a minus sign (all files but those named), the file name and the extension of the partspec into 5205H-520FH, then :d, the source drive, and :d, the destination drive. A drive that is not given is asked for (one character), and then the rest of the line is not read: the reply buffer takes the place of the command line.
5A00
LD SP,41E5H 31 E5 41
Load the Stack Pointer with 41E5H: the stack of BACKUP lies below 41E5H (the printer driver of SYS0/SYS starts there), in the memory LDOS keeps for it, away from the work area that runs up to HIGH$.
5A03
PUSH HL E5
Save Register Pair HL (the pointer to the command line LDOS gave) to the stack while the banner is displayed.
5A04
LD HL,6E58H 21 58 6E
Point Register Pair HL to 6E58H, the banner: a new line, BACKUP - LDOS Disk Backup Utility - Version 5.3.1, a new line, the copyright, a new line and 0DH.
5A07
GOSUB to 4467H, @DSPLY, to display the banner at Register Pair HL (6E58H).
5A0A
POP HL E1
Restore Register Pair HL (the pointer to the command line) from the stack.
5A0B
LD A,(HL) 7E
Load Register A with the character at Register Pair HL, the command line.
5A0C
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5A0D
CP 20H FE 20
Compare Register A against 20H, a space: the Z FLAG for a space before the partspec.
5A0F
If the Z FLAG is set (a space), LOOP BACK to 5A0BH to take the next character.
5A11
LD DE,5205H 11 05 52
Point Register Pair DE to 5205H, the 8 characters of the file name of the partspec.
5A14
LD B,08H 06 08
Load Register B with 08H, the most characters 5CB1H takes for the file name.
5A16
CP 2DH FE 2D
Compare Register A (the first character after the spaces) against 2DH, a minus sign.
5A18
If the NZ FLAG is set (no minus sign), JUMP to 5A1FH with the character in Register A.
5A1A
LD (5211H),A 32 11 52
Store Register A (2DH) at 5211H, the exclusion flag: the files that match the partspec are the ones not copied.
5A1D
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL, after the minus sign.
5A1E
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5A1F
GOSUB to 5CB1H to copy the characters from Register A and Register Pair HL to the file name at Register Pair DE (5205H), at most Register B (8); Register A comes back with the character that ended it.
5A22
CP 2FH FE 2F
Compare Register A (the character that ended the name) against 2FH, a slash: the extension follows.
5A24
If the NZ FLAG is set (no slash), JUMP to 5A30H.
5A26
LD DE,520DH 11 0D 52
Point Register Pair DE to 520DH, the 3 characters of the extension of the partspec.
5A29
LD B,03H 06 03
Load Register B with 03H, the most characters of the extension.
5A2B
LD A,(HL) 7E
Load Register A with the character at Register Pair HL, the first one after the slash.
5A2C
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5A2D
GOSUB to 5CB1H to copy the extension from Register A and Register Pair HL to Register Pair DE (520DH), at most Register B (3).
5A30
CP 3AH FE 3A
Compare Register A (the character that ended the partspec) against 3AH, a colon: the source drive follows.
5A32
If the Z FLAG is set (a colon), JUMP to 5A45H to read the drive's digit at Register Pair HL.
5A34
LD HL,6EBEH 21 BE 6E
Point Register Pair HL to 6EBEH, the question Source drive number ? (spaces after it, 03H at the end).
5A37
GOSUB to 4467H, @DSPLY, to display the question at Register Pair HL (6EBEH).
5A3A
LD HL,525DH 21 5D 52
Point Register Pair HL to 525DH, the buffer of the reply.
5A3D
LD B,01H 06 01
Load Register B with 01H: the reply is one character.
5A3F
GOSUB to 0040H, the ROM's line input: up to Register B (1) characters at Register Pair HL (525DH), ended by 0DH; Register Pair HL comes back at 525DH, the CARRY FLAG for BREAK.
5A42
If the CARRY FLAG is set (BREAK), JUMP to 52ACH: Backup aborted.
5A45
LD A,(HL) 7E
Load Register A with the source drive's digit at Register Pair HL (after the colon, or 525DH).
5A46
INC HL 23
INCrement Register Pair HL past the digit just taken into Register A (to 525EH after a reply).
5A47
SUB 30H D6 30
SUBtract 30H from Register A: the digit's value; a character below 30H gives a value of 0D0H or more.
5A49
CP 08H FE 08
Compare Register A against 08H: the CARRY FLAG for a drive 0-7.
5A4B
If the NO CARRY FLAG is set (not a drive 0-7), JUMP to 529EH: error 20H, Illegal drive number.
5A4E
LD (531BH),A 32 1B 53
Store Register A (the source drive) at 531BH, the operand of LD A at 531AH.
5A51
LD A,(HL) 7E
Load Register A with the character at Register Pair HL, the rest of the command line (or the 0DH of the reply).
5A52
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5A53
CP 3AH FE 3A
Compare Register A against 3AH, a colon: the destination drive follows.
5A55
If the Z FLAG is set (a colon), JUMP to 5A70H to read the digit at Register Pair HL.
5A57
CP 30H FE 30
Compare Register A against 30H: the NO CARRY FLAG for any character from 30H up.
5A59
If the NO CARRY FLAG is set (30H or above), LOOP BACK to 5A51H: the character is passed over.
5A5B
CP 20H FE 20
Compare Register A (a character below 30H) against 20H, a space, which is passed over.
5A5D
If the Z FLAG is set (a space), LOOP BACK to 5A51H to take the next character.
5A5F
LD HL,6EDCH 21 DC 6E
Point Register Pair HL to 6EDCH, the question Destination drive number ? (any other character below 30H, the 0DH at the end of the line or the bracket of the parameters, comes before a colon).
5A62
GOSUB to 4467H, @DSPLY, to display the question at Register Pair HL (6EDCH).
5A65
LD HL,525DH 21 5D 52
Point Register Pair HL to 525DH, the buffer of the reply.
5A68
LD B,01H 06 01
Load Register B with 01H: the reply is one character.
5A6A
GOSUB to 0040H, the ROM's line input: up to Register B (1) characters at Register Pair HL (525DH); the CARRY FLAG for BREAK.
5A6D
If the CARRY FLAG is set (BREAK), JUMP to 52ACH: Backup aborted.
5A70
LD A,(HL) 7E
Load Register A with the destination drive's digit at Register Pair HL (after the colon, or 525DH).
5A71
INC HL 23
INCrement Register Pair HL past the digit just taken into Register A. After a reply it points to 525EH, where the ROM put 0DH: @PARAM then finds no parameters.
5A72
SUB 30H D6 30
SUBtract 30H from Register A: the digit's value, the CARRY FLAG for a character below 30H.
5A74
If the CARRY FLAG is set (not a digit), JUMP to 529EH: error 20H, Illegal drive number.
5A77
CP 08H FE 08
Compare Register A against 08H: the CARRY FLAG for a drive 0-7.
5A79
If the NO CARRY FLAG is set (8 or more), JUMP to 529EH: error 20H, Illegal drive number.
5A7C
LD (5388H),A 32 88 53
Store Register A (the destination drive) at 5388H, the operand of LD A at 5387H.
5A7FH - The Parameters, One Drive, the DATE Parameter
@PARAM reads the parameters with the table at 6D74H (MPW, SYS, INV, MOD, QUERY, X, DATE, NEW, OLD and their short forms). Source and destination on one drive are refused during a JCL job. A DATE text (the address of its first character is in the cell 5AA2H) gives the first date at 5201H and the second at 5203H, with the mode at 5200H: 80H M/D/Y-, 01H -M/D/Y, 81H M/D/Y or M1/D1/Y1-M2/D2/Y2 (a single date is stored as both). Then the attribute byte at 5210H from SYS and INV.
5A7F
LD DE,6D74H 11 74 6D
Point Register Pair DE to 6D74H, the table of the parameters: 16 entries of a name of 6 characters and the address of its cell, then 00H.
5A82
GOSUB to 4454H, @PARAM, to read the parameters at Register Pair HL against the table at Register Pair DE (6D74H): the cell of a parameter given gets FFFFH (0000H for =N), or the address of its text for a quoted value. The Z FLAG on success.
5A85
LD A,2CH 3E 2C
Load Register A with 2CH, error 2CH, Parameter error. LD does not change the flags of @PARAM.
5A87
If the NZ FLAG is set (@PARAM refused the parameters), JUMP to 52A0H to give the error in Register A (2CH) through @ERROR.
5A8A
LD A,(531BH) 3A 1B 53
Load Register A with the source drive at 531BH.
5A8D
LD HL,5388H 21 88 53
Point Register Pair HL to 5388H, the destination drive.
5A90
XOR (HL) AE
Exclusive OR the destination drive at Register Pair HL (5388H) into Register A: 00H, and the Z FLAG, when both are one drive.
5A91
LD (53DCH),A 32 DC 53
Store Register A (the source drive XOR the destination drive) at 53DCH, the operand of LD A at 53DBH: not 00H means two drives, and 53D4H then only selects the drive (53CEH, from 5B5AH and 5BD5H with X, asks all the same, and 52D0H stores 00H here for the system diskette at the end).
5A94
If the NZ FLAG is set (two drives), JUMP to 5AA1H.
5A96
LD A,(442BH) 3A 2B 44
Load Register A with SFLAG$ from 442BH, the system flags.
5A99
BIT 5,A CB 6F
Test bit 5 of Register A: set while a JCL job runs.
5A9B
LD HL,6DF5H 21 F5 6D
Point Register Pair HL to 6DF5H, the text Single drive backup invalid during <DO> processing.
5A9E
If the NZ FLAG is set (a JCL job runs, and the backup would wait at the prompts), JUMP to 52AFH to end with the text at Register Pair HL (6DF5H).
5AA1
LD HL,0000H 21 00 00
Load Register Pair HL with the operand at 5AA2H-5AA3H, the cell of the DATE and D parameters (@PARAM table 6DC4H, 6DCCH): 0000H in the file, the address of the DATE text when given.
5AA4
LD A,H 7C
Copy Register H (the high byte of the DATE cell) into Register A.
5AA5
OR L B5
OR Register L into Register A: the Z FLAG when Register Pair HL is 0000H (no DATE).
5AA6
If the Z FLAG is set (no DATE), JUMP to 5AD7H; the DATE mode at 5200H stays 00H.
5AA8
LD A,(HL) 7E
Load Register A with the first character of the DATE text at Register Pair HL.
5AA9
CP 2DH FE 2D
Compare Register A against 2DH, a minus sign: -M/D/Y, the files dated up to that date.
5AAB
If the Z FLAG is set (a minus sign first), JUMP to 5AC2H to read the date after it as the second date.
5AAD
LD A,80H 3E 80
Load Register A with 80H, bit 7: a first date is given.
5AAF
LD (5200H),A 32 00 52
Store Register A (80H) at 5200H, the DATE mode.
5AB2
GOSUB to 5CCCH to read M/D/Y at Register Pair HL: Register Pair BC = the date packed, Register Pair HL after it.
5AB5
LD (5201H),BC ED 43 01 52
Store Register Pair BC (the first date, packed) at 5201H-5202H.
5AB9
LD A,(HL) 7E
Load Register A with the character after the date at Register Pair HL.
5ABA
CP 22H FE 22
Compare Register A against 22H, the closing quote: a single date.
5ABC
If the Z FLAG is set (a single date), JUMP to 5ACBH to store it as the second date too (Register Pair BC).
5ABE
CP 2DH FE 2D
Compare Register A against 2DH, a minus sign.
5AC0
If the NZ FLAG is set (any other character: the rest of the text is passed over), JUMP to 5AD7H with the mode 80H, the files from the first date on.
5AC2
INC HL 23
INCrement Register Pair HL past the minus sign.
5AC3
LD A,(HL) 7E
Load Register A with the character after the minus sign at Register Pair HL.
5AC4
CP 22H FE 22
Compare Register A against 22H, the closing quote: M/D/Y- with no second date.
5AC6
If the Z FLAG is set (the quote), JUMP to 5AD7H: the mode stays 80H (after M/D/Y-) or 00H (a text of only a minus sign).
5AC8
GOSUB to 5CCCH to read the second M/D/Y at Register Pair HL into Register Pair BC, packed.
5ACB
LD A,(5200H) 3A 00 52
Load Register A with the DATE mode at 5200H (80H after a first date, 00H after a leading minus sign).
5ACE
OR 01H F6 01
Set bit 0 in Register A (OR 01H): a second date is given.
5AD0
LD (5200H),A 32 00 52
Store Register A (the DATE mode, now with bit 0 set) at 5200H.
5AD3
LD (5203H),BC ED 43 03 52
Store Register Pair BC (the second date, packed) at 5203H-5204H.
5AD7
LD B,00H 06 00
Load Register B with 00H, the attribute selection byte to be built.
5AD9
LD DE,(521BH) ED 5B 1B 52
Load Register Pair DE with the cell of SYS at 521BH-521CH: FFFFH when given.
5ADD
LD A,D 7A
Copy Register D (the high byte of the SYS cell) into Register A.
5ADE
OR E B3
OR Register E into Register A: the Z FLAG when the cell is 0000H.
5ADF
If the Z FLAG is set (no SYS), JUMP to 5AE3H.
5AE1
SET 6,B CB F0
Set bit 6 in Register B: the bit of a system file in a directory record's attribute byte (+00H).
5AE3
LD DE,0000H 11 00 00
Load Register Pair DE with the operand at 5AE4H-5AE5H, the cell of the INV and I parameters (@PARAM table 6D8CH, 6D94H): 0000H in the file, FFFFH when given.
5AE6
LD A,D 7A
Copy Register D (the high byte of the INV cell) into Register A.
5AE7
OR E B3
OR Register E into Register A: the Z FLAG when the cell is 0000H.
5AE8
If the Z FLAG is set (no INV), JUMP to 5AECH.
5AEA
SET 3,B CB D8
Set bit 3 in Register B: the bit of an invisible file in a directory record's attribute byte.
5AEC
LD DE,0000H 11 00 00
Load Register Pair DE with the operand at 5AEDH-5AEEH, 0000H. No entry of the parameter table points at this cell and no code writes it, so it stays 0000H.
5AEF
LD A,D 7A
Copy Register D (the high byte of the cell at 5AEDH, 00H) into Register A.
5AF0
OR E B3
OR Register E into Register A: the Z FLAG, always, since 5AEDH holds 0000H.
5AF1
If the Z FLAG is set (always), JUMP to 5AF5H.
5AF3
SET 4,B CB E0
Set bit 4 in Register B: never reached, since the cell at 5AEDH is 0000H.
5AF5
LD A,B 78
Copy Register B (the attribute selection byte) into Register A.
5AF6
LD (5210H),A 32 10 52
Store Register A (the attribute selection byte) at 5210H, for the file by file engine (6446H, run 5B46H).
5AF9H - Backup by Class, the Date, the Source Diskette
Any partspec or any of SYS, INV, MOD, DATE, NEW, OLD, QUERY gives a backup by class: an OR of their first bytes (the extension's and file name's first character less 20H) goes to 6C01H, the operand of LD A at the engine selector, and Backup by class invoked is shown. X and MPW do not count. The date of the system goes to 527DH as text; SYS2/SYS is loaded; then the source diskette is asked for when needed and its drive must answer (6CBFH).
5AF9
LD A,(5205H) 3A 05 52
Load Register A with the first character of the file name at 5205H (20H, a space, when no name was given).
5AFC
SUB 20H D6 20
SUBtract 20H from Register A: 00H for a space, not 00H for any character of a name.
5AFE
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5AFF
LD A,(520DH) 3A 0D 52
Load Register A with the first character of the extension at 520DH (20H when none was given).
5B02
SUB 20H D6 20
SUBtract 20H from Register A: 00H for a space.
5B04
OR B B0
OR Register B (the selections so far) into Register A.
5B05
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B06
LD A,(521BH) 3A 1B 52
Load Register A with the low byte of the SYS cell at 521BH (FFH when SYS was given).
5B09
OR B B0
OR Register B (the selections so far) into Register A.
5B0A
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B0B
LD A,(5AE4H) 3A E4 5A
Load Register A with the low byte of the INV cell at 5AE4H (the operand of LD DE at 5AE3H).
5B0E
OR B B0
OR Register B (the selections so far) into Register A.
5B0F
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B10
LD A,(5AEDH) 3A ED 5A
Load Register A with the byte at 5AEDH (the operand of LD DE at 5AECH): 00H, since nothing writes it.
5B13
OR B B0
OR Register B (the selections so far) into Register A.
5B14
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B15
LD A,(5217H) 3A 17 52
Load Register A with the low byte of the MOD cell at 5217H (FFH when MOD was given).
5B18
OR B B0
OR Register B (the selections so far) into Register A.
5B19
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B1A
LD A,(5AA2H) 3A A2 5A
Load Register A with the low byte of the DATE cell at 5AA2H (the low byte of the address of its text, not 00H when DATE was given, but for a text at a page boundary).
5B1D
OR B B0
OR Register B (the selections so far) into Register A.
5B1E
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B1F
LD A,(5213H) 3A 13 52
Load Register A with the low byte of the NEW cell at 5213H (FFH when NEW was given).
5B22
OR B B0
OR Register B (the selections so far) into Register A.
5B23
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B24
LD A,(5215H) 3A 15 52
Load Register A with the low byte of the OLD cell at 5215H (FFH when OLD was given).
5B27
OR B B0
OR Register B (the selections so far) into Register A.
5B28
LD B,A 47
Copy Register A into Register B, the OR of the selections.
5B29
LD A,(521AH) 3A 1A 52
Load Register A with the high byte of the QUERY cell at 521AH (FFH when QUERY was given).
5B2C
OR B B0
OR Register B (the selections so far) into Register A: not 00H for a backup by class.
5B2D
LD (6C01H),A 32 01 6C
Store Register A (the OR of the selections) at 6C01H, the operand of LD A at 6C00H: the engine selector moves the file by file engine for any value but 00H.
5B30
LD HL,6F0EH 21 0E 6F
Point Register Pair HL to 6F0EH, the text Backup by class invoked. LD does not change the flags of the OR.
5B33
If the NZ FLAG is set (a selection was given), GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL (6F0EH) and write it to the job log.
5B36
LD A,(421CH) 3A 1C 42
Load Register A with the month of the system date at 421CH: 00H while no date has been set.
5B39
OR A B7
Set the flags from Register A (OR A): the Z FLAG when the month is 00H.
5B3A
LD HL,6EFAH 21 FA 6E
Point Register Pair HL to 6EFAH, the text No date established. LD does not change the flags.
5B3D
If the Z FLAG is set (no date), GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL (6EFAH); the backup goes on.
5B40
LD HL,527DH 21 7D 52
Point Register Pair HL to 527DH, 8 bytes for the date.
5B43
GOSUB to 3033H, @DATE, the ROM's date routine on the Model III (JP 35BBH; the Model I file calls the LDOS vector 4470H), to store the system date as MM/DD/YY at Register Pair HL (527DH-5284H): the date the mirror image engine gives the destination (604FH, run 5C4FH).
5B46
GOSUB to 6C6EH, request 84H: SYS2/SYS is loaded into the overlay area while the system diskette is still in drive 0, and returns at once.
5B49
LD A,(531BH) 3A 1B 53
Load Register A with the source drive at 531BH.
5B4C
OR A B7
Set the flags from Register A (OR A): the Z FLAG for drive 0, the drive of the system diskette.
5B4D
If the NZ FLAG is set (not drive 0), JUMP to 5B5EH; the NZ FLAG makes it call 531AH.
5B4F
OR 80H F6 80
Set bit 7 in Register A (OR 80H): 80H, the drive state of the source diskette in drive 0.
5B51
LD C,A 4F
Copy Register A (80H) into Register C for 53CEH.
5B52
LD A,(52CAH) 3A CA 52
Load Register A with the low byte of the X cell at 52CAH: FFH when X was given (the system diskette may be taken out of drive 0).
5B55
INC A 3C
INCrement Register A: 00H, and the Z FLAG, for X.
5B56
PUSH AF F5
Save Register Pair AF (the Z FLAG of the X test) to the stack.
5B57
LD HL,54F5H 21 F5 54
Point Register Pair HL to 54F5H, the prompt Insert SOURCE disk <ENTER>.
5B5A
If the Z FLAG is set (X with the source in drive 0), GOSUB to 53CEH: the drive state Register C (80H) is stored and the prompt flashes until ENTER.
5B5D
POP AF F1
Restore Register Pair AF (the flags of the X test) from the stack.
5B5E
If the NZ FLAG is set (no X, or not drive 0, or the drive did not answer at 5B67H), GOSUB to 531AH to select the source drive, asking for the diskette when source and destination are one drive.
5B61
GOSUB to 545CH, function 04H: Restore, the source drive's head to cylinder 0 (Index Register IY at its drive code table).
5B64
GOSUB to 6CBFH to test the source drive: present, turning (index holes), its allocation table readable; it sets the drive's table from the diskette. The Z FLAG on success.
5B67
If the Z FLAG is set (the source drive answered), JUMP to 5B73H.
5B69
PUSH AF F5
Save Register Pair AF (the NZ FLAG of the failure) to the stack.
5B6A
LD HL,54F5H 21 F5 54
Point Register Pair HL to 54F5H, the prompt Insert SOURCE disk <ENTER>.
5B6D
GOSUB to 53CEH to show the prompt at Register Pair HL until ENTER; Register C still holds the drive state 6CBFH took from 53D5H (6CC2H).
5B70
POP AF F1
Restore Register Pair AF (the NZ FLAG) from the stack.
5B71
LOOP BACK to 5B5EH to select the source drive and test it again.
5B73H - The Source Diskette's Boot Sector and Allocation Table
The source drive is size tested (bit 5 of +03H, 8 inch, kept at 5C14H), its boot sector is read: bytes 09H-0AH (the operand of the boot sector's LD IY) and 16H-25H go to 55F8H-5609H for the mirror image engine, byte 02H, the directory cylinder, goes to the drive's table. The allocation table is read into 5700H, the master password is checked, the drive's table is set from the allocation table again, and the date conversion count (5212H) gets FFH when the source's date flag bit is clear.
5B73
LD A,(IY+03H) FD 7E 03
Load Register A with +03H of the drive code table at Index Register IY (the source drive): the drive's flags.
5B76
AND 20H E6 20
Mask Register A to bit 5 (AND 20H): 20H for an 8 inch drive.
5B78
LD (5C14H),A 32 14 5C
Store Register A (20H or 00H) at 5C14H, the operand of XOR at 5C13H, for the test of the destination's size.
5B7B
GOSUB to 5455H, function 00H: test that the source drive is present.
5B7E
If the NZ FLAG is set (not present: Register A = 20H), JUMP to 52A0H to give the error in Register A.
5B81
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0, the boot sector.
5B84
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
5B87
GOSUB to 546CH, function 09H, to read cylinder Register D sector Register E into Register Pair HL (5900H).
5B8A
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
5B8D
LD L,09H 2E 09
Load Register L with 09H: Register Pair HL = 5909H, byte 09H of the boot sector (Register H is 59H).
5B8F
LD DE,55F8H 11 F8 55
Point Register Pair DE to 55F8H, where the bytes of the source's boot sector are kept.
5B92
LD BC,0002H 01 02 00
Load Register Pair BC with 0002H, the count of bytes for the first copy: 2 bytes.
5B95
LDIR ED B0
Copy Register Pair BC (2) bytes from Register Pair HL (5909H-590AH) to Register Pair DE (55F8H-55F9H) (LDIR): the operand of the boot sector's LD IY,0000H at its 07H. Register Pair DE ends at 55FAH, Register Pair BC at 0000H.
5B97
LD L,16H 2E 16
Load Register L with 16H: Register Pair HL = 5916H, byte 16H of the boot sector.
5B99
LD C,10H 0E 10
Load Register C with 10H: Register Pair BC = 0010H (Register B is 00H after the LDIR), 16 bytes.
5B9B
LDIR ED B0
Copy Register Pair BC (16) bytes from Register Pair HL (5916H-5925H) to Register Pair DE (55FAH-5609H) (LDIR): bytes 16H-25H of the boot sector.
5B9D
LD A,(5902H) 3A 02 59
Load Register A with byte 02H of the boot sector at 5902H: the source diskette's directory cylinder.
5BA0
LD (IY+09H),A FD 77 09
Store Register A (the directory cylinder) at +09H of the drive code table at Index Register IY.
5BA3
LD D,A 57
Copy Register A (the directory cylinder) into Register D, the cylinder to read.
5BA4
LD E,00H 1E 00
Load Register E with 00H: sector 0 of the directory cylinder, the allocation table.
5BA6
LD HL,5700H 21 00 57
Point Register Pair HL to 5700H, the buffer of the source diskette's allocation table.
5BA9
GOSUB to 546CH, function 09H, to read cylinder Register D sector Register E into Register Pair HL (5700H).
5BAC
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
5BAE
If the NZ FLAG is set (not 06H), JUMP to 529BH: error 11H, Directory read error.
5BB1
GOSUB to 5C89H to check the master password of the source diskette (its allocation table at 5700H).
5BB4
GOSUB to 6CBFH to set the source drive's table from the diskette again. Its result is not tested.
5BB7
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H (the source drive in bits 2-0).
5BBA
GOSUB to 6D61H to test bit (drive) of 475DH, which 6CBFH set from bit 3 of the allocation table's configuration byte: the NZ FLAG when it is set.
5BBD
If the NZ FLAG is set (the source has the date format of this release), JUMP to 5BC4H.
5BBF
LD A,FFH 3E FF
Load Register A with FFH, the date conversion count for a source without the date flag.
5BC1
LD (5212H),A 32 12 52
Store Register A (FFH) at 5212H, the date conversion count.
5BC4
LD A,(5388H) 3A 88 53
Load Register A with the destination drive at 5388H.
5BC7
OR A B7
Set the flags from Register A (OR A): the Z FLAG for drive 0.
5BC8
If the NZ FLAG is set (not drive 0), JUMP to 5BD9H; the NZ FLAG makes it call 5387H.
5BCA
OR 40H F6 40
Set bit 6 in Register A (OR 40H): 40H, the drive state of the destination diskette in drive 0.
5BCC
LD C,A 4F
Copy Register A (40H) into Register C for 53CEH.
5BCD
LD A,(52CAH) 3A CA 52
Load Register A with the low byte of the X cell at 52CAH: FFH when X was given.
5BD0
INC A 3C
INCrement Register A: 00H, and the Z FLAG, for X.
5BD1
PUSH AF F5
Save Register Pair AF (the Z FLAG of the X test) to the stack.
5BD2
LD HL,5514H 21 14 55
Point Register Pair HL to 5514H, the prompt Insert DESTINATION disk <ENTER>.
5BD5
If the Z FLAG is set (X with the destination in drive 0), GOSUB to 53CEH: the drive state Register C (40H) is stored and the prompt flashes until ENTER.
5BD8
POP AF F1
Restore Register Pair AF (the flags of the X test) from the stack.
5BD9
If the NZ FLAG is set (no X, or not drive 0, or the drive did not answer), GOSUB to 5387H to select the destination drive, asking for the diskette on one drive.
5BDC
LD A,(IY+03H) FD 7E 03
Load Register A with +03H of the drive code table at Index Register IY (the destination drive): its flags.
5BDF
BIT 3,A CB 5F
Test bit 3 of Register A: set for a hard disk.
5BE1
If the NZ FLAG is set (a hard disk), JUMP to 5C69H: a backup reconstruct, by the file by file engine.
5BE4
GOSUB to 545CH, function 04H: Restore, the destination drive's head to cylinder 0.
5BE7
GOSUB to 5455H, function 00H: test that the destination drive is present; Register A = 00H with the Z FLAG when it is.
5BEA
If the NZ FLAG is set (not present), JUMP to 5C04H to ask for the destination diskette.
5BEC
RLCA 07
Rotate Register A (00H after function 00H) left one bit (RLCA): still 00H.
5BED
OR (IY+03H) FD B6 03
OR +03H of the drive code table at Index Register IY into Register A: the drive's flags.
5BF0
BIT 7,A CB 7F
Test bit 7 of Register A: bit 7 of +03H, the drive is write protected by LDOS.
5BF2
LD HL,54B1H 21 B1 54
Point Register Pair HL to 54B1H, the text Destination disk is write protected. LD does not change the flags.
5BF5
If the NZ FLAG is set (write protected), JUMP to 52AFH to end with the text at Register Pair HL (54B1H).
5BF8
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of +03H of the drive code table at Index Register IY: set for a hard disk.
5BFC
If the NZ FLAG is set (a hard disk), JUMP to 5C69H: a backup reconstruct.
5BFF
GOSUB to 6CBFH to test the destination drive (present, turning, its allocation table readable) and set its table from the diskette. The CARRY FLAG it returns (write protected) is not tested.
5C02
If the Z FLAG is set (the destination answered), JUMP to 5C0EH.
5C04
PUSH AF F5
Save Register Pair AF (the NZ FLAG of the failure) to the stack.
5C05
LD HL,5514H 21 14 55
Point Register Pair HL to 5514H, the prompt Insert DESTINATION disk <ENTER>.
5C08
GOSUB to 53CEH to store Register C at 53D5H and show the prompt at Register Pair HL until ENTER. Register C holds the drive state after 6CBFH (6CC2H), but only the drive number after 5455H (5439H), so 5387H then finds a different state and asks once more on one drive.
5C0B
POP AF F1
Restore Register Pair AF (the NZ FLAG) from the stack.
5C0C
LOOP BACK to 5BD9H to select the destination drive and test it again.
5C0EH - Mirror Image or Reconstruct
A mirror image copy needs the same drive size (bit 5 of +03H), a destination that can be verified at cylinder 0 sector 0 (else Destination disk not formatted - Backup aborted), and the same bits 6-4 of the configuration byte (+CDH) in both allocation tables: double density, two sides, cylinder 0 in single density. The destination's allocation table goes to 5800H. With different cylinder counts (+CCH) the operator is asked; a backup by class always takes the file by file engine. A backup reconstruct is the file by file engine without a selection.
5C0E
LD A,(IY+03H) FD 7E 03
Load Register A with +03H of the drive code table at Index Register IY (the destination drive): its flags.
5C11
AND 20H E6 20
Mask Register A to bit 5 (AND 20H): 20H for an 8 inch drive.
5C13
XOR 00H EE 00
Exclusive OR the operand at 5C14H (the source's bit 5, stored by 5B78H) into Register A: not 00H when the sizes differ.
5C15
If the NZ FLAG is set (a 5 inch and an 8 inch drive), JUMP to 5C69H: a backup reconstruct.
5C18
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0.
5C1B
GOSUB to 5470H, function 0AH, to verify cylinder Register D sector Register E of the destination.
5C1E
LD HL,6E28H 21 28 6E
Point Register Pair HL to 6E28H, the text Destination disk not formatted - Backup aborted. LD does not change the flags.
5C21
If the NZ FLAG is set (the sector cannot be verified), JUMP to 52AFH to end with the text at Register Pair HL (6E28H).
5C24
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
5C27
LD D,L 55
Copy Register L (00H) into Register D: cylinder 0.
5C28
LD E,L 5D
Copy Register L (00H) into Register E: sector 0, the boot sector.
5C29
GOSUB to 546CH, function 09H, to read the destination's boot sector (cylinder Register D, sector Register E) into Register Pair HL (5900H).
5C2C
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
5C2F
LD A,(5902H) 3A 02 59
Load Register A with byte 02H of the boot sector at 5902H: the destination's directory cylinder.
5C32
LD D,A 57
Copy Register A (the directory cylinder) into Register D, the cylinder to read.
5C33
LD HL,5800H 21 00 58
Point Register Pair HL to 5800H, the buffer of the destination's allocation table.
5C36
LD E,L 5D
Copy Register L (00H) into Register E: sector 0 of the directory cylinder.
5C37
GOSUB to 546CH, function 09H, to read cylinder Register D sector Register E into Register Pair HL (5800H).
5C3A
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
5C3C
If the NZ FLAG is set (not 06H), JUMP to 529BH: error 11H, Directory read error.
5C3F
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H (the destination drive in bits 2-0).
5C42
GOSUB to 6D61H to test bit (drive) of 475DH, set by 6CBFH from the destination's date flag: the NZ FLAG when it is set.
5C45
If the Z FLAG is set (the destination has no date flag), JUMP to 5C4BH.
5C47
LD HL,5212H 21 12 52
Point Register Pair HL to 5212H, the date conversion count.
5C4A
INC (HL) 34
INCrement the byte at Register Pair HL (5212H): FFH (a source without the flag) becomes 00H, FEH becomes FFH.
5C4B
LD HL,(57CCH) 2A CC 57
Load Register Pair HL with +CCH-+CDH of the source's allocation table at 57CCH: Register L the cylinders less 35, Register H the configuration byte.
5C4E
LD DE,(58CCH) ED 5B CC 58
Load Register Pair DE with +CCH-+CDH of the destination's allocation table at 58CCH: Register E the cylinders less 35, Register D the configuration byte.
5C52
LD A,H 7C
Copy Register H (the source's configuration byte) into Register A.
5C53
XOR D AA
Exclusive OR Register D (the destination's configuration byte) into Register A: the bits that differ.
5C54
AND 70H E6 70
Mask Register A to bits 6-4 (AND 70H): double density, two sides, cylinder 0 in single density.
5C56
If the NZ FLAG is set (the diskettes are not alike), JUMP to 5C69H: a backup reconstruct.
5C58
LD A,L 7D
Copy Register L (the source's cylinders less 35) into Register A.
5C59
SUB E 93
SUBtract Register E (the destination's cylinders less 35) from Register A: the Z FLAG when the counts are the same.
5C5A
If the Z FLAG is set (the same cylinder count), JUMP to 5C66H and on to the engine selector.
5C5C
LD A,(6C01H) 3A 01 6C
Load Register A with the backup by class flag at 6C01H (stored by 5B2DH).
5C5F
OR A B7
Set the flags from Register A (OR A): the NZ FLAG for a backup by class.
5C60
If the NZ FLAG is set (by class), JUMP to 6C00H: the selector takes the file by file engine, no question asked.
5C63
GOSUB to 5C72H to ask Cylinder count differs - Attempt mirror-image backup ?: the Z FLAG for Y.
5C66
If the Z FLAG is set (the same count, or Y), JUMP to 6C00H: the selector takes the mirror image engine, or the file by file engine for a backup by class.
5C69
LD HL,6F83H 21 83 6F
Point Register Pair HL to 6F83H, the text Backup-reconstruct invoked.
5C6C
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL (6F83H) and write it to the job log.
5C6F
JUMP to 6C13H, the file by file part of the engine selector, past the test of 6C01H.
5C72H - Ask About the Cylinder Count
Called by 5C63H when the two allocation tables give different cylinder counts. A reply starting with Y or y gives the Z FLAG.
5C72
LD HL,6F9EH 21 9E 6F
Point Register Pair HL to 6F9EH, the question Cylinder count differs - Attempt mirror-image backup ? (03H at the end).
5C75
GOSUB to 4467H, @DSPLY, to display the question at Register Pair HL (6F9EH).
5C78
LD HL,525EH 21 5E 52
Point Register Pair HL to 525EH, the buffer of the reply.
5C7B
LD B,03H 06 03
Load Register B with 03H: the reply is at most 3 characters.
5C7D
GOSUB to 0040H, the ROM's line input: up to Register B (3) characters at Register Pair HL (525EH-5260H, 0DH after them); Register Pair HL comes back at 525EH, the CARRY FLAG for BREAK.
5C80
If the CARRY FLAG is set (BREAK), JUMP to 52ACH: Backup aborted.
5C83
LD A,(HL) 7E
Load Register A with the first character of the reply at Register Pair HL (525EH).
5C84
RES 5,A CB AF
Clear bit 5 of Register A (the first character of the reply): y becomes Y.
5C86
CP 59H FE 59
Compare Register A against 59H, Y: the Z FLAG for yes.
5C88
RET C9
RETurn with the Z FLAG for Y (a mirror image copy), the NZ FLAG for anything else.
5C89H - The Master Password
The source diskette's master password hash (+CEH-+CFH of its allocation table, 57CEH) is checked. 42E0H, the hash of PASSWORD, needs nothing. Otherwise MPW's text, or the reply to Master password ?, is hashed by SYS2/SYS (request E4H through 6C68H); the hash 113DH (the password RS0LT0FF) or the diskette's own hash lets the backup go on, any other gives Invalid master password and the end.
5C89
LD HL,(57CEH) 2A CE 57
Load Register Pair HL with the master password hash of the source diskette at 57CEH-57CFH (+CEH-+CFH of its allocation table).
5C8C
LD DE,42E0H 11 E0 42
Load Register Pair DE with 42E0H, the hash of the password PASSWORD.
5C8F
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
5C90
SBC HL,DE ED 52
SUBtract Register Pair DE (42E0H) from Register Pair HL (the diskette's hash): the Z FLAG when they are the same.
5C92
RET Z C8
If the Z FLAG is set (the master password is PASSWORD), RETurn: no question.
5C93
LD DE,0000H 11 00 00
Load Register Pair DE with the operand at 5C94H-5C95H, the cell of the MPW parameter (@PARAM table 6D74H): 0000H in the file, the address of the MPW text when given.
5C96
LD HL,6FD6H 21 D6 6F
Point Register Pair HL to 6FD6H, the question Master password ? for 6C71H when Register Pair DE is 0000H.
5C99
GOSUB to 6C68H: the 8 characters (from Register Pair DE, or typed after the question at Register Pair HL) are hashed by SYS2/SYS; Register Pair HL comes back with the hash.
5C9C
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the hash of the password given.
5C9D
LD HL,113DH 21 3D 11
Load Register Pair HL with 113DH, the hash of RS0LT0FF.
5CA0
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
5CA1
SBC HL,DE ED 52
SUBtract Register Pair DE (the hash given) from Register Pair HL (113DH): the Z FLAG when they are the same.
5CA3
RET Z C8
If the Z FLAG is set (RS0LT0FF was given), RETurn: the backup goes on.
5CA4
LD HL,(57CEH) 2A CE 57
Load Register Pair HL with the source diskette's master password hash at 57CEH-57CFH.
5CA7
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
5CA8
SBC HL,DE ED 52
SUBtract Register Pair DE (the hash given) from Register Pair HL (the diskette's hash): the Z FLAG when they are the same.
5CAA
RET Z C8
If the Z FLAG is set (the right master password), RETurn.
5CAB
LD HL,6FEEH 21 EE 6F
Point Register Pair HL to 6FEEH, the text Invalid master password.
5CAE
JUMP to 52AFH to end with the text at Register Pair HL (6FEEH): no second try.
5CB1H - Copy a Name of the Partspec
Takes the character in Register A and the ones at Register Pair HL into the field at Register Pair DE, at most Register B characters: 24H ($), digits 30H-39H and every character from 41H up (61H and up folded by clearing bit 5). Any other character ends the field; Register A returns with it, and after Register B characters with the next character of the line.
5CB1
CP 24H FE 24
Compare Register A (the character) against 24H, the dollar sign: in the partspec, a position that matches any character.
5CB3
If the Z FLAG is set (24H), JUMP to 5CBFH to store it.
5CB5
CP 41H FE 41
Compare Register A against 41H, the letter A: the NO CARRY FLAG for 41H and up.
5CB7
If the NO CARRY FLAG is set (41H or above), JUMP to 5CBFH to store it.
5CB9
CP 3AH FE 3A
Compare Register A against 3AH: the NO CARRY FLAG for 3AH-40H.
5CBB
RET NC D0
If the NO CARRY FLAG is set (3AH-40H, such as a colon), RETurn with the character in Register A.
5CBC
CP 30H FE 30
Compare Register A against 30H, the digit 0: the CARRY FLAG below it.
5CBE
RET C D8
If the CARRY FLAG is set (below 30H, such as a space, a slash or 0DH), RETurn with the character in Register A.
5CBF
CP 61H FE 61
Compare Register A against 61H, the letter a: the CARRY FLAG below it.
5CC1
If the CARRY FLAG is set (below 61H), JUMP to 5CC5H to store it as it is.
5CC3
RES 5,A CB AF
Clear bit 5 of Register A: a lower case letter becomes upper case, as a directory record holds names.
5CC5
LD (DE),A 12
Store Register A (the character) at Register Pair DE, the next position of the field.
5CC6
INC DE 13
INCrement Register Pair DE to the next position of the field.
5CC7
LD A,(HL) 7E
Load Register A with the next character of the command line at Register Pair HL.
5CC8
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5CC9
DECrement Register B (the positions left) and LOOP BACK to 5CB1H while it is not 0.
5CCB
RET C9
RETurn with the field full and the next character of the line in Register A.
5CCCH - Read a Date of the DATE Parameter
Reads MM/DD/YY at Register Pair HL (two digits in each field) into 525FH (month), 525EH (day) and 525DH (year), checks the month (1-12) and the day against the table of days at 7006H, and returns Register Pair BC packed so that dates compare as numbers: Register B bits 7-3 the year less 1980, bits 2-0 bits 3-1 of the month; Register C bit 7 bit 0 of the month, bits 6-2 the day. Any error gives Bad date format and the end.
5CCC
LD A,(HL) 7E
Load Register A with the character at Register Pair HL. 5D4BH loads it again, so this value is not used.
5CCD
LD C,2FH 0E 2F
Load Register C with 2FH, the slash between the fields, for 5D20H.
5CCF
GOSUB to 5D20H to read the three fields at Register Pair HL into 525FH, 525EH and 525DH; Register Pair DE comes back at 525DH, the Z FLAG on success.
5CD2
If the NZ FLAG is set (a field without two digits, or no slash), JUMP to 5D1AH: Bad date format.
5CD4
LD A,(DE) 1A
Load Register A with the year at Register Pair DE (525DH), 0-99.
5CD5
CP 0CH FE 0C
Compare Register A (the year) against 0CH (12): the CARRY FLAG for 00-11, the years 2000-2011.
5CD7
If the NO CARRY FLAG is set (12-99), JUMP to 5CDCH.
5CD9
ADD A,64H C6 64
ADD 64H (100) to Register A: 00-11 become 100-111, the years after 1999.
5CDB
LD (DE),A 12
Store Register A (the year) at Register Pair DE (525DH).
5CDC
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = 525DH, Register Pair DE = the pointer into the DATE text.
5CDD
AND 03H E6 03
Mask Register A (the year) to bits 1-0 (AND 03H): the Z FLAG for a year divisible by 4, a leap year.
5CDF
LD HL,7007H 21 07 70
Point Register Pair HL to 7007H, the days of February in the table at 7006H. LD does not change the flags.
5CE2
If the NZ FLAG is set (not a leap year), JUMP to 5CE5H.
5CE4
INC (HL) 34
INCrement the byte at Register Pair HL (7007H): February has 1DH (29) days. The table is changed for the rest of the run, so a second leap year date (5AC8H) makes it 1EH (30).
5CE5
LD A,(525FH) 3A 5F 52
Load Register A with the month at 525FH, the first field of the date.
5CE8
DEC A 3D
DECrement Register A (the month): 0-11 for January to December; a month 0 gives FFH.
5CE9
CP 0CH FE 0C
Compare Register A against 0CH: the CARRY FLAG for a month 1-12.
5CEB
If the NO CARRY FLAG is set (not a month), JUMP to 5D1AH: Bad date format.
5CED
DEC HL 2B
DECrement Register Pair HL from 7007H to 7006H, the days of January.
5CEE
ADD A,L 85
ADD Register L (06H) to Register A (the month less 1): the low byte of the month's entry.
5CEF
LD L,A 6F
Copy Register A into Register L: Register Pair HL = 7006H + the month less 1.
5CF0
If the NO CARRY FLAG is set (no carry out of Register L), JUMP to 5CF3H.
5CF2
INC H 24
INCrement Register H for the carry out of Register L (never, the table lies within 7006H-7011H).
5CF3
LD A,(525EH) 3A 5E 52
Load Register A with the day at 525EH, the second field of the date.
5CF6
DEC A 3D
DECrement Register A (the day): a day 0 gives FFH.
5CF7
CP (HL) BE
Compare Register A against the days of the month at Register Pair HL: the CARRY FLAG for a day 1 to the last day.
5CF8
If the NO CARRY FLAG is set (not a day of the month), JUMP to 5D1AH: Bad date format.
5CFA
LD HL,525FH 21 5F 52
Point Register Pair HL to 525FH, the month, to pack the three fields.
5CFD
LD B,(HL) 46
Load Register B with the month at Register Pair HL (525FH).
5CFE
LD C,00H 0E 00
Load Register C with 00H, the low byte of the packed date to be built.
5D00
SRL B CB 38
Shift Register B (the month) right one bit (SRL): bit 0 into the CARRY FLAG; Register B = bits 3-1 of the month.
5D02
RR C CB 19
Rotate Register C right through the CARRY FLAG (RR): bit 0 of the month into bit 7 of Register C.
5D04
DEC HL 2B
DECrement Register Pair HL to 525EH, the day.
5D05
LD A,(HL) 7E
Load Register A with the day at Register Pair HL (525EH).
5D06
DEC HL 2B
DECrement Register Pair HL to 525DH, the year.
5D07
RLCA 07
Rotate Register A (the day, 1-31) left one bit (RLCA).
5D08
RLCA 07
Rotate Register A left one bit (RLCA): the day in bits 6-2.
5D09
OR C B1
OR Register C (bit 0 of the month in bit 7) into Register A.
5D0A
LD C,A 4F
Copy Register A into Register C: the low byte of the packed date.
5D0B
LD A,(HL) 7E
Load Register A with the year at Register Pair HL (525DH): 12-111.
5D0C
SUB 50H D6 50
SUBtract 50H (80) from Register A: 0-31 for 1980-2011, 70H or more (as a byte) for 12-79.
5D0E
CP 70H FE 70
Compare Register A against 70H: the CARRY FLAG for a year 1980-2011.
5D10
If the CARRY FLAG is set (1980-2011), JUMP to 5D13H.
5D12
XOR A AF
Load Register A with 00H (XOR A): a year 12-79 is taken as 1980.
5D13
RLCA 07
Rotate Register A (the year less 1980, 0-31) left one bit (RLCA).
5D14
RLCA 07
Rotate Register A left one bit (RLCA), the second of the three shifts.
5D15
RLCA 07
Rotate Register A left one bit (RLCA): the year less 1980 in bits 7-3.
5D16
OR B B0
OR Register B (bits 3-1 of the month) into Register A.
5D17
LD B,A 47
Copy Register A into Register B: the high byte of the packed date.
5D18
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the pointer into the DATE text, after the year.
5D19
RET C9
RETurn with the packed date in Register Pair BC.
5D1A
LD HL,7012H 21 12 70
Point Register Pair HL to 7012H, the text Bad date format.
5D1D
JUMP to 52AFH to end with the text at Register Pair HL (7012H).
5D20H - Read the Fields of a Date
Reads three numbers of two digits at Register Pair HL, separated by the character in Register C, into 525FH, 525EH and 525DH, the first at the top. The Z FLAG when all three are read; the NZ FLAG for a field without two digits or another separator.
5D20
LD DE,525FH 11 5F 52
Point Register Pair DE to 525FH, the place of the first field (the month).
5D23
LD B,03H 06 03
Load Register B with 03H, the count of the fields: month, day and year.
5D25
PUSH DE D5
Save Register Pair DE (the place of the field) to the stack: 5D35H uses Register E.
5D26
GOSUB to 5D35H to read two digits at Register Pair HL: Register A = their value, the Z FLAG on success.
5D29
POP DE D1
Restore Register Pair DE (the place of the field) from the stack.
5D2A
RET NZ C0
If the NZ FLAG is set (not two digits), RETurn with the NZ FLAG.
5D2B
LD (DE),A 12
Store Register A (the value) at Register Pair DE, the field.
5D2C
DEC B 05
DECrement Register B, the fields left to read.
5D2D
RET Z C8
If the Z FLAG is set (the third field is stored), RETurn with the Z FLAG and Register Pair DE at 525DH.
5D2E
DEC DE 1B
DECrement Register Pair DE to the place of the next field.
5D2F
LD A,(HL) 7E
Load Register A with the character after the field at Register Pair HL.
5D30
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5D31
CP C B9
Compare Register A against Register C (2FH, the slash): the Z FLAG for the separator.
5D32
If the Z FLAG is set (the separator), LOOP BACK to 5D25H for the next field.
5D34
RET C9
RETurn with the NZ FLAG: another character where the separator should be.
5D35H - Read Two Digits
Two decimal digits at Register Pair HL give their value in Register A and Register E, with the Z FLAG. A character that is not a digit gives the NZ FLAG.
5D35
GOSUB to 5D4BH to take the first digit at Register Pair HL: Register A = its value, the CARRY FLAG for a digit.
5D38
If the NO CARRY FLAG is set (not a digit), JUMP to 5D49H for the NZ FLAG.
5D3A
LD E,A 5F
Copy Register A (the tens digit) into Register E.
5D3B
RLCA 07
Rotate Register A left one bit (RLCA): twice the digit.
5D3C
RLCA 07
Rotate Register A left one bit (RLCA): four times the digit.
5D3D
ADD A,E 83
ADD Register E (the digit) to Register A: five times the digit.
5D3E
RLCA 07
Rotate Register A left one bit (RLCA): ten times the digit.
5D3F
LD E,A 5F
Copy Register A (ten times the tens digit) into Register E.
5D40
GOSUB to 5D4BH to take the second digit at Register Pair HL: the CARRY FLAG for a digit.
5D43
If the NO CARRY FLAG is set (not a digit), JUMP to 5D49H for the NZ FLAG.
5D45
ADD A,E 83
ADD Register E (the tens) to Register A (the units): the value 0-99.
5D46
LD E,A 5F
Copy Register A (the value 0-99) into Register E, as the caller may take it there.
5D47
CP A BF
Compare Register A against itself: the Z FLAG, for success.
5D48
RET C9
RETurn with the value in Register A and the Z FLAG.
5D49
OR A B7
Set the flags from Register A (OR A): Register A holds the character less 30H, 0AH or more, so the NZ FLAG is set.
5D4A
RET C9
RETurn with the NZ FLAG to the caller: the character was not a digit.
5D4B
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
5D4C
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
5D4D
SUB 30H D6 30
SUBtract 30H from Register A: the value of a digit 0-9.
5D4F
CP 0AH FE 0A
Compare Register A against 0AH: the CARRY FLAG for a digit.
5D51
RET C9
RETurn with the value in Register A and the CARRY FLAG for a digit.
5D52H - Memory Above the Front End
Not in the file.
5D52-5DFF
DEFS 174
5D52H-5DFFH: not in the file. No instruction addresses these bytes; the engine the selector moves to 5A00H covers them.
5E00H - The Mirror Image Engine (Run at 5A00H): Pack Identities and Lock Outs
5E00H-6208H is loaded here and moved to 5A00H-5E08H by the engine selector (6C06H) before it runs: every address it uses in 5A00H-5E08H is 0400H below the row that holds it on this page, and its JP and CALL operands are run addresses. It copies the source diskette cylinder by cylinder. First the pack identities (+CEH-+D7H of the two allocation tables, 57CEH and 58CEH) are compared, then every cylinder is checked: a granule the source uses must not be locked out on the destination.
5E00
LD HL,57CEH 21 CE 57
(Run 5A00H.) Point Register Pair HL to 57CEH, +CEH of the source's allocation table: the master password hash and the diskette name, the pack identity.
5E03
LD DE,58CEH 11 CE 58
Point Register Pair DE to 58CEH, +CEH of the destination's allocation table.
5E06
LD B,0AH 06 0A
Load Register B with 0AH, the 10 bytes of the pack identity.
5E08
LD A,(DE) 1A
(Run 5A08H.) Load Register A with the byte of the destination's pack identity at Register Pair DE.
5E09
CP (HL) BE
Compare Register A against the byte of the source's pack identity at Register Pair HL.
5E0A
If the Z FLAG is set (the same byte), JUMP to 5E2BH (run 5A2BH) for the next byte.
5E0C
LD HL,5DE5H 21 E5 5D
Point Register Pair HL to 5DE5H, the question at 61E5H on this page: Different pack IDs! Abort backup ? (03H at the end).
5E0F
GOSUB to 4467H, @DSPLY, to display the question at Register Pair HL.
5E12
LD HL,442BH 21 2B 44
Point Register Pair HL to 442BH, SFLAG$, the system flags.
5E15
BIT 5,(HL) CB 6E
Test bit 5 of the byte at Register Pair HL (442BH): set while a JCL job runs.
5E17
If the NZ FLAG is set (a JCL job: no question can be answered), JUMP to 5E28H (run 5A28H) to give up.
5E19
LD HL,525DH 21 5D 52
Point Register Pair HL to 525DH, the buffer of the reply.
5E1C
LD B,03H 06 03
Load Register B with 03H: the reply is at most 3 characters.
5E1E
GOSUB to 0040H, the ROM's line input: up to Register B (3) characters at Register Pair HL (525DH); Register Pair HL comes back at 525DH. BREAK (the CARRY FLAG) is not tested.
5E21
LD A,(HL) 7E
Load Register A with the first character of the reply at Register Pair HL (525DH).
5E22
RES 5,A CB AF
Clear bit 5 of Register A (the first character of the reply): n becomes N.
5E24
CP 4EH FE 4E
Compare Register A against 4EH, N: do not abort.
5E26
If the Z FLAG is set (N), JUMP to 5E2FH (run 5A2FH) to go on with the backup.
5E28
(Run 5A28H.) JUMP to 52ACH: Backup aborted (any reply but N, or a JCL job).
5E2B
INC DE 13
(Run 5A2BH.) INCrement Register Pair DE to the next byte of the destination's pack identity.
5E2C
INC HL 23
INCrement Register Pair HL to the next byte of the source's pack identity.
5E2D
DECrement Register B and LOOP BACK to 5E08H (run 5A08H) until the 10 bytes are compared.
5E2F
LD HL,5860H 21 60 58
(Run 5A2FH.) Point Register Pair HL to 5860H, +60H of the destination's allocation table: its lock out table, one byte for each cylinder.
5E32
LD DE,5760H 11 60 57
Point Register Pair DE to 5760H, +60H of the source's allocation table: its lock out table.
5E35
LD B,60H 06 60
Load Register B with 60H: 96 cylinders, the size of the tables.
5E37
LD A,(DE) 1A
(Run 5A37H.) Load Register A with the source's lock out byte of the cylinder at Register Pair DE.
5E38
CPL 2F
Complement Register A (CPL): a bit set for each granule the source does not lock out.
5E39
LD C,A 4F
Copy Register A (the granules not locked out) into Register C.
5E3A
PUSH DE D5
Save Register Pair DE (the pointer into the source's lock out table) to the stack.
5E3B
LD A,E 7B
Copy Register E (the low byte, 60H-BFH) into Register A.
5E3C
SUB 60H D6 60
SUBtract 60H from Register A: the same cylinder in the source's allocation bytes (+00H-+5FH).
5E3E
LD E,A 5F
Copy Register A into Register E: Register Pair DE = the cylinder's allocation byte in 57xxH.
5E3F
LD A,(DE) 1A
Load Register A with the source's allocation byte at Register Pair DE: a bit set for each granule in use (or missing).
5E40
POP DE D1
Restore Register Pair DE (the pointer into the source's lock out table) from the stack.
5E41
AND C A1
AND Register C into Register A: the granules the source uses and does not lock out, its data.
5E42
AND (HL) A6
AND the destination's lock out byte at Register Pair HL into Register A: data on a granule the destination locks out.
5E43
If the NZ FLAG is set (such a granule), JUMP to 5D6EH (the row at 616EH): Backup aborted, destination not mirror-image.
5E46
INC DE 13
INCrement Register Pair DE to the source's next cylinder.
5E47
INC HL 23
INCrement Register Pair HL to the destination's next cylinder.
5E48
DECrement Register B and LOOP BACK to 5E37H (run 5A37H) until the 96 cylinders are checked.
5E4AH - Mark the Destination (Run 5A4AH)
The destination's boot sector is read. When its cylinder 0 is in single density with the rest in double density (bit 7 of +04H, from bit 4 of the configuration byte, 6D34H), the bytes the front end kept from the source's boot sector go into it: 09H-0AH (the operand of LD IY,0000H) and 16H-25H. Its first byte becomes 76H and it is written back: 53BBH finds the destination by this byte, and 60B2H stores 00H there again at the end. The copy never reads or writes sectors 0 and 1 of cylinder 0.
5E4A
(Run 5A4AH.) GOSUB to 5394H to have the destination diskette in its drive (asked for on one drive); Index Register IY at its drive's table.
5E4D
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
5E50
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0, the boot sector.
5E53
GOSUB to 546CH, function 09H, to read the destination's boot sector into Register Pair HL (5900H).
5E56
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
5E59
BIT 7,(IY+04H) FD CB 04 7E
Test bit 7 of +04H of the drive code table at Index Register IY: set by 6CBFH for a diskette with cylinder 0 in single density and the rest in double density.
5E5D
If the Z FLAG is set (not such a diskette), JUMP to 5E72H (run 5A72H).
5E5F
LD HL,55F8H 21 F8 55
Point Register Pair HL to 55F8H, the bytes of the source's boot sector the front end kept (5B8DH-5B9BH).
5E62
PUSH DE D5
Save Register Pair DE (0000H, cylinder 0 sector 0) to the stack.
5E63
LD DE,5909H 11 09 59
Point Register Pair DE to 5909H, byte 09H of the destination's boot sector.
5E66
LD BC,0002H 01 02 00
Load Register Pair BC with 0002H, the count of bytes for the first copy: 2 bytes.
5E69
LDIR ED B0
Copy Register Pair BC (2) bytes from Register Pair HL (55F8H-55F9H) to Register Pair DE (5909H-590AH) (LDIR): the source's operand of LD IY. Register Pair HL ends at 55FAH, Register Pair BC at 0000H.
5E6B
LD E,16H 1E 16
Load Register E with 16H: Register Pair DE = 5916H, byte 16H of the boot sector.
5E6D
LD C,10H 0E 10
Load Register C with 10H: Register Pair BC = 0010H, 16 bytes.
5E6F
LDIR ED B0
Copy Register Pair BC (16) bytes from Register Pair HL (55FAH-5609H) to Register Pair DE (5916H-5925H) (LDIR): the source's bytes 16H-25H.
5E71
POP DE D1
Restore Register Pair DE (0000H, cylinder 0 sector 0) from the stack.
5E72
LD HL,5900H 21 00 59
(Run 5A72H.) Point Register Pair HL to 5900H, the first byte of the boot sector.
5E75
LD (HL),76H 36 76
Store 76H at Register Pair HL (5900H): the mark of the destination diskette.
5E77
GOSUB to 5464H, function 0DH, to write the boot sector at Register Pair HL back to cylinder Register D sector Register E (0/0).
5E7A
If the NZ FLAG is set (the write failed), JUMP to 52A0H with the error number in Register A.
5E7DH - The Geometry and the Room in Memory (Run 5A7DH)
From the source's drive table: the directory cylinder (to 5FA6H), the sectors on a cylinder (to five CP operands), the sectors of a cylinder 0 in single density, 10 or 20 (to three CP operands), and the cylinders the work area holds, one 256 byte page per sector (to 5F4CH). Then interrupts are turned off and the RET goes to 4012H.
5E7D
(Run 5A7DH.) GOSUB to 5327H to have the source diskette in its drive; Index Register IY at its drive's table.
5E80
LD A,(IY+09H) FD 7E 09
Load Register A with +09H of the drive code table at Index Register IY: the source's directory cylinder.
5E83
LD (5BA6H),A 32 A6 5B
Store Register A (the directory cylinder) at 5BA6H, the operand of CP 00H at 5FA5H on this page (run 5BA5H): its sectors are written with the deleted data mark.
5E86
LD A,(IY+07H) FD 7E 07
Load Register A with +07H of the drive code table at Index Register IY: bits 4-0 the highest sector of a track, bits 7-5 the heads less one.
5E89
LD B,A 47
Copy Register A (+07H of the source drive's table) into Register B.
5E8A
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the highest sector of a track.
5E8C
LD C,A 4F
Copy Register A (the highest sector) into Register C.
5E8D
INC C 0C
INCrement Register C: the sectors on a track.
5E8E
XOR B A8
Exclusive OR Register B (+07H) into Register A: bits 7-5 alone, the heads less one.
5E8F
RLCA 07
Rotate Register A left one bit (RLCA), the first of three: bits 7-5 go round to bits 2-0.
5E90
RLCA 07
Rotate Register A left one bit (RLCA), the second of the three shifts.
5E91
RLCA 07
Rotate Register A left one bit (RLCA): the heads less one in bits 2-0.
5E92
INC A 3C
INCrement Register A (the heads less one): the number of heads.
5E93
LD B,A 47
Copy Register A (the heads) into Register B, the count of the additions.
5E94
XOR A AF
Load Register A with 00H (XOR A), the sum of the sectors on a cylinder.
5E95
ADD A,C 81
(Run 5A95H.) ADD Register C (the sectors on a track) to Register A.
5E96
DECrement Register B and LOOP BACK to 5E95H (run 5A95H): Register A = the sectors on a track times the heads.
5E98
LD C,0AH 0E 0A
Load Register C with 0AH: 10, the sectors of a cylinder 0 in single density.
5E9A
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of +04H of the drive code table at Index Register IY: set for two sides.
5E9E
If the Z FLAG is set (one side), JUMP to 5EA3H (run 5AA3H).
5EA0
ADD A,A 87
ADD Register A to itself: two sides, twice the sectors on a cylinder.
5EA1
RLC C CB 01
Rotate Register C left one bit (RLC): 20 sectors for a cylinder 0 in single density on two sides.
5EA3
LD (5B41H),A 32 41 5B
(Run 5AA3H.) Store Register A (the sectors on a cylinder) at 5B41H, the operand of CP 00H at 5F40H (run 5B40H), the end of a cylinder in the read pass.
5EA6
LD (5BCBH),A 32 CB 5B
Store Register A (the sectors on a cylinder) at 5BCBH, the operand of CP 00H at 5FCAH (run 5BCAH), the write pass.
5EA9
LD (5C2BH),A 32 2B 5C
Store Register A (the sectors on a cylinder) at 5C2BH, the operand of CP 00H at 602AH (run 5C2AH), the verify pass.
5EAC
LD (5D42H),A 32 42 5D
Store Register A (the sectors on a cylinder) at 5D42H, the operand of CP 00H at 6141H (run 5D41H), the source's directory sectors.
5EAF
LD (5CA4H),A 32 A4 5C
Store Register A (the sectors on a cylinder) at 5CA4H, the operand of CP 00H at 60A3H (run 5CA3H), the destination's directory sectors.
5EB2
LD B,A 47
Copy Register A (the sectors on a cylinder) into Register B, the divisor below.
5EB3
LD A,C 79
Copy Register C (10 or 20, a cylinder 0 in single density) into Register A.
5EB4
LD (5B3DH),A 32 3D 5B
Store Register A at 5B3DH, the operand of CP 00H at 5F3CH (run 5B3CH), cylinder 0 in the read pass.
5EB7
LD (5BC7H),A 32 C7 5B
Store Register A at 5BC7H, the operand of CP 00H at 5FC6H (run 5BC6H), cylinder 0 in the write pass.
5EBA
LD (5C27H),A 32 27 5C
Store Register A at 5C27H, the operand of CP 00H at 6026H (run 5C26H), cylinder 0 in the verify pass.
5EBD
LD HL,(4411H) 2A 11 44
Load Register Pair HL with HIGH$ from 4411H-4412H, the top of the work area.
5EC0
INC HL 23
INCrement Register Pair HL (HIGH$): HIGH$ + 1, the first byte above the work area.
5EC1
DEC H 25
DECrement Register H: Register H = the last page that lies below HIGH$ + 1 less one.
5EC2
LD DE,(5285H) ED 5B 85 52
Load Register Pair DE with the work area start at 5285H-5286H (a page boundary, 6C5DH).
5EC6
LD A,H 7C
Copy Register H (the top page) into Register A.
5EC7
SUB D 92
SUBtract Register D (the first page of the work area) from Register A: the pages of the work area.
5EC8
LD C,FFH 0E FF
Load Register C with FFH, the count of the cylinders, less one.
5ECA
INC C 0C
(Run 5ACAH.) INCrement Register C: one more cylinder fits.
5ECB
SUB B 90
SUBtract Register B (the pages of one cylinder, a page for each sector) from Register A.
5ECC
If the NO CARRY FLAG is set (the pages last), LOOP BACK to 5ECAH (run 5ACAH).
5ECE
LD A,C 79
Copy Register C (the cylinders the work area holds) into Register A.
5ECF
LD (5B4CH),A 32 4C 5B
Store Register A (the cylinders) at 5B4CH, the operand of LD A,00H at 5F4BH (run 5B4BH): the read pass stops when the work area is full.
5ED2
DI F3
Disable interrupts: the copy runs with interrupts off.
5ED3
LD A,(4012H) 3A 12 40
Load Register A with the byte at 4012H: C3H, the JP of the RST 38H vector to the interrupt service routine 44A5H of SYS0/SYS.
5ED6
LD (52C1H),A 32 C1 52
Store Register A (C3H) at 52C1H, the operand of LD A at 52C0H, so that the endings put it back.
5ED9
LD A,C9H 3E C9
Load Register A with C9H, the opcode of RET, for the RST 38H vector at 4012H.
5EDB
LD (4012H),A 32 12 40
Store Register A (C9H) at 4012H: an interrupt taken after the driver's EI runs the RET, with interrupts staying off; the clock does not count (the note of 5487H).
5EDE
GOSUB to 5327H to have the source diskette in its drive.
5EE1
XOR A AF
Load Register A with 00H (XOR A): no cylinder is in the work area yet.
5EE2
LD (5B45H),A 32 45 5B
Store Register A (00H) at 5B45H, the operand of LD A,00H at 5F44H (run 5B44H): the count of cylinders in the work area.
5EE5
LD D,00H 16 00
Load Register D with 00H: the copy starts at cylinder 0.
5EE7H - The Read Pass (Run 5AE7H)
From cylinder Register D on, each cylinder is looked at in the two allocation tables: its granules that hold data on the source (in use and not locked out) OR the destination's locked out granules become the destination's allocation byte (58xxH). A cylinder without data is passed over. The others are read, sector by sector, one 256 byte page each, into the work area, until it is full (5F4CH) or cylinder 95 is passed. Sectors 0 and 1 of cylinder 0 (the boot sectors) are never read; a directory sector (result 06H) is read like any other.
5EE7
LD HL,(5285H) 2A 85 52
(Run 5AE7H.) Load Register Pair HL with the work area start at 5285H-5286H: the page of the first sector.
5EEA
LD A,D 7A
Copy Register D (the first cylinder of this group) into Register A.
5EEB
LD (5B68H),A 32 68 5B
Store Register A (the first cylinder) at 5B68H, the operand of LD D,00H at 5F67H (run 5B67H), where the write pass and the verify pass start.
5EEE
PUSH HL E5
(Run 5AEEH.) Save Register Pair HL (the page for the next sector) to the stack.
5EEF
LD H,57H 26 57
Load Register H with 57H: Register Pair HL into the source's allocation table at 5700H.
5EF1
LD L,D 6A
Copy Register D (the cylinder) into Register L: Register Pair HL = 5700H + cylinder, its allocation byte.
5EF2
LD C,(HL) 4E
Load Register C with the source's allocation byte at Register Pair HL.
5EF3
LD A,D 7A
Copy Register D (the cylinder) into Register A.
5EF4
ADD A,60H C6 60
ADD 60H to Register A: the cylinder's byte in the lock out table.
5EF6
LD L,A 6F
Copy Register A into Register L: Register Pair HL = 5760H + cylinder.
5EF7
LD A,(HL) 7E
Load Register A with the source's lock out byte at Register Pair HL.
5EF8
CPL 2F
Complement Register A (CPL): the granules the source does not lock out.
5EF9
AND C A1
AND Register C (the allocation byte) into Register A: the granules with data on the source.
5EFA
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = 5860H + cylinder, the destination's lock out byte.
5EFC
LD C,(HL) 4E
Load Register C with the destination's lock out byte at Register Pair HL.
5EFD
OR C B1
OR Register C into Register A: the source's data granules and the destination's locked out granules.
5EFE
LD L,D 6A
Copy Register D (the cylinder) into Register L: Register Pair HL = 5800H + cylinder.
5EFF
LD (HL),A 77
Store Register A at Register Pair HL: the destination's new allocation byte of the cylinder.
5F00
CP C B9
Compare Register A against Register C (the destination's lock out byte): the Z FLAG when the source has no data on the cylinder.
5F01
POP HL E1
Restore Register Pair HL (the page for the next sector) from the stack.
5F02
If the Z FLAG is set (no data), JUMP to 5B50H (the row at 5F50H) for the next cylinder, without reading it.
5F05
GOSUB to 5327H to have the source diskette in its drive (asked for on one drive).
5F08
PUSH HL E5
Save Register Pair HL (the page for the next sector) to the stack.
5F09
LD E,00H 1E 00
Load Register E with 00H: the first sector of the cylinder.
5F0B
LD A,D 7A
Copy Register D (the cylinder) into Register A for the display.
5F0C
LD HL,5DB3H 21 B3 5D
Point Register Pair HL to 5DB3H, the three characters at 61B3H on this page.
5F0F
GOSUB to 5D48H (the row at 6148H) to write Register A (the cylinder) as three characters at Register Pair HL.
5F12
PUSH DE D5
Save Register Pair DE (the cylinder and sector) to the stack.
5F13
LD HL,5D74H 21 74 5D
Point Register Pair HL to 5D74H, the text at 6174H on this page: Loading cylinder (1DH first, 03H at the end).
5F16
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL at the start of the line.
5F19
LD HL,5DB3H 21 B3 5D
Point Register Pair HL to 5DB3H, the number at 61B3H on this page (03H after it).
5F1C
GOSUB to 4467H, @DSPLY, to display the number at Register Pair HL after the text.
5F1F
POP DE D1
Restore Register Pair DE (the cylinder and sector) from the stack.
5F20
POP HL E1
Restore Register Pair HL (the page for the next sector) from the stack.
5F21
LD A,FEH 3E FE
(Run 5B21H.) Load Register A with FEH, a mask that drops bit 0 of the sector.
5F23
AND E A3
AND Register E (the sector) into Register A: 00H for sectors 0 and 1.
5F24
OR D B2
OR Register D (the cylinder) into Register A: the Z FLAG for cylinder 0 sectors 0 and 1, the boot sectors.
5F25
If the NZ FLAG is set (not a boot sector), GOSUB to 546CH, function 09H, to read cylinder Register D sector Register E into Register Pair HL; the Z FLAG on success.
5F28
If the Z FLAG is set (read, or a boot sector passed over), JUMP to 5F2FH (run 5B2FH).
5F2A
CP 06H FE 06
Compare Register A (the result) against 06H: a sector with the deleted data mark, a directory sector.
5F2C
If the NZ FLAG is set (another error), JUMP to 52A0H with the error number in Register A.
5F2F
INC H 24
(Run 5B2FH.) INCrement Register H: Register Pair HL to the next page of the work area.
5F30
INC E 1C
INCrement Register E to the next sector of the cylinder being read.
5F31
LD A,E 7B
Copy Register E (the next sector) into Register A for the tests.
5F32
INC D 14
INCrement Register D (the cylinder), with the DEC next to set the flags.
5F33
DEC D 15
DECrement Register D back to the cylinder: the Z FLAG for cylinder 0.
5F34
If the NZ FLAG is set (not cylinder 0), JUMP to 5F40H (run 5B40H).
5F36
BIT 7,(IY+04H) FD CB 04 7E
Test bit 7 of +04H of the drive code table at Index Register IY: cylinder 0 in single density.
5F3A
If the Z FLAG is set (all cylinders alike), JUMP to 5F40H (run 5B40H).
5F3C
CP 00H FE 00
Compare Register A (the next sector) against the operand at 5F3DH: the sectors of a cylinder 0 in single density (10 or 20, 5EB4H).
5F3E
If the Z FLAG is set (cylinder 0 is read), JUMP to 5F44H (run 5B44H).
5F40
CP 00H FE 00
(Run 5B40H.) Compare Register A (the next sector) against the operand at 5F41H: the sectors on a cylinder (5EA3H).
5F42
If the NZ FLAG is set (sectors left), LOOP BACK to 5F21H (run 5B21H) for the next sector.
5F44
LD A,00H 3E 00
(Run 5B44H.) Load Register A with the operand at 5F45H: the count of cylinders in the work area (5EE2H, 5F47H, 5FD2H).
5F46
INC A 3C
INCrement Register A (the count of cylinders): one cylinder more in the work area.
5F47
LD (5B45H),A 32 45 5B
Store Register A (the count) at 5B45H, the operand at 5F45H (run 5B45H).
5F4A
LD B,A 47
Copy Register A (the count of cylinders) into Register B for the compare.
5F4B
LD A,00H 3E 00
Load Register A with the operand at 5F4CH: the cylinders the work area holds (5ECFH).
5F4D
CP B B8
Compare Register A against Register B (the count): the Z FLAG when the work area is full.
5F4E
If the Z FLAG is set (full), JUMP to 5F5EH (run 5B5EH) to write the group.
5F50
INC D 14
(Run 5B50H.) INCrement Register D to the next cylinder.
5F51
LD A,D 7A
Copy Register D (the next cylinder) into Register A.
5F52
CP 60H FE 60
Compare Register A against 60H: cylinder 96, past the end of the tables.
5F54
If the NZ FLAG is set (cylinders left), JUMP to 5AEEH (the row at 5EEEH) for the next cylinder.
5F57
LD A,(5B45H) 3A 45 5B
Load Register A with the count of cylinders in the work area at 5B45H (the operand at 5F45H).
5F5A
OR A B7
Set the flags from Register A (OR A): the Z FLAG when the work area is empty.
5F5B
If the Z FLAG is set (every cylinder is copied), JUMP to 5C3FH (the row at 603FH) to finish.
5F5EH - The Write Pass (Run 5B5EH)
The same cylinders, from the first of the group (5F68H), are written to the destination from the work area: a cylinder without data is passed over again, the boot sectors are not written, the sectors of the source's directory cylinder are written with the deleted data mark (error 12H if that fails), the others with the normal mark.
5F5E
LD A,(5B45H) 3A 45 5B
(Run 5B5EH.) Load Register A with the count of cylinders in the work area at 5B45H (the operand at 5F45H).
5F61
LD (5C2FH),A 32 2F 5C
Store Register A (the count) at 5C2FH, the operand of LD A,00H at 602EH (run 5C2EH), for the verify pass.
5F64
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H: the page of the group's first sector.
5F67
LD D,00H 16 00
Load Register D with the operand at 5F68H: the first cylinder of the group (5EEBH).
5F69
PUSH HL E5
(Run 5B69H.) Save Register Pair HL (the page of the next sector) to the stack.
5F6A
LD H,57H 26 57
Load Register H with 57H: Register Pair HL into the source's allocation table.
5F6C
LD L,D 6A
Copy Register D (the cylinder) into Register L: Register Pair HL = 5700H + cylinder.
5F6D
LD C,(HL) 4E
Load Register C with the source's allocation byte at Register Pair HL.
5F6E
LD A,D 7A
Copy Register D (the cylinder) into Register A.
5F6F
ADD A,60H C6 60
ADD 60H to Register A: the cylinder's byte in the lock out table.
5F71
LD L,A 6F
Copy Register A into Register L: Register Pair HL = 5760H + cylinder.
5F72
LD A,(HL) 7E
Load Register A with the source's lock out byte at Register Pair HL.
5F73
CPL 2F
Complement Register A (CPL): the granules the source does not lock out.
5F74
AND C A1
AND Register C (the allocation byte) into Register A: the granules with data on the source.
5F75
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = 5860H + cylinder.
5F77
LD C,(HL) 4E
Load Register C with the destination's lock out byte at Register Pair HL.
5F78
OR C B1
OR Register C into Register A: the destination's new allocation byte, as in the read pass.
5F79
LD L,D 6A
Copy Register D (the cylinder) into Register L: Register Pair HL = 5800H + cylinder.
5F7A
LD (HL),A 77
Store Register A at Register Pair HL: the destination's allocation byte (the same value again).
5F7B
CP C B9
Compare Register A against Register C: the Z FLAG when the source has no data on the cylinder.
5F7C
POP HL E1
Restore Register Pair HL (the page of the next sector) from the stack.
5F7D
If the Z FLAG is set (no data: not in the work area), JUMP to 5BD5H (the row at 5FD5H) for the next cylinder.
5F80
GOSUB to 5394H to have the destination diskette in its drive (asked for on one drive).
5F83
LD E,00H 1E 00
Load Register E with 00H: the first sector of the cylinder.
5F85
LD A,D 7A
Copy Register D (the cylinder) into Register A.
5F86
OR E B3
OR Register E (00H) into Register A. The flags are not used: the CALL 5D48H below changes them.
5F87
PUSH HL E5
Save Register Pair HL (the page of the next sector) to the stack.
5F88
LD A,D 7A
Copy Register D (the cylinder) into Register A for the display.
5F89
LD HL,5DB3H 21 B3 5D
Point Register Pair HL to 5DB3H, the three characters at 61B3H on this page.
5F8C
GOSUB to 5D48H (the row at 6148H) to write Register A (the cylinder) as three characters at Register Pair HL.
5F8F
PUSH DE D5
Save Register Pair DE (the cylinder and sector) to the stack.
5F90
LD HL,5D89H 21 89 5D
Point Register Pair HL to 5D89H, the text at 6189H on this page: Dumping cylinder (1DH first, 03H at the end).
5F93
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL at the start of the line.
5F96
LD HL,5DB3H 21 B3 5D
Point Register Pair HL to 5DB3H, the number at 61B3H on this page.
5F99
GOSUB to 4467H, @DSPLY, to display the number at Register Pair HL.
5F9C
POP DE D1
Restore Register Pair DE (the cylinder and sector) from the stack.
5F9D
POP HL E1
Restore Register Pair HL (the page of the next sector) from the stack.
5F9E
LD A,FEH 3E FE
(Run 5B9EH.) Load Register A with FEH, a mask that drops bit 0 of the sector.
5FA0
AND E A3
AND Register E (the sector) into Register A: 00H for sectors 0 and 1.
5FA1
OR D B2
OR Register D (the cylinder) into Register A: the Z FLAG for cylinder 0 sectors 0 and 1.
5FA2
LD A,D 7A
Copy Register D (the cylinder) into Register A; LD does not change the flags.
5FA3
If the Z FLAG is set (a boot sector), JUMP to 5FB9H (run 5BB9H) without writing it.
5FA5
CP 00H FE 00
Compare Register A (the cylinder) against the operand at 5FA6H: the source's directory cylinder (5E83H).
5FA7
If the Z FLAG is set (the directory cylinder), JUMP to 5FB1H (run 5BB1H).
5FA9
GOSUB to 5464H, function 0DH, to write cylinder Register D sector Register E from Register Pair HL.
5FAC
If the NZ FLAG is set (the write failed), JUMP to 52A0H with the error number in Register A.
5FAF
JUMP to 5FB9H (run 5BB9H) for the next sector.
5FB1
(Run 5BB1H.) GOSUB to 5468H, function 0EH, to write the directory sector at Register Pair HL with the deleted data mark.
5FB4
LD A,12H 3E 12
Load Register A with 12H, error 12H, Directory write error. LD does not change the flags.
5FB6
If the NZ FLAG is set (the write failed), JUMP to 52A0H with the error number in Register A (12H).
5FB9
INC H 24
(Run 5BB9H.) INCrement Register H: Register Pair HL to the next page of the work area.
5FBA
INC E 1C
INCrement Register E to the next sector of the cylinder being written.
5FBB
LD A,E 7B
Copy Register E (the next sector) into Register A for the tests.
5FBC
INC D 14
INCrement Register D (the cylinder), with the DEC next to set the flags.
5FBD
DEC D 15
DECrement Register D back to the cylinder: the Z FLAG for cylinder 0.
5FBE
If the NZ FLAG is set (not cylinder 0), JUMP to 5FCAH (run 5BCAH).
5FC0
BIT 7,(IY+04H) FD CB 04 7E
Test bit 7 of +04H of the drive code table at Index Register IY: cylinder 0 in single density.
5FC4
If the Z FLAG is set (all cylinders alike), JUMP to 5FCAH (run 5BCAH).
5FC6
CP 00H FE 00
Compare Register A (the next sector) against the operand at 5FC7H: the sectors of a cylinder 0 in single density (5EB7H).
5FC8
If the Z FLAG is set (cylinder 0 is written), JUMP to 5FCEH (run 5BCEH).
5FCA
CP 00H FE 00
(Run 5BCAH.) Compare Register A (the next sector) against the operand at 5FCBH: the sectors on a cylinder (5EA6H).
5FCC
If the NZ FLAG is set (sectors left), LOOP BACK to 5F9EH (run 5B9EH).
5FCE
LD A,(5B45H) 3A 45 5B
(Run 5BCEH.) Load Register A with the count of cylinders in the work area at 5B45H (the operand at 5F45H).
5FD1
DEC A 3D
DECrement Register A: one cylinder fewer to write.
5FD2
LD (5B45H),A 32 45 5B
Store Register A (the count) at 5B45H (the operand at 5F45H).
5FD5
INC D 14
(Run 5BD5H.) INCrement Register D to the next cylinder.
5FD6
LD A,(5B45H) 3A 45 5B
Load Register A with the count of cylinders left at 5B45H (the operand at 5F45H).
5FD9
OR A B7
Set the flags from Register A (OR A): the Z FLAG when the group is written; the count is 00H again for the next read pass.
5FDA
If the NZ FLAG is set (cylinders left), LOOP BACK to 5F69H (run 5B69H).
5FDCH - The Verify Pass (Run 5BDCH)
The group is read back from the destination without the bytes being stored (function 0AH): a sector with the deleted data mark (06H) is good. Then the read pass goes on with the next cylinder (603CH).
5FDC
LD A,(5B68H) 3A 68 5B
(Run 5BDCH.) Load Register A with the first cylinder of the group at 5B68H (the operand at 5F68H).
5FDF
LD D,A 57
Copy Register A (the first cylinder) into Register D.
5FE0
LD H,57H 26 57
(Run 5BE0H.) Load Register H with 57H: Register Pair HL into the source's allocation table.
5FE2
LD L,D 6A
Copy Register D (the cylinder) into Register L: Register Pair HL = 5700H + cylinder.
5FE3
LD C,(HL) 4E
Load Register C with the source's allocation byte at Register Pair HL.
5FE4
LD A,D 7A
Copy Register D (the cylinder) into Register A.
5FE5
ADD A,60H C6 60
ADD 60H to Register A: the cylinder's byte in the lock out table.
5FE7
LD L,A 6F
Copy Register A into Register L: Register Pair HL = 5760H + cylinder.
5FE8
LD A,(HL) 7E
Load Register A with the source's lock out byte at Register Pair HL.
5FE9
CPL 2F
Complement Register A (CPL): the granules the source does not lock out.
5FEA
AND C A1
AND Register C (the allocation byte) into Register A: the granules with data on the source.
5FEB
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = 5860H + cylinder.
5FED
LD C,(HL) 4E
Load Register C with the destination's lock out byte at Register Pair HL.
5FEE
OR C B1
OR Register C into Register A: the destination's allocation byte.
5FEF
LD L,D 6A
Copy Register D (the cylinder) into Register L: Register Pair HL = 5800H + cylinder.
5FF0
LD (HL),A 77
Store Register A at Register Pair HL: the destination's allocation byte (the same value again).
5FF1
CP C B9
Compare Register A against Register C: the Z FLAG when the source has no data on the cylinder.
5FF2
If the Z FLAG is set (no data), JUMP to 5C34H (the row at 6034H) for the next cylinder.
5FF5
LD E,00H 1E 00
Load Register E with 00H: the first sector of the cylinder.
5FF7
LD A,D 7A
Copy Register D (the cylinder) into Register A for the display.
5FF8
LD HL,5DB3H 21 B3 5D
Point Register Pair HL to 5DB3H, the three characters at 61B3H on this page.
5FFB
GOSUB to 5D48H (the row at 6148H) to write Register A (the cylinder) as three characters at Register Pair HL.
5FFE
PUSH DE D5
Save Register Pair DE (the cylinder and sector) to the stack.
5FFF
LD HL,5D9EH 21 9E 5D
Point Register Pair HL to 5D9EH, the text at 619EH on this page: Verifying cylinder (1DH first, 03H at the end).
6002
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL at the start of the line.
6005
LD HL,5DB3H 21 B3 5D
Point Register Pair HL to 5DB3H, the number at 61B3H on this page.
6008
GOSUB to 4467H, @DSPLY, to display the number at Register Pair HL.
600B
POP DE D1
Restore Register Pair DE (the cylinder and sector) from the stack.
600C
LD A,FEH 3E FE
(Run 5C0CH.) Load Register A with FEH, a mask that drops bit 0 of the sector.
600E
AND E A3
AND Register E (the sector) into Register A: 00H for sectors 0 and 1.
600F
OR D B2
OR Register D (the cylinder) into Register A: the Z FLAG for cylinder 0 sectors 0 and 1.
6010
If the NZ FLAG is set (not a boot sector), GOSUB to 5470H, function 0AH, to verify cylinder Register D sector Register E.
6013
If the Z FLAG is set (good, or a boot sector), JUMP to 601AH (run 5C1AH).
6015
CP 06H FE 06
Compare Register A (the result) against 06H: a sector with the deleted data mark.
6017
If the NZ FLAG is set (another error), JUMP to 52A0H with the error number in Register A.
601A
INC E 1C
(Run 5C1AH.) INCrement Register E to the next sector.
601B
LD A,E 7B
Copy Register E (the next sector) into Register A for the tests.
601C
INC D 14
INCrement Register D (the cylinder), with the DEC next to set the flags.
601D
DEC D 15
DECrement Register D back to the cylinder: the Z FLAG for cylinder 0.
601E
If the NZ FLAG is set (not cylinder 0), JUMP to 602AH (run 5C2AH).
6020
BIT 7,(IY+04H) FD CB 04 7E
Test bit 7 of +04H of the drive code table at Index Register IY: cylinder 0 in single density.
6024
If the Z FLAG is set (all cylinders alike), JUMP to 602AH (run 5C2AH).
6026
CP 00H FE 00
Compare Register A (the next sector) against the operand at 6027H: the sectors of a cylinder 0 in single density (5EBAH).
6028
If the Z FLAG is set (cylinder 0 is verified), JUMP to 602EH (run 5C2EH).
602A
CP 00H FE 00
(Run 5C2AH.) Compare Register A (the next sector) against the operand at 602BH: the sectors on a cylinder (5EA9H).
602C
If the NZ FLAG is set (sectors left), LOOP BACK to 600CH (run 5C0CH).
602E
LD A,00H 3E 00
(Run 5C2EH.) Load Register A with the operand at 602FH: the cylinders of the group left to verify (5F61H).
6030
DEC A 3D
DECrement Register A (the cylinders left to verify): one cylinder fewer.
6031
LD (5C2FH),A 32 2F 5C
Store Register A (the count) at 5C2FH, the operand at 602FH (run 5C2FH).
6034
INC D 14
(Run 5C34H.) INCrement Register D to the next cylinder.
6035
LD A,(5C2FH) 3A 2F 5C
Load Register A with the count of cylinders left at 5C2FH (the operand at 602FH).
6038
OR A B7
Set the flags from Register A (OR A): the Z FLAG when the group is verified.
6039
If the NZ FLAG is set (cylinders left), JUMP to 5BE0H (the row at 5FE0H).
603C
JUMP to 5AE7H (the row at 5EE7H): the read pass goes on from cylinder Register D.
603FH - Finish the Mirror Image (Run 5C3FH)
The destination's allocation table (5800H) gets +CEH-+FFH of the source's (the pack identity, the date, the AUTO command) and the date of today (527DH), and is written to sector 0 of the directory cylinder and verified. In every directory record of the destination (sectors 2 to the last of the directory cylinder) the bit of a changed file (+01H bit 6) is cleared, but in extension records (+00H bit 7). Both boot sectors get the directory cylinder. When the destination's own directory cylinder was elsewhere and no data lands on it, its sectors are filled with E5H. Then the bits are cleared on the source too; a write protected source gives a message and the backup is complete anyway.
603F
LD A,0DH 3E 0D
(Run 5C3FH.) Load Register A with 0DH, a new line after the progress line.
6041
GOSUB to 0033H, the ROM's display of the character in Register A (0DH).
6044
LD HL,57CEH 21 CE 57
Point Register Pair HL to 57CEH, +CEH of the source's allocation table.
6047
LD DE,58CEH 11 CE 58
Point Register Pair DE to 58CEH, +CEH of the destination's allocation table.
604A
LD BC,0032H 01 32 00
Load Register Pair BC with 0032H: 50 bytes, +CEH-+FFH.
604D
LDIR ED B0
Copy Register Pair BC (50) bytes from Register Pair HL (57CEH) to Register Pair DE (58CEH) (LDIR): the master password hash, the diskette name, the date and the AUTO command of the source.
604F
LD HL,527DH 21 7D 52
Point Register Pair HL to 527DH, the date of today as MM/DD/YY (5B43H).
6052
LD DE,58D8H 11 D8 58
Point Register Pair DE to 58D8H, +D8H of the destination's allocation table: the diskette's date.
6055
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the count of the bytes: 8 characters of the date.
6058
LDIR ED B0
Copy Register Pair BC (8) bytes from Register Pair HL (527DH) to Register Pair DE (58D8H) (LDIR).
605A
GOSUB to 5394H to have the destination diskette in its drive.
605D
LD A,(5BA6H) 3A A6 5B
Load Register A with the directory cylinder at 5BA6H (the operand at 5FA6H).
6060
LD D,A 57
Copy Register A (the directory cylinder) into Register D.
6061
LD E,00H 1E 00
Load Register E with 00H: sector 0, the allocation table.
6063
LD HL,5800H 21 00 58
Point Register Pair HL to 5800H, the destination's allocation table.
6066
GOSUB to 5468H, function 0EH, to write it to cylinder Register D sector Register E with the deleted data mark.
6069
LD A,15H 3E 15
Load Register A with 15H, error 15H, GAT write error. LD does not change the flags.
606B
If the NZ FLAG is set (the write failed), JUMP to 5C78H (the row at 6078H) and on to 52A0H with error 15H in Register A.
606E
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer (a verify stores no byte).
6071
GOSUB to 5470H, function 0AH, to verify cylinder Register D sector Register E.
6074
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark the sector must have.
6076
LD A,14H 3E 14
Load Register A with 14H, error 14H, GAT read error. LD does not change the flags.
6078
(Run 5C78H.) If the NZ FLAG is set, JUMP to 52A0H with the error number in Register A (14H, or 15H from 606BH).
607B
LD A,(5BA6H) 3A A6 5B
Load Register A with the directory cylinder at 5BA6H (the operand at 5FA6H).
607E
LD D,A 57
Copy Register A (the directory cylinder) into Register D.
607F
LD E,02H 1E 02
Load Register E with 02H: the first sector of directory records.
6081
LD HL,(5285H) 2A 85 52
(Run 5C81H.) Load Register Pair HL with the work area start at 5285H-5286H, a page for the sector.
6084
GOSUB to 546CH, function 09H, to read the destination's directory sector (cylinder Register D, sector Register E) into Register Pair HL.
6087
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
6089
If the NZ FLAG is set (not 06H), JUMP to 529BH: error 11H, Directory read error.
608C
BIT 7,(HL) CB 7E
(Run 5C8CH.) Test bit 7 of the record's attribute byte at Register Pair HL: set in an extension record.
608E
If the NZ FLAG is set (an extension record), JUMP to 6094H (run 5C94H).
6090
INC L 2C
INCrement Register L to +01H of the record, the byte with the bit of a changed file.
6091
RES 6,(HL) CB B6
Clear bit 6 of +01H at Register Pair HL: the file is no longer marked as changed.
6093
DEC L 2D
DECrement Register L back to +00H of the record.
6094
LD A,L 7D
(Run 5C94H.) Copy Register L (the record's offset in the page) into Register A.
6095
ADD A,20H C6 20
ADD 20H to Register A: the next of the 8 records of 32 bytes; the CARRY FLAG after the last.
6097
LD L,A 6F
Copy Register A into Register L: Register Pair HL at the next record.
6098
If the NO CARRY FLAG is set (records left), LOOP BACK to 608CH (run 5C8CH).
609A
GOSUB to 5468H, function 0EH, to write the sector at Register Pair HL back with the deleted data mark.
609D
LD A,12H 3E 12
Load Register A with 12H, error 12H, Directory write error. LD does not change the flags.
609F
If the NZ FLAG is set (the write failed), JUMP to 60D9H (run 5CD9H) and on to 52A0H with error 12H.
60A1
INC E 1C
INCrement Register E to the next directory sector of the destination.
60A2
LD A,E 7B
Copy Register E (the next sector) into Register A.
60A3
CP 00H FE 00
Compare Register A against the operand at 60A4H: the sectors on a cylinder (5EAFH).
60A5
If the NZ FLAG is set (sectors left), LOOP BACK to 6081H (run 5C81H).
60A7
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
60AA
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0.
60AD
GOSUB to 546CH, function 09H, to read the destination's boot sector (Register D, Register E) into Register Pair HL (5900H).
60B0
If the NZ FLAG is set (the read failed), JUMP to 60D9H (run 5CD9H) and on to 52A0H.
60B2
LD (HL),00H 36 00
Store 00H at Register Pair HL (5900H): the boot sector's first byte again, in place of the 76H of 5E75H.
60B4
INC HL 23
INCrement Register Pair HL to 5901H, on the way to byte 02H of the boot sector.
60B5
INC HL 23
INCrement Register Pair HL to 5902H, the boot sector's directory cylinder.
60B6
LD B,(HL) 46
Load Register B with the destination's old directory cylinder at Register Pair HL (5902H).
60B7
LD A,(5BA6H) 3A A6 5B
Load Register A with the source's directory cylinder at 5BA6H (the operand at 5FA6H).
60BA
LD (HL),A 77
Store Register A (the directory cylinder) at Register Pair HL (5902H).
60BB
DEC HL 2B
DECrement Register Pair HL to 5901H, on the way back to the start of the boot sector.
60BC
DEC HL 2B
DECrement Register Pair HL to 5900H, the start of the boot sector, for the write.
60BD
GOSUB to 5464H, function 0DH, to write the boot sector at Register Pair HL to cylinder Register D sector Register E (0/0).
60C0
If the Z FLAG is set (written), GOSUB to 5470H, function 0AH, to verify it.
60C3
If the NZ FLAG is set (an error), JUMP to 60D9H (run 5CD9H) and on to 52A0H.
60C5
INC E 1C
INCrement Register E: sector 1, the second boot sector.
60C6
GOSUB to 546CH, function 09H, to read cylinder 0 sector 1 into Register Pair HL (5900H).
60C9
If the NZ FLAG is set (the read failed), JUMP to 60D9H (run 5CD9H) and on to 52A0H.
60CB
LD A,(5BA6H) 3A A6 5B
Load Register A with the source's directory cylinder at 5BA6H (the operand at 5FA6H).
60CE
INC HL 23
INCrement Register Pair HL to 5901H, on the way to byte 02H of the second boot sector.
60CF
INC HL 23
INCrement Register Pair HL to 5902H, byte 02H of the second boot sector: its directory cylinder.
60D0
LD (HL),A 77
Store Register A (the directory cylinder) at Register Pair HL (5902H).
60D1
DEC HL 2B
DECrement Register Pair HL to 5901H, on the way back to the start of the sector.
60D2
DEC HL 2B
DECrement Register Pair HL to 5900H, the start of the sector, for the write.
60D3
GOSUB to 5464H, function 0DH, to write the sector at Register Pair HL to cylinder 0 sector 1 (Register D, Register E).
60D6
If the Z FLAG is set (written), GOSUB to 5470H, function 0AH, to verify it.
60D9
(Run 5CD9H.) If the NZ FLAG is set (an error), JUMP to 52A0H with the error number in Register A.
60DC
LD H,58H 26 58
Load Register H with 58H: Register Pair HL into the destination's allocation table.
60DE
LD A,B 78
Copy Register B (the destination's old directory cylinder) into Register A.
60DF
ADD A,60H C6 60
ADD 60H to Register A: its byte in the lock out table.
60E1
LD L,A 6F
Copy Register A into Register L: Register Pair HL = 5860H + the old directory cylinder.
60E2
LD C,(HL) 4E
Load Register C with the destination's lock out byte at Register Pair HL.
60E3
LD L,B 68
Copy Register B (the old directory cylinder) into Register L: Register Pair HL = 5800H + the cylinder.
60E4
LD A,(HL) 7E
Load Register A with the destination's new allocation byte of the old directory cylinder at Register Pair HL.
60E5
OR C B1
OR Register C (the lock out byte) into Register A.
60E6
CP C B9
Compare Register A against Register C: the Z FLAG when no data of the source lies on the old directory cylinder.
60E7
If the NZ FLAG is set (granules of that cylinder are in use in the new allocation table), JUMP to 6106H (run 5D06H) and leave it as it is.
60E9
LD A,B 78
Copy Register B (the old directory cylinder) into Register A.
60EA
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer.
60ED
LD DE,5901H 11 01 59
Point Register Pair DE to 5901H, one byte above it.
60F0
LD BC,00FFH 01 FF 00
Load Register Pair BC with 00FFH, the count for the LDIR: 255 bytes, 5901H-59FFH.
60F3
LD (HL),E5H 36 E5
Store E5H at Register Pair HL (5900H), the byte of an empty sector.
60F5
LDIR ED B0
Copy Register Pair BC (255) bytes from Register Pair HL to Register Pair DE (LDIR): 5900H-59FFH all E5H; Register Pair BC ends at 0000H.
60F7
LD L,C 69
Copy Register C (00H) into Register L: Register Pair HL = 5900H again.
60F8
LD D,A 57
Copy Register A (the old directory cylinder) into Register D.
60F9
LD E,C 59
Copy Register C (00H) into Register E: sector 0.
60FA
LD A,(5B41H) 3A 41 5B
Load Register A with the sectors on a cylinder at 5B41H (the operand at 5F41H).
60FD
LD B,A 47
Copy Register A (the sectors on a cylinder) into Register B, the count.
60FE
(Run 5CFEH.) GOSUB to 5464H, function 0DH, to write the sector of E5H bytes at Register Pair HL to cylinder Register D sector Register E with the normal data mark.
6101
If the NZ FLAG is set (the write failed), JUMP to 60D9H (run 5CD9H) and on to 52A0H.
6103
INC E 1C
INCrement Register E to the next sector of the old directory cylinder.
6104
DECrement Register B and LOOP BACK to 60FEH (run 5CFEH) for every sector of the cylinder.
6106
(Run 5D06H.) GOSUB to 545CH, function 04H: Restore the destination drive's head to cylinder 0.
6109
GOSUB to 5327H to have the source diskette in its drive (asked for on one drive).
610C
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the source's directory cylinder.
610F
LD E,02H 1E 02
Load Register E with 02H: the first sector of directory records.
6111
LD HL,(5285H) 2A 85 52
(Run 5D11H.) Load Register Pair HL with the work area start at 5285H-5286H.
6114
GOSUB to 546CH, function 09H, to read the source's directory sector (cylinder Register D, sector Register E) into Register Pair HL.
6117
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
6119
If the NZ FLAG is set (not 06H), JUMP to 529BH: error 11H, Directory read error.
611C
BIT 7,(HL) CB 7E
(Run 5D1CH.) Test bit 7 of the record's attribute byte at Register Pair HL: set in an extension record.
611E
If the NZ FLAG is set (an extension record), JUMP to 6124H (run 5D24H).
6120
INC L 2C
INCrement Register L to +01H of the record, the byte with the bit of a changed file.
6121
RES 6,(HL) CB B6
Clear bit 6 of +01H at Register Pair HL: the source's file is no longer marked as changed.
6123
DEC L 2D
DECrement Register L back to +00H of the record.
6124
LD A,L 7D
(Run 5D24H.) Copy Register L (the record's offset in the page) into Register A.
6125
ADD A,20H C6 20
ADD 20H to Register A: the next record; the CARRY FLAG after the last of the 8.
6127
LD L,A 6F
Copy Register A into Register L: Register Pair HL at the next record.
6128
If the NO CARRY FLAG is set (records left), LOOP BACK to 611CH (run 5D1CH).
612A
GOSUB to 5468H, function 0EH, to write the sector at Register Pair HL back with the deleted data mark.
612D
If the Z FLAG is set (written), JUMP to 613FH (run 5D3FH).
612F
CP 0FH FE 0F
Compare Register A (the error) against 0FH, error 0FH, Write protected disk.
6131
LD A,12H 3E 12
Load Register A with 12H, error 12H, Directory write error. LD does not change the flags.
6133
If the NZ FLAG is set (another error), JUMP to 52A0H with error 12H in Register A.
6136
LD HL,55A1H 21 A1 55
Point Register Pair HL to 55A1H, the text Source disk is write protected, can't clear mod flags.
6139
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL (55A1H) and write it to the job log.
613C
JUMP to 5287H: Backup complete, the copy itself is done.
613F
INC E 1C
(Run 5D3FH.) INCrement Register E to the next directory sector of the source.
6140
LD A,E 7B
Copy Register E (the next sector) into Register A.
6141
CP 00H FE 00
Compare Register A against the operand at 6142H: the sectors on a cylinder (5EACH).
6143
If the NZ FLAG is set (sectors left), LOOP BACK to 6111H (run 5D11H).
6145
JUMP to 5287H: Backup complete, with the source's directory records done too.
6148H - Write a Number of Three Characters (Run 5D48H)
Register A (0-255) is written at Register Pair HL as hundreds, tens and units: a 0 in the hundreds or tens place is left a space, the units always get a digit. The progress lines show the cylinder with it.
6148
LD (HL),20H 36 20
(Run 5D48H.) Store 20H, a space, at Register Pair HL: the hundreds place.
614A
LD B,64H 06 64
Load Register B with 64H (100), the value of the hundreds place.
614C
GOSUB to 5D5AH (the row at 615AH) to put the hundreds digit at Register Pair HL.
614F
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL: the tens place.
6151
LD B,0AH 06 0A
Load Register B with 0AH (10), the value of the tens place.
6153
GOSUB to 5D5AH (the row at 615AH) to put the tens digit at Register Pair HL.
6156
LD (HL),30H 36 30
Store 30H, the digit 0, at Register Pair HL: the units place.
6158
LD B,01H 06 01
Load Register B with 01H, the value of the units place, and go on into 615AH.
615A
LD C,00H 0E 00
(Run 5D5AH.) Load Register C with 00H, the digit being counted.
615C
SUB B 90
(Run 5D5CH.) SUBtract Register B (the value of the place) from Register A.
615D
If the CARRY FLAG is set (it went below 0), JUMP to 6162H (run 5D62H).
615F
INC C 0C
INCrement Register C, the digit of the place being counted.
6160
LOOP BACK to 615CH (run 5D5CH) to subtract again.
6162
ADD A,B 80
(Run 5D62H.) ADD Register B (the value of the place) back to Register A: the rest.
6163
PUSH AF F5
Save Register Pair AF (Register A = the rest) to the stack.
6164
LD A,C 79
Copy Register C (the digit of the place) into Register A for the test of 0.
6165
OR A B7
Set the flags from Register A (OR A): the Z FLAG for the digit 0.
6166
If the Z FLAG is set (0), JUMP to 616BH (run 5D6BH): the space or 0 already there stays.
6168
ADD A,30H C6 30
ADD 30H to Register A: the digit's character.
616A
LD (HL),A 77
Store Register A (the digit) at Register Pair HL.
616B
POP AF F1
(Run 5D6BH.) Restore Register Pair AF (Register A = the rest) from the stack.
616C
INC HL 23
INCrement Register Pair HL to the next place.
616D
RET C9
RETurn with the rest in Register A and Register Pair HL at the next place.
616EH - Not a Mirror Image (Run 5D6EH)
Reached from 5E43H when a granule with data on the source is locked out on the destination.
616E
LD HL,5DB7H 21 B7 5D
(Run 5D6EH.) Point Register Pair HL to 5DB7H, the text at 61B7H on this page: Backup aborted, destination not mirror-image.
6171
JUMP to 52AFH to end with the text at Register Pair HL.
6174H - The Texts of the Mirror Image Engine
They move to 5D74H-5E08H with the engine, so its code uses addresses 0400H lower than the rows here.
6174
DEFB 1DH 1D
6174H (run 5D74H): 1DH, the cursor to the start of the line, so the progress line is written over the last one.
6175-6187
DEFM "Loading cylinder " 4C 6F 61 64 69 6E 67 20 20 20 63 79 6C 69 6E 64 65 72 20
6175H-6187H: the progress text of the read pass (5F13H).
6188
DEFB 03H 03
6188H: 03H, the end of the text; the cylinder's number follows on the same line.
6189
DEFB 1DH 1D
6189H (run 5D89H): 1DH, the cursor to the start of the line.
618A-619C
DEFM "Dumping cylinder " 44 75 6D 70 69 6E 67 20 20 20 63 79 6C 69 6E 64 65 72 20
618AH-619CH: the progress text of the write pass (5F90H).
619D
DEFB 03H 03
619DH: 03H, the end of the text; the number follows.
619E
DEFB 1DH 1D
619EH (run 5D9EH): 1DH, the cursor to the start of the line.
619F-61B1
DEFM "Verifying cylinder " 56 65 72 69 66 79 69 6E 67 20 63 79 6C 69 6E 64 65 72 20
619FH-61B1H: the progress text of the verify pass (5FFFH).
61B2
DEFB 03H 03
61B2H: 03H, the end of the text; the number follows.
61B3-61B5
DEFM "000" 30 30 30
61B3H-61B5H (run 5DB3H-5DB5H): the three characters of the cylinder's number, written by 6148H.
61B6
DEFB 03H 03
61B6H: 03H, the end of the number: the cursor stays on the line.
61B7
DEFB 0AH 0A
61B7H (run 5DB7H): 0AH, a new line before the text of 616EH.
61B8-61E3
DEFM "Backup aborted, destination not mirror-image" 42 61 63 6B 75 70 20 61 62 6F 72 74 65 64 2C 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 6E 6F 74 20 6D 69 72 72 6F 72 2D 69 6D 61 67 65
61B8H-61E3H: the text of 616EH, ending a backup that cannot be a mirror image.
61E4
DEFB 0DH 0D
61E4H: 0DH, the end of the text and of its line.
61E5-6207
DEFM "Different pack IDs! Abort backup ? " 44 69 66 66 65 72 65 6E 74 20 70 61 63 6B 20 49 44 73 21 20 41 62 6F 72 74 20 62 61 63 6B 75 70 20 3F 20
61E5H-6207H (run 5DE5H-5E07H): the question of 5E0CH when the pack identities differ.
6208
DEFB 03H 03
6208H: 03H, the end of the question: the reply is typed after it.
6209H - Memory Above the Mirror Image Engine
Not in the file.
6209-62FF
DEFS 247
6209H-62FFH: not in the file. The file by file engine uses 6200H-62FFH as a sector buffer (the hash index tables, the system information sector and the allocation table of a destination made a system diskette: 635BH, 68F6H); after a move of the mirror image engine its work area starts at 5F00H and covers it.
6300H - The File by File Engine (Run at 5A00H): Setup
6300H-6A47H is loaded here and moved to 5A00H-6147H by the engine selector (6C52H): every address it uses in 5A00H-6147H is 0900H below the row that holds it on this page, and its JP and CALL operands are run addresses. Its work area starts at 6300H. It copies file by file, through the file system, every file the selection lets through (a backup by class) or every file (a backup reconstruct). Setup: the last page of the work area into three operands, 53BDH made a RET (any destination diskette is taken), the destination's room for data (its sectors less those of two cylinders), its directory cylinder from its boot sector; with SYS, the destination is prepared as a system diskette.
6300
LD HL,(4411H) 2A 11 44
(Run 5A00H.) Load Register Pair HL with HIGH$ from 4411H-4412H, the top of the work area.
6303
INC HL 23
INCrement Register Pair HL (HIGH$): HIGH$ + 1, the first byte above the work area.
6304
DEC H 25
DECrement Register H: Register H = the last page that lies below HIGH$ + 1 less one.
6305
LD A,H 7C
Copy Register H (the page where the work area ends) into Register A.
6306
LD (5E51H),A 32 51 5E
Store Register A (the end page) at 5E51H, the operand of CP 00H at 6750H on this page (run 5E50H): the reading of a file stops there.
6309
LD (5E66H),A 32 66 5E
Store Register A (the end page) at 5E66H, the operand of CP 00H at 6765H (run 5E65H): the writing stops there.
630C
LD (5F8FH),A 32 8F 5F
Store Register A (the end page) at 5F8FH, the operand of LD A,00H at 688EH (run 5F8EH).
630F
LD A,C9H 3E C9
Load Register A with C9H, the opcode of RET, for the byte at 53BDH.
6311
LD (53BDH),A 32 BD 53
Store Register A (C9H) at 53BDH: the test of the 76H at 53BBH now always returns, so any diskette is taken as the destination.
6314
GOSUB to 5394H to have the destination diskette in its drive; Index Register IY at its drive's table.
6317
LD A,(IY+07H) FD 7E 07
Load Register A with +07H of the drive code table at Index Register IY: bits 4-0 the highest sector, bits 7-5 the heads less one.
631A
LD B,A 47
Copy Register A (+07H of the destination drive's table) into Register B.
631B
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the highest sector of a track.
631D
LD C,A 4F
Copy Register A (the highest sector) into Register C.
631E
INC C 0C
INCrement Register C: the sectors on a track.
631F
XOR B A8
Exclusive OR Register B (+07H) into Register A: bits 7-5 alone, the heads less one.
6320
RLCA 07
Rotate Register A left one bit (RLCA), the first of three: bits 7-5 go round to bits 2-0.
6321
RLCA 07
Rotate Register A left one bit (RLCA), the second of the three shifts.
6322
RLCA 07
Rotate Register A left one bit (RLCA): the heads less one in bits 2-0.
6323
INC A 3C
INCrement Register A (the heads less one): the number of heads.
6324
LD B,A 47
Copy Register A (the heads) into Register B, the count of the additions.
6325
XOR A AF
Load Register A with 00H (XOR A), the sum of the sectors on a cylinder.
6326
ADD A,C 81
(Run 5A26H.) ADD Register C (the sectors on a track) to Register A.
6327
DECrement Register B and LOOP BACK to 6326H (run 5A26H): Register A = the sectors on a track times the heads.
6329
LD L,A 6F
Copy Register A (the sectors on a cylinder) into Register L.
632A
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the sectors on a cylinder.
632C
If the NO CARRY FLAG is set (the last addition did not pass 255), JUMP to 632FH (run 5A2FH).
632E
INC H 24
INCrement Register H for the carry of the last addition.
632F
BIT 5,(IY+04H) FD CB 04 6E
(Run 5A2FH.) Test bit 5 of +04H of the drive code table at Index Register IY: set for two sides.
6333
If the Z FLAG is set (one side), JUMP to 6336H (run 5A36H).
6335
ADD HL,HL 29
ADD Register Pair HL to itself: two sides, twice the sectors on a cylinder.
6336
LD A,(IY+06H) FD 7E 06
(Run 5A36H.) Load Register A with +06H of the drive code table at Index Register IY: the destination's highest cylinder.
6339
DEC A 3D
DECrement Register A: the cylinders less two (cylinder 0 and the directory cylinder are left out).
633A
GOSUB to 444EH, @MULT: Register Pair HL times Register A; Register Pair HL = the high 16 bits, Register A = the low 8 bits of the product.
633D
LD H,L 65
Copy Register L (the middle byte of the product) into Register H.
633E
LD L,A 6F
Copy Register A (the low byte) into Register L: Register Pair HL = the destination's sectors for data.
633F
LD (5DF4H),HL 22 F4 5D
Store Register Pair HL (the sectors for data) at 5DF4H, the operand of LD DE at 66F3H (run 5DF3H): a larger file is not copied.
6342
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: Register D = cylinder 0, Register E = sector 0, the boot sector.
6345
LD HL,5800H 21 00 58
Point Register Pair HL to 5800H, the directory sector buffer of this engine.
6348
GOSUB to 546CH, function 09H, to read the destination's boot sector into Register Pair HL (5800H).
634B
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
634E
LD A,(5802H) 3A 02 58
Load Register A with byte 02H of the boot sector at 5802H: the destination's directory cylinder.
6351
LD (IY+09H),A FD 77 09
Store Register A (the directory cylinder) at +09H of the drive code table at Index Register IY.
6354
LD A,(521BH) 3A 1B 52
Load Register A with the low byte of the SYS cell at 521BH (FFH when SYS was given).
6357
OR A B7
Set the flags from Register A (OR A): the Z FLAG without SYS.
6358
If the Z FLAG is set (no SYS), JUMP to 5AD2H (the row at 63D2H).
635B
LD HL,6200H 21 00 62
Point Register Pair HL to 6200H, a buffer below the work area.
635E
LD E,02H 1E 02
Load Register E with 02H: cylinder 0 (Register D) sector 2, the system information sector.
6360
GOSUB to 546CH, function 09H, to read the destination's system information sector into Register Pair HL (6200H).
6363
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
6366
LD A,(62C0H) 3A C0 62
Load Register A with byte C0H of the system information sector at 62C0H: FFH once BACKUP has made the diskette a system diskette (63CBH).
6369
INC A 3C
INCrement Register A (byte C0H of the sector): the Z FLAG for FFH.
636A
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the directory cylinder. LD does not change the flags.
636D
If the Z FLAG is set (already prepared), JUMP to 5A84H (the row at 6384H).
6370
LD E,L 5D
Copy Register L (00H) into Register E: sector 0 of the directory cylinder, the allocation table.
6371
GOSUB to 546CH, function 09H, to read the destination's allocation table into Register Pair HL (6200H).
6374
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
6376
LD A,14H 3E 14
Load Register A with 14H, error 14H, GAT read error. LD does not change the flags.
6378
If the NZ FLAG is set (not 06H), JUMP to 52A0H with error 14H in Register A.
637B
LD L,CDH 2E CD
Load Register L with CDH: Register Pair HL = 62CDH, the configuration byte of the allocation table.
637D
BIT 7,(HL) CB 7E
Test bit 7 of the configuration byte at Register Pair HL: FORMAT sets it on every diskette (DATECONV/CMD skips its system diskette test when it is set).
637F
RES 7,(HL) CB BE
Clear bit 7 of the configuration byte at Register Pair HL: the destination is now a system diskette. RES does not change the flags.
6381
If the NZ FLAG is set (the bit was set), GOSUB to 5F74H (the row at 6874H) to write the allocation table back and verify it.
6384
LD A,(5215H) 3A 15 52
(Run 5A84H.) Load Register A with the low byte of the OLD cell at 5215H (FFH when OLD was given).
6387
OR A B7
Set the flags from Register A (OR A): the Z FLAG without OLD.
6388
If the NZ FLAG is set (OLD: only files the destination has), JUMP to 63D2H (run 5AD2H) without the directory slots.
638A
GOSUB to 5FF1H (the row at 68F1H) to read the destination's hash index table (directory cylinder, sector 1) into 6200H; Register A = 16H, the Z FLAG on success.
638D
If the NZ FLAG is set (the read failed), JUMP to 52A0H with error 16H, HIT read error.
6390
LD DE,6138H 11 38 61
Point Register Pair DE to 6138H, the table at 6A38H on this page: the hash index bytes of the 15 system files.
6393
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the table, Register Pair DE = 6200H, the first entry of the hash index table.
6394
LD B,0FH 06 0F
Load Register B with 0FH, the count of the system files: 15 records.
6396
LD A,(DE) 1A
(Run 5A96H.) Load Register A with the destination's hash index byte at Register Pair DE.
6397
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H, a free directory record.
6398
If the NZ FLAG is set (the record is in use), JUMP to 639CH (run 5A9CH).
639A
LD A,(HL) 7E
Load Register A with the system file's byte from the table at Register Pair HL.
639B
LD (DE),A 12
Store Register A at Register Pair DE: the free record is taken for the system file.
639C
CP (HL) BE
(Run 5A9CH.) Compare Register A against the table's byte at Register Pair HL: the Z FLAG when the record belongs to that system file.
639D
If the Z FLAG is set (the right file, or just taken), JUMP to 63A5H (run 5AA5H).
639F
LD HL,609EH 21 9E 60
(Run 5A9FH.) Point Register Pair HL to 609EH, the text at 699EH on this page: Can't create SYSTEM disk - directory slots in use!
63A2
JUMP to 52AFH to end with the text at Register Pair HL.
63A5
INC E 1C
(Run 5AA5H.) INCrement Register E to the next record of the hash index table.
63A6
INC HL 23
INCrement Register Pair HL to the next byte of the table.
63A7
LD A,08H 3E 08
Load Register A with 08H, the record after the first eight.
63A9
CP E BB
Compare Register A against Register E: the Z FLAG at record 08H.
63AA
If the NZ FLAG is set (not 08H), JUMP to 63AEH (run 5AAEH).
63AC
LD E,20H 1E 20
Load Register E with 20H: after records 00H-07H come records 20H-26H (the second record of sectors 2-8).
63AE
(Run 5AAEH.) DECrement Register B and LOOP BACK to 6396H (run 5A96H) for the 15 records.
63B0
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the directory cylinder.
63B3
LD E,01H 1E 01
Load Register E with 01H: sector 1, the hash index table.
63B5
LD HL,6200H 21 00 62
Point Register Pair HL to 6200H, the hash index table as changed.
63B8
GOSUB to 5468H, function 0EH, to write it to cylinder Register D sector Register E with the deleted data mark.
63BB
LD A,17H 3E 17
Load Register A with 17H, error 17H, HIT write error. LD does not change the flags.
63BD
If the Z FLAG is set (written), GOSUB to 5FF1H (the row at 68F1H) to read it back; Register A = 16H.
63C0
If the NZ FLAG is set (the write or the read failed), JUMP to 52A0H with the error number in Register A (17H or 16H).
63C3
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H: Register D = cylinder 0, Register E = sector 2, the system information sector.
63C6
GOSUB to 546CH, function 09H, to read it into Register Pair HL (6200H). The result is not tested.
63C9
LD L,C0H 2E C0
Load Register L with C0H: Register Pair HL = 62C0H, byte C0H of the sector.
63CB
LD (HL),FFH 36 FF
Store FFH at Register Pair HL (62C0H): the mark that the diskette is prepared as a system diskette (6366H).
63CD
LD L,00H 2E 00
Load Register L with 00H: Register Pair HL = 6200H, the start of the sector.
63CF
GOSUB to 5464H, function 0DH, to write the sector at Register Pair HL to cylinder 0 sector 2. The result is not tested.
63D2
(Run 5AD2H.) GOSUB to 5327H to have the source diskette in its drive.
63D5
GOSUB to 5FF1H (the row at 68F1H) to read the source's hash index table into 6200H; Register A = 16H.
63D8
If the NZ FLAG is set (the read failed), JUMP to 52A0H with error 16H, HIT read error.
63DB
LD HL,6200H 21 00 62
Point Register Pair HL to 6200H, the first entry of the source's hash index table.
63DE
JUMP to 6403H (run 5B03H) to look at the first entry of the hash index table.
63E0-63E9
DEFM ".RS0LT0FF:" 2E 52 53 30 4C 54 30 46 46 3A
63E0H-63E9H (run 5AE0H-5AE9H): the password and the colon that 6819H puts after every file name, then the drive digit: RS0LT0FF, the master password, opens any file whatever its own password.
63EAH - The Directory Scan (Run 5AEAH)
The source's hash index table (6200H) is walked in the order of its entries (record n is entry n: the sector of directory records is n AND 1FH plus 2, its place in the sector n AND E0H). A free entry (00H) and records 00H and 01H (BOOT/SYS, DIR/SYS) are passed over. Each record is read into 5800H and tested: in use (+00H bit 4), not an extension record (bit 7), changed (+01H bit 6) when MOD is given, a system file (bit 6) only with SYS, an invisible file (bit 3) only with INV, the partspec, the DATE range. 5AEAH and 5AEBH are where a file is passed over; BREAK ends the backup there; after the last entry the backup is complete.
63EA
POP HL E1
(Run 5AEAH.) Restore Register Pair HL (the record, saved at 6496H or 646AH) from the stack: the entry where a file is passed over with the record on the stack.
63EB
POP BC C1
(Run 5AEBH.) Restore Register Pair BC from the stack: Register B = the record number of the file (saved at 640DH).
63EC
GOSUB to 002BH, the ROM's keyboard scan: Register A = the character of a key newly pressed, 00H when there is none.
63EF
CP 01H FE 01
Compare Register A against 01H, the character of the BREAK key.
63F1
If the Z FLAG is set (BREAK), JUMP to 52ACH: Backup aborted.
63F4
LD H,62H 26 62
Load Register H with 62H: Register Pair HL into the hash index table at 6200H.
63F6
LD L,B 68
Copy Register B (the record number) into Register L: Register Pair HL = its entry.
63F7
LD A,L 7D
(Run 5AF7H.) Copy Register L (the record number) into Register A.
63F8
ADD A,20H C6 20
ADD 20H to Register A: the next record in the same sector of directory records; the CARRY FLAG after the eighth.
63FA
LD L,A 6F
Copy Register A into Register L: Register Pair HL at the next entry.
63FB
If the NO CARRY FLAG is set (a record of the same sector), JUMP to 6403H (run 5B03H).
63FD
INC L 2C
INCrement Register L: the first record of the next sector.
63FE
BIT 5,L CB 6D
Test bit 5 of Register L: set at 20H, after the 32 sectors.
6400
If the NZ FLAG is set (every record is done), JUMP to 5287H: Backup complete.
6403
LD A,(HL) 7E
(Run 5B03H.) Load Register A with the hash index byte of the record at Register Pair HL.
6404
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H, a free record.
6405
If the Z FLAG is set (free), JUMP to 63F7H (run 5AF7H) for the next record.
6407
LD A,L 7D
Copy Register L (the record number) into Register A.
6408
AND FEH E6 FE
Mask Register A with FEH: 00H for records 00H and 01H, BOOT/SYS and DIR/SYS.
640A
If the Z FLAG is set (BOOT/SYS or DIR/SYS), JUMP to 63F7H (run 5AF7H): they are not copied as files.
640C
LD B,L 45
Copy Register L (the record number) into Register B.
640D
PUSH BC C5
Save Register Pair BC (Register B = the record number) to the stack, for 5AEBH and the copy.
640E
GOSUB to 5327H to have the source diskette in its drive.
6411
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the source's directory cylinder.
6414
LD A,B 78
Copy Register B (the record number) into Register A.
6415
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the record's sector less 2.
6417
ADD A,02H C6 02
ADD 02H to Register A: the sector of directory records that holds the record.
6419
LD E,A 5F
Copy Register A (the sector) into Register E.
641A
LD HL,5800H 21 00 58
Point Register Pair HL to 5800H, the directory sector buffer.
641D
GOSUB to 546CH, function 09H, to read cylinder Register D sector Register E into Register Pair HL (5800H).
6420
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
6422
If the NZ FLAG is set (not 06H), JUMP to 529BH: error 11H, Directory read error.
6425
LD A,B 78
Copy Register B (the record number) into Register A.
6426
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): the record's place in the sector (0, 20H ... E0H).
6428
LD L,A 6F
Copy Register A (the record's place in the sector) into Register L.
6429
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = the record in 5800H.
642B
LD A,(HL) 7E
Load Register A with the record's attribute byte (+00H) at Register Pair HL.
642C
LD (5D13H),A 32 13 5D
Store Register A (the attribute byte) at 5D13H, the operand of LD A,00H at 6612H (run 5D12H).
642F
BIT 4,A CB 67
Test bit 4 of Register A: set when the record is in use.
6431
If the Z FLAG is set (not in use), JUMP to 5AEBH (the row at 63EBH): passed over.
6434
BIT 7,A CB 7F
Test bit 7 of Register A: set in an extension record.
6436
If the NZ FLAG is set (an extension record), JUMP to 5AEBH (the row at 63EBH): passed over.
6439
LD A,(5217H) 3A 17 52
Load Register A with the low byte of the MOD cell at 5217H (FFH when MOD was given).
643C
OR A B7
Set the flags from Register A (OR A): the Z FLAG without MOD.
643D
If the Z FLAG is set (no MOD), JUMP to 6446H (run 5B46H).
643F
INC L 2C
INCrement Register L to +01H of the record, the byte with the bit of a changed file.
6440
BIT 6,(HL) CB 76
Test bit 6 of +01H at Register Pair HL: set when the file was changed.
6442
If the Z FLAG is set (not changed), JUMP to 5AEBH (the row at 63EBH): passed over.
6445
DEC L 2D
DECrement Register L back to +00H of the record.
6446
LD A,(5210H) 3A 10 52
(Run 5B46H.) Load Register A with the attribute selection byte at 5210H (bit 6 SYS, bit 3 INV).
6449
BIT 6,(HL) CB 76
Test bit 6 of the attribute byte at Register Pair HL: set for a system file.
644B
If the Z FLAG is set (not a system file), JUMP to 6451H (run 5B51H).
644D
BIT 6,A CB 77
Test bit 6 of Register A (the selection): set when SYS was given.
644F
JUMP to 6457H (run 5B57H) with the Z FLAG of that test.
6451
BIT 3,(HL) CB 5E
(Run 5B51H.) Test bit 3 of the attribute byte at Register Pair HL: set for an invisible file.
6453
If the Z FLAG is set (a visible file), JUMP to 645CH (run 5B5CH).
6455
BIT 3,A CB 5F
Test bit 3 of Register A (the selection): set when INV was given.
6457
(Run 5B57H.) If the NZ FLAG is set (SYS, or INV, was given), JUMP to 645CH (run 5B5CH).
6459
JUMP to 5AEBH (the row at 63EBH): a system or invisible file without SYS or INV is passed over.
645C
LD A,(5205H) 3A 05 52
(Run 5B5CH.) Load Register A with the first character of the partspec's file name at 5205H.
645F
CP 20H FE 20
Compare Register A against 20H, a space: no file name given.
6461
If the NZ FLAG is set (a name), JUMP to 646AH (run 5B6AH) to compare.
6463
LD A,(520DH) 3A 0D 52
Load Register A with the first character of the partspec's extension at 520DH.
6466
CP 20H FE 20
Compare Register A against 20H, a space: no extension given.
6468
If the Z FLAG is set (no partspec), JUMP to 6496H (run 5B96H): every file matches.
646A
PUSH HL E5
(Run 5B6AH.) Save Register Pair HL (the record) to the stack.
646B
LD A,L 7D
Copy Register L (the record's place) into Register A.
646C
ADD A,05H C6 05
ADD 05H to Register A (the record's place): +05H, the record's file name.
646E
LD L,A 6F
Copy Register A into Register L: Register Pair HL at the record's name.
646F
LD DE,5205H 11 05 52
Point Register Pair DE to 5205H, the partspec's name and extension (11 characters).
6472
LD B,0BH 06 0B
Load Register B with 0BH: 11 characters, the name and the extension.
6474
LD A,(DE) 1A
(Run 5B74H.) Load Register A with the partspec's character at Register Pair DE.
6475
CP 24H FE 24
Compare Register A against 24H, the dollar sign: it matches any character.
6477
If the Z FLAG is set ($), JUMP to 6481H (run 5B81H): this position matches.
6479
CP (HL) BE
Compare Register A against the record's character at Register Pair HL.
647A
If the Z FLAG is set (the same), JUMP to 6481H (run 5B81H).
647C
CP 20H FE 20
Compare Register A against 20H: a space in the partspec matches any character too, so ABC matches ABCDEF.
647E
If the NZ FLAG is set (another character), JUMP to 5B8EH (the row at 648EH): the name does not match.
6481
INC HL 23
(Run 5B81H.) INCrement Register Pair HL to the record's next character.
6482
INC DE 13
INCrement Register Pair DE to the partspec's next character.
6483
DECrement Register B and LOOP BACK to 6474H (run 5B74H) for the 11 characters.
6485
LD A,(5211H) 3A 11 52
Load Register A with the exclusion flag at 5211H (2DH after a leading minus sign).
6488
OR A B7
Set the flags from Register A (OR A): the NZ FLAG for a minus sign.
6489
If the NZ FLAG is set (all files but those that match), JUMP to 5AEAH (the row at 63EAH): passed over.
648C
JUMP to 6495H (run 5B95H): the file matches, so it is taken.
648E
LD A,(5211H) 3A 11 52
(Run 5B8EH.) Load Register A with the exclusion flag at 5211H.
6491
OR A B7
Set the flags from Register A (OR A): the Z FLAG without a minus sign.
6492
If the Z FLAG is set (only the files that match), JUMP to 5AEAH (the row at 63EAH): passed over.
6495
POP HL E1
(Run 5B95H.) Restore Register Pair HL (the record) from the stack.
6496
PUSH HL E5
(Run 5B96H.) Save Register Pair HL (the record) to the stack.
6497
INC HL 23
INCrement Register Pair HL to +01H of the record.
6498
GOSUB to 5F4AH (the row at 684AH) to pack the record's date at Register Pair HL into Register Pair DE as 5CCCH packs the DATE parameter.
649B
LD A,(5200H) 3A 00 52
Load Register A with the DATE mode at 5200H (bit 7 a first date, bit 0 a second date).
649E
RLCA 07
Rotate Register A left one bit (RLCA): bit 7, a first date, into the CARRY FLAG.
649F
If the NO CARRY FLAG is set (no first date), JUMP to 64AFH (run 5BAFH).
64A1
LD A,D 7A
Copy Register D (the high byte of the record's date) into Register A.
64A2
OR E B3
OR Register E into Register A: the Z FLAG when the record has no date (0000H).
64A3
If the Z FLAG is set (no date), JUMP to 5AEAH (the row at 63EAH): passed over.
64A6
LD HL,(5201H) 2A 01 52
Load Register Pair HL with the first date at 5201H-5202H.
64A9
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the record's date, Register Pair DE = the first date.
64AA
RST 18H DF
RST 18H, the ROM's compare of Register Pair HL with Register Pair DE: the CARRY FLAG when Register Pair HL (the record's date) is below Register Pair DE (the first date).
64AB
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair DE = the record's date.
64AC
If the CARRY FLAG is set (dated before the first date), JUMP to 5AEAH (the row at 63EAH): passed over.
64AF
LD A,(5200H) 3A 00 52
(Run 5BAFH.) Load Register A with the DATE mode at 5200H.
64B2
RRCA 0F
Rotate Register A right one bit (RRCA): bit 0, a second date, into the CARRY FLAG.
64B3
If the NO CARRY FLAG is set (no second date), JUMP to 64C1H (run 5BC1H).
64B5
LD A,D 7A
Copy Register D (the high byte of the record's date) into Register A.
64B6
OR E B3
OR Register E into Register A: the Z FLAG when the record has no date.
64B7
If the Z FLAG is set (no date), JUMP to 5AEAH (the row at 63EAH): passed over.
64BA
LD HL,(5203H) 2A 03 52
Load Register Pair HL with the second date at 5203H-5204H.
64BD
RST 18H DF
RST 18H, the ROM's compare of Register Pair HL (the second date) with Register Pair DE (the record's date): the CARRY FLAG when the second date is lower.
64BE
If the CARRY FLAG is set (dated after the second date), JUMP to 5AEAH (the row at 63EAH): passed over.
64C1H - NEW, OLD and the Question (Run 5BC1H)
The file's name goes into the source control block at 521DH as NAME/EXT. With NEW or OLD the destination is asked for the file (@OPEN): NEW copies only files it lacks (error 18H), OLD only files it has, and both together any file whose @OPEN gives 18H or no error. With QUERY the question Backup NAME/EXT + {DD-Mmm-YY} ? is asked (the + for a changed file): Y copies, C copies this file and asks no more, anything else passes it over. Without QUERY, Copying file: and the name are shown and written to the job log.
64C1
POP HL E1
(Run 5BC1H.) Restore Register Pair HL (the record, from 6496H) from the stack.
64C2
LD A,L 7D
(Run 5BC2H.) Copy Register L into Register A. 6729H comes here again for a file to be copied to a new destination diskette.
64C3
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): the record's start.
64C5
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the record (+00H) in 5800H.
64C6
PUSH HL E5
Save Register Pair HL (the record) to the stack.
64C7
ADD A,05H C6 05
ADD 05H to Register A (the record's start): +05H, the record's file name.
64C9
LD L,A 6F
Copy Register A into Register L: Register Pair HL at the record's name.
64CA
LD DE,521DH 11 1D 52
Point Register Pair DE to 521DH, the source's file control block, where the specification is built.
64CD
LD B,08H 06 08
Load Register B with 08H: at most 8 characters of the name.
64CF
LD A,(HL) 7E
(Run 5BCFH.) Load Register A with the name's character at Register Pair HL.
64D0
CP 20H FE 20
Compare Register A against 20H, a space: the end of the name.
64D2
If the Z FLAG is set (a space), JUMP to 64D9H (run 5BD9H).
64D4
LD (DE),A 12
Store Register A (the character) at Register Pair DE.
64D5
INC HL 23
INCrement Register Pair HL to the next character of the name.
64D6
INC DE 13
INCrement Register Pair DE to the next place of the specification.
64D7
DECrement Register B and LOOP BACK to 64CFH (run 5BCFH) for the 8 characters.
64D9
LD A,L 7D
(Run 5BD9H.) Copy Register L into Register A.
64DA
ADD A,B 80
ADD Register B (the places of the name left) to Register A.
64DB
LD L,A 6F
Copy Register A into Register L: Register Pair HL at +0DH, the extension.
64DC
LD A,(HL) 7E
Load Register A with the extension's first character at Register Pair HL.
64DD
CP 20H FE 20
Compare Register A against 20H, a space: no extension.
64DF
If the Z FLAG is set (no extension), JUMP to 64F1H (run 5BF1H).
64E1
LD A,2FH 3E 2F
Load Register A with 2FH, the slash before an extension.
64E3
LD (DE),A 12
Store Register A (2FH) at Register Pair DE in the specification.
64E4
INC DE 13
INCrement Register Pair DE to the next place of the specification.
64E5
LD B,03H 06 03
Load Register B with 03H: at most 3 characters of the extension.
64E7
LD A,(HL) 7E
(Run 5BE7H.) Load Register A with the extension's character at Register Pair HL.
64E8
CP 20H FE 20
Compare Register A against 20H, a space: the end of the extension.
64EA
If the Z FLAG is set (a space), JUMP to 64F1H (run 5BF1H).
64EC
LD (DE),A 12
Store Register A (the character) at Register Pair DE.
64ED
INC HL 23
INCrement Register Pair HL to the next character of the extension.
64EE
INC DE 13
INCrement Register Pair DE to the next place of the specification.
64EF
DECrement Register B and LOOP BACK to 64E7H (run 5BE7H) for the 3 characters.
64F1
LD A,03H 3E 03
(Run 5BF1H.) Load Register A with 03H, the end of a text.
64F3
LD (DE),A 12
Store Register A (03H) at Register Pair DE: the specification can be displayed.
64F4
PUSH DE D5
Save Register Pair DE (the end of the name in 521DH) to the stack.
64F5
LD A,(5215H) 3A 15 52
Load Register A with the low byte of the OLD cell at 5215H.
64F8
LD HL,5213H 21 13 52
Point Register Pair HL to 5213H, the NEW cell.
64FB
OR (HL) B6
OR the low byte of the NEW cell at Register Pair HL into Register A: the Z FLAG when neither NEW nor OLD was given.
64FC
If the Z FLAG is set (neither), JUMP to 653EH (run 5C3EH).
64FE
LD HL,521DH 21 1D 52
Point Register Pair HL to 521DH, the specification.
6501
LD DE,525DH 11 5D 52
Point Register Pair DE to 525DH, where it is kept.
6504
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the count of the bytes: 32, the whole control block.
6507
LDIR ED B0
Copy Register Pair BC (32) bytes from Register Pair HL (521DH) to Register Pair DE (525DH) (LDIR): the specification is kept, since 6819H adds to it and @OPEN changes the destination's block.
6509
POP DE D1
Restore Register Pair DE (the end of the name) from the stack.
650A
PUSH DE D5
Save Register Pair DE (the end of the name) to the stack again.
650B
GOSUB to 5F19H (the row at 6819H) to add .RS0LT0FF:d after the name at Register Pair DE and make the destination's specification at 523DH.
650E
GOSUB to 5FE8H (the row at 68E8H) to have the destination diskette in its drive; Register Pair DE = 523DH.
6511
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the buffer for @OPEN.
6514
LD DE,523DH 11 3D 52
Point Register Pair DE to 523DH, the destination's file control block.
6517
GOSUB to 4424H, @OPEN, to open the file at Register Pair DE on the destination with the buffer at Register Pair HL: the Z FLAG when it is there.
651A
POP DE D1
Restore Register Pair DE (the end of the name) from the stack.
651B
If the Z FLAG is set (the destination has the file), JUMP to 652BH (run 5C2BH).
651D
CP 18H FE 18
Compare Register A (the error) against 18H, error 18H, File not in directory.
651F
If the NZ FLAG is set (another error), JUMP to 5AEAH (the row at 63EAH): the file is passed over.
6522
LD A,(5213H) 3A 13 52
Load Register A with the low byte of the NEW cell at 5213H.
6525
OR A B7
Set the flags from Register A (OR A): the NZ FLAG for NEW.
6526
If the NZ FLAG is set (NEW, and the destination lacks the file), JUMP to 6532H (run 5C32H) to copy it.
6528
JUMP to 5AEAH (the row at 63EAH): OLD alone, and the destination lacks the file.
652B
LD A,(5215H) 3A 15 52
(Run 5C2BH.) Load Register A with the low byte of the OLD cell at 5215H.
652E
OR A B7
Set the flags from Register A (OR A): the Z FLAG without OLD.
652F
If the Z FLAG is set (NEW alone, and the destination has the file), JUMP to 5AEAH (the row at 63EAH): passed over.
6532
PUSH DE D5
(Run 5C32H.) Save Register Pair DE (the end of the name) to the stack.
6533
LD HL,525DH 21 5D 52
Point Register Pair HL to 525DH, the specification as kept.
6536
LD DE,521DH 11 1D 52
Point Register Pair DE to 521DH, the source's file control block.
6539
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the count of the bytes: 32.
653C
LDIR ED B0
Copy Register Pair BC (32) bytes from Register Pair HL (525DH) to Register Pair DE (521DH) (LDIR): NAME/EXT and 03H again.
653E
LD A,(521AH) 3A 1A 52
(Run 5C3EH.) Load Register A with the high byte of the QUERY cell at 521AH (FFH while questions are asked).
6541
OR A B7
Set the flags from Register A (OR A): the Z FLAG without QUERY.
6542
If the Z FLAG is set (no question), JUMP to 5CF4H (the row at 65F4H).
6545
LD HL,6017H 21 17 60
Point Register Pair HL to 6017H, the text at 6917H on this page: Backup (03H at the end).
6548
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL.
654B
POP DE D1
Restore Register Pair DE (the end of the name, saved at 64F4H or 6532H) from the stack.
654C
POP HL E1
Restore Register Pair HL (the record, saved at 64C6H) from the stack.
654D
PUSH DE D5
Save Register Pair DE (the end of the name) to the stack.
654E
INC HL 23
INCrement Register Pair HL to +01H of the record.
654F
BIT 6,(HL) CB 76
Test bit 6 of +01H at Register Pair HL: set when the file was changed.
6551
If the Z FLAG is set (not changed), JUMP to 655BH (run 5C5BH).
6553
LD A,20H 3E 20
Load Register A with 20H, a space, before the plus sign.
6555
LD (DE),A 12
Store Register A (20H) at Register Pair DE, after the name.
6556
INC DE 13
INCrement Register Pair DE to the next place.
6557
LD A,2BH 3E 2B
Load Register A with 2BH, the plus sign of a changed file.
6559
LD (DE),A 12
Store Register A (2BH, the plus sign) at Register Pair DE in the text.
655A
INC DE 13
INCrement Register Pair DE to the next place.
655B
LD A,20H 3E 20
(Run 5C5BH.) Load Register A with 20H, a space.
655D
LD (DE),A 12
Store Register A (20H, a space) at Register Pair DE in the text.
655E
INC DE 13
INCrement Register Pair DE to the next place.
655F
INC HL 23
INCrement Register Pair HL to +02H of the record: bits 7-3 the day, bits 2-0 the year.
6560
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the place in the text.
6561
LD (HL),7BH 36 7B
Store 7BH, the opening brace, at Register Pair HL.
6563
INC HL 23
INCrement Register Pair HL to the next place.
6564
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair DE = the place, Register Pair HL = +02H.
6565
LD A,(HL) 7E
Load Register A with +02H of the record at Register Pair HL.
6566
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H, a file without a date.
6567
If the Z FLAG is set (no date), JUMP to 65C8H (run 5CC8H): only the brace is shown.
6569
RRCA 0F
Rotate Register A (+02H of the record) right one bit (RRCA), the first of three.
656A
RRCA 0F
Rotate Register A right one bit (RRCA), the second of the three shifts.
656B
RRCA 0F
Rotate Register A right one bit (RRCA): the day in bits 4-0.
656C
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the day, 1-31.
656E
LD B,2FH 06 2F
Load Register B with 2FH, the character before 0.
6570
INC B 04
(Run 5C70H.) INCrement Register B: the tens digit as a character.
6571
SUB 0AH D6 0A
SUBtract 0AH (10) from Register A, one ten of the day.
6573
If the NO CARRY FLAG is set (10 or more were left), LOOP BACK to 6570H (run 5C70H).
6575
ADD A,3AH C6 3A
ADD 3AH to Register A: the units (less 10, plus 10) plus 30H, the units digit as a character.
6577
PUSH AF F5
Save Register Pair AF (Register A = the units digit) to the stack.
6578
LD A,B 78
Copy Register B (the tens digit) into Register A.
6579
LD (DE),A 12
Store Register A (the tens digit) at Register Pair DE.
657A
INC DE 13
INCrement Register Pair DE to the next place.
657B
POP AF F1
Restore Register Pair AF (Register A = the units digit) from the stack.
657C
LD (DE),A 12
Store Register A (the units digit) at Register Pair DE.
657D
INC DE 13
INCrement Register Pair DE to the next place.
657E
LD A,2DH 3E 2D
Load Register A with 2DH, a minus sign between the day and the month.
6580
LD (DE),A 12
Store Register A (2DH, the minus sign) at Register Pair DE in the text.
6581
INC DE 13
INCrement Register Pair DE to the next place.
6582
PUSH HL E5
Save Register Pair HL (+02H of the record) to the stack.
6583
DEC HL 2B
DECrement Register Pair HL to +01H of the record.
6584
LD A,(HL) 7E
Load Register A with +01H of the record at Register Pair HL.
6585
AND 0FH E6 0F
Mask Register A to bits 3-0 (AND 0FH): the month, 1-12.
6587
DEC A 3D
DECrement Register A (the month, 1-12): the month less 1, 0-11.
6588
LD C,A 4F
Copy Register A (the month less 1) into Register C.
6589
RLCA 07
Rotate Register A left one bit (RLCA): twice the month less 1.
658A
ADD A,C 81
ADD Register C to Register A: three times the month less 1, the place of its name.
658B
LD C,A 4F
Copy Register A (three times the month less 1) into Register C.
658C
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the place of the month's name.
658E
LD HL,6114H 21 14 61
Point Register Pair HL to 6114H, the names of the months at 6A14H on this page.
6591
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: Register Pair HL at the month's three letters.
6592
LD C,03H 0E 03
Load Register C with 03H: Register Pair BC = 0003H, 3 letters.
6594
LDIR ED B0
Copy Register Pair BC (3) bytes from Register Pair HL to Register Pair DE (LDIR): the month's name.
6596
LD A,2DH 3E 2D
Load Register A with 2DH, a minus sign between the month and the year.
6598
LD (DE),A 12
Store Register A (2DH, the minus sign) at Register Pair DE in the text.
6599
INC DE 13
INCrement Register Pair DE to the next place.
659A
POP HL E1
Restore Register Pair HL (+02H of the record) from the stack.
659B
LD C,38H 0E 38
Load Register C with 38H, the digit 8: the tens of a year in the 1980s.
659D
LD A,(475DH) 3A 5D 47
Load Register A with the date stamping flags at 475DH (bit n for drive n).
65A0
BIT 0,A CB 47
Test bit 0 of Register A: the bit of drive 0, whatever the source drive.
65A2
If the NZ FLAG is set (bit 0 set), JUMP to 65A9H (run 5CA9H) to take the year from +13H.
65A4
LD A,(HL) 7E
Load Register A with +02H of the record at Register Pair HL.
65A5
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the year less 1980, 0-7.
65A7
JUMP to 65BFH (run 5CBFH) with the units of the year in Register A and 8 in Register C.
65A9
LD A,L 7D
(Run 5CA9H.) Copy Register L into Register A.
65AA
ADD A,11H C6 11
ADD 11H to Register A: from +02H to +13H of the record.
65AC
LD L,A 6F
Copy Register A into Register L: Register Pair HL at +13H.
65AD
LD A,(HL) 7E
Load Register A with +13H of the record at Register Pair HL.
65AE
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the year less 1980, 0-31.
65B0
CP 14H FE 14
Compare Register A against 14H (20): the CARRY FLAG for 1980-1999.
65B2
If the CARRY FLAG is set (before 2000), JUMP to 65B8H (run 5CB8H).
65B4
SUB 14H D6 14
SUBtract 14H (20) from Register A: the year less 2000.
65B6
LD C,30H 0E 30
Load Register C with 30H, the digit 0: the tens of 2000-2009.
65B8
CP 0AH FE 0A
(Run 5CB8H.) Compare Register A against 0AH: the CARRY FLAG below 10.
65BA
If the CARRY FLAG is set (below 10), JUMP to 65BFH (run 5CBFH).
65BC
INC C 0C
INCrement Register C: the tens digit one higher (9 for the 1990s, 1 for 2010-2011).
65BD
SUB 0AH D6 0A
SUBtract 0AH (10) from Register A: the units of the year.
65BF
LD B,A 47
(Run 5CBFH.) Copy Register A (the units) into Register B.
65C0
LD A,C 79
Copy Register C (the tens digit) into Register A.
65C1
LD (DE),A 12
Store Register A (the tens digit) at Register Pair DE.
65C2
INC DE 13
INCrement Register Pair DE to the next place.
65C3
LD A,B 78
Copy Register B (the units of the year) into Register A.
65C4
ADD A,30H C6 30
ADD 30H to Register A: the units digit as a character.
65C6
LD (DE),A 12
Store Register A (the units digit) at Register Pair DE.
65C7
INC DE 13
INCrement Register Pair DE to the next place.
65C8
LD A,03H 3E 03
(Run 5CC8H.) Load Register A with 03H, the end of a text.
65CA
LD (DE),A 12
Store Register A (03H) at Register Pair DE: the end of the text after the date.
65CB
LD HL,521DH 21 1D 52
Point Register Pair HL to 521DH: the name and the date built there.
65CE
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL.
65D1
LD HL,6103H 21 03 61
Point Register Pair HL to 6103H, the text at 6A03H on this page: } ? (03H at the end).
65D4
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL.
65D7
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the buffer of the reply.
65DA
LD B,03H 06 03
Load Register B with 03H: the reply is at most 3 characters.
65DC
GOSUB to 0040H, the ROM's line input: up to Register B (3) characters at Register Pair HL; the CARRY FLAG for BREAK.
65DF
If the CARRY FLAG is set (BREAK), JUMP to 52ACH: Backup aborted.
65E2
LD A,(HL) 7E
Load Register A with the first character of the reply at Register Pair HL.
65E3
RES 5,A CB AF
Clear bit 5 of Register A (the first character of the reply): y becomes Y, c becomes C.
65E5
CP 59H FE 59
Compare Register A against 59H, Y: copy the file.
65E7
POP DE D1
Restore Register Pair DE (the end of the name) from the stack. POP does not change the flags.
65E8
If the Z FLAG is set (Y), JUMP to 6607H (run 5D07H) to copy the file.
65EA
SUB 43H D6 43
SUBtract 43H, the letter C, from Register A: 00H, and the Z FLAG, for C.
65EC
If the NZ FLAG is set (neither Y nor C), JUMP to 5AEBH (the row at 63EBH): passed over.
65EF
LD (521AH),A 32 1A 52
Store Register A (00H) at 521AH, the high byte of the QUERY cell: no more questions.
65F2
JUMP to 6607H (run 5D07H) to copy the file after the reply C.
65F4
LD HL,6007H 21 07 60
(Run 5CF4H.) Point Register Pair HL to 6007H, the text at 6907H on this page: Copying file: (1DH first, 03H at the end).
65F7
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL and write it to the job log.
65FA
LD HL,521DH 21 1D 52
Point Register Pair HL to 521DH, the name of the file.
65FD
GOSUB to 428AH, @LOGOT, to display the name at Register Pair HL and write it to the job log.
6600
LD A,0DH 3E 0D
Load Register A with 0DH, a new line after the file's name.
6602
GOSUB to 0033H, the ROM's display of the character in Register A (0DH).
6605
POP DE D1
Restore Register Pair DE (the end of the name) from the stack.
6606
POP HL E1
Restore Register Pair HL (the record, saved at 64C6H) from the stack.
6607H - A System File (Run 5D07H)
The specifications NAME/EXT.RS0LT0FF:d of the source (521DH) and of the destination (523DH) are made. A file whose record is 00H-07H or 20H-27H (Register B AND D8H is 00H) and has the attribute of a system file (bit 6) gets its record on the destination at the same place: a free record there is made a system file's record (5FH, 00H in +01H-+04H, FFH in +10H-+1FH), and the name, extension and password hash (+05H-+11H) are copied; a record of the destination that is not a system file's gives Can't create SYSTEM disk. For SYS0/SYS (record 02H) sectors 2-4 of cylinder 0 are copied as well, with C9H in byte 01H of the system information sector. Then the file is copied as any other.
6607
(Run 5D07H.) GOSUB to 5F19H (the row at 6819H) to add .RS0LT0FF:d after the name at Register Pair DE and make the destination's specification at 523DH.
660A
POP BC C1
Restore Register Pair BC (Register B = the record number, from 640DH) from the stack.
660B
PUSH BC C5
Save Register Pair BC (the record number) to the stack again.
660C
LD A,B 78
Copy Register B (the record number) into Register A.
660D
AND D8H E6 D8
Mask Register A with D8H: 00H only for records 00H-07H and 20H-27H, the places of the system files.
660F
If the NZ FLAG is set (another place), JUMP to 5DE2H (the row at 66E2H) to copy an ordinary file.
6612
LD A,00H 3E 00
Load Register A with the operand at 6613H: the attribute byte of the record (642CH).
6614
BIT 6,A CB 77
Test bit 6 of Register A (the attribute): set for a system file.
6616
If the Z FLAG is set (not a system file), JUMP to 5DE2H (the row at 66E2H) to copy it as an ordinary file.
6619
GOSUB to 5394H to have the destination diskette in its drive.
661C
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the destination's directory cylinder.
661F
LD A,B 78
Copy Register B (the record number) into Register A.
6620
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the sector less 2.
6622
ADD A,02H C6 02
ADD 02H to Register A: the sector of directory records.
6624
LD E,A 5F
Copy Register A (the sector) into Register E.
6625
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, a page for the sector.
6628
GOSUB to 546CH, function 09H, to read the destination's directory sector (Register D, Register E) into Register Pair HL.
662B
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
662D
If the NZ FLAG is set (not 06H), JUMP to 529BH: error 11H, Directory read error.
6630
LD A,B 78
Copy Register B (the record number) into Register A.
6631
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): the record's place in the sector.
6633
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the destination's record at the same place.
6634
BIT 4,(HL) CB 66
Test bit 4 of the destination record's attribute byte at Register Pair HL: set when it is in use.
6636
If the NZ FLAG is set (in use), JUMP to 6652H (run 5D52H).
6638
LD (HL),5FH 36 5F
Store 5FH at Register Pair HL: the attribute of a new system file's record (bit 6 system, bit 4 in use, bit 3 invisible, access level 7).
663A
INC HL 23
INCrement Register Pair HL to +01H of the record.
663B
LD (HL),00H 36 00
Store 00H at Register Pair HL (+01H of the new record): no flags and no month.
663D
LD D,H 54
Copy Register H (the page of the record) into Register D.
663E
LD E,L 5D
Copy Register L into Register E: Register Pair DE = +01H.
663F
INC DE 13
INCrement Register Pair DE to +02H, one place above Register Pair HL, for the LDIR.
6640
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, the count of the bytes: 3.
6643
LDIR ED B0
Copy Register Pair BC (3) bytes from Register Pair HL to Register Pair DE (LDIR): +02H-+04H get 00H. Register Pair HL ends at +04H.
6645
LD A,L 7D
Copy Register L (+04H of the record) into Register A.
6646
ADD A,0CH C6 0C
ADD 0CH to Register A (+04H of the record): +10H, the password hash.
6648
LD L,A 6F
Copy Register A into Register L: Register Pair HL at +10H.
6649
INC A 3C
INCrement Register A (+10H): +11H, one place above.
664A
LD E,A 5F
Copy Register A into Register E: Register Pair DE at +11H.
664B
LD (HL),FFH 36 FF
Store FFH at Register Pair HL (+10H of the new record), the byte the LDIR carries up.
664D
LD BC,000FH 01 0F 00
Load Register Pair BC with 000FH, the count of the bytes: 15.
6650
LDIR ED B0
Copy Register Pair BC (15) bytes from Register Pair HL to Register Pair DE (LDIR): +11H-+1FH get FFH, no extents.
6652
LD A,L 7D
(Run 5D52H.) Copy Register L into Register A.
6653
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): the record's start.
6655
BIT 6,(HL) CB 76
Test bit 6 of the byte at Register Pair HL: for a record in use (from 6636H) its attribute, set for a system file; after a new record was made (6650H) Register Pair HL is at its +1FH, FFH, so the test is passed.
6657
If the Z FLAG is set (the place holds another kind of file), JUMP to 5A9FH (the row at 639FH): Can't create SYSTEM disk - directory slots in use!
665A
ADD A,05H C6 05
ADD 05H to Register A (the record's start): +05H, the name.
665C
LD L,A 6F
Copy Register A into Register L: Register Pair HL at the name of the source's record.
665D
LD E,A 5F
Copy Register A into Register E, the low byte of the destination's place.
665E
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = +05H of the source's record in 5800H.
6660
LD A,(5286H) 3A 86 52
Load Register A with the high byte of the work area start at 5286H.
6663
LD D,A 57
Copy Register A into Register D: Register Pair DE = +05H of the destination's record in the work area.
6664
LD BC,000DH 01 0D 00
Load Register Pair BC with 000DH, the count of the bytes: 13.
6667
LDIR ED B0
Copy Register Pair BC (13) bytes from Register Pair HL to Register Pair DE (LDIR): the name, the extension and the password hash (+05H-+11H).
6669
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the destination's directory cylinder.
666C
POP BC C1
Restore Register Pair BC (Register B = the record number) from the stack.
666D
PUSH BC C5
Save Register Pair BC (the record number) to the stack again.
666E
LD A,B 78
Copy Register B (the record number) into Register A.
666F
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the sector less 2.
6671
ADD A,02H C6 02
ADD 02H to Register A: the sector of directory records.
6673
LD E,A 5F
Copy Register A (the sector) into Register E.
6674
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the changed sector.
6677
GOSUB to 5468H, function 0EH, to write it to cylinder Register D sector Register E with the deleted data mark.
667A
LD A,12H 3E 12
Load Register A with 12H, error 12H, Directory write error. LD does not change the flags.
667C
If the NZ FLAG is set (the write failed), JUMP to 52A0H with error 12H in Register A.
667F
POP BC C1
Restore Register Pair BC (Register B = the record number) from the stack.
6680
PUSH BC C5
Save Register Pair BC (the record number) to the stack again.
6681
LD A,B 78
Copy Register B (the record number) into Register A.
6682
CP 02H FE 02
Compare Register A against 02H: record 02H, SYS0/SYS.
6684
If the NZ FLAG is set (another system file), JUMP to 66E2H (run 5DE2H) to copy it.
6686
GOSUB to 5327H to have the source diskette in its drive.
6689
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H: Register D = cylinder 0, Register E = sector 2, the system information sector.
668C
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the first page.
668F
GOSUB to 546CH, function 09H, to read the source's sector into Register Pair HL.
6692
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
6695
INC L 2C
INCrement Register L to byte 01H of the system information sector, the switch of CONFIG/SYS.
6696
LD (HL),C9H 36 C9
Store C9H at Register Pair HL: the destination will not load a configuration file.
6698
LD DE,0003H 11 03 00
Load Register Pair DE with 0003H: Register D = cylinder 0, Register E = sector 3.
669B
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H.
669E
INC H 24
INCrement Register H: Register Pair HL = the second page.
669F
GOSUB to 546CH, function 09H, to read the source's cylinder 0 sector 3 into Register Pair HL.
66A2
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
66A5
LD DE,0004H 11 04 00
Load Register Pair DE with 0004H: Register D = cylinder 0, Register E = sector 4.
66A8
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H.
66AB
INC H 24
INCrement Register H (the work area's first page) to the second page.
66AC
INC H 24
INCrement Register H: Register Pair HL = the third page.
66AD
GOSUB to 5470H, function 0AH, to verify the source's cylinder 0 sector 4.
66B0
If the NZ FLAG is set (not readable), JUMP to 66B8H (run 5DB8H) without reading it.
66B2
GOSUB to 546CH, function 09H, to read cylinder 0 sector 4 into Register Pair HL.
66B5
If the NZ FLAG is set (the read failed), JUMP to 52A0H with the error number in Register A.
66B8
(Run 5DB8H.) GOSUB to 5394H to have the destination diskette in its drive.
66BB
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H: Register D = cylinder 0, Register E = sector 2.
66BE
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the first page.
66C1
GOSUB to 5464H, function 0DH, to write the sector at Register Pair HL to the destination's cylinder 0 sector 2.
66C4
If the NZ FLAG is set (the write failed), JUMP to 52A0H with the error number in Register A.
66C7
LD DE,0003H 11 03 00
Load Register Pair DE with 0003H: Register D = cylinder 0, Register E = sector 3.
66CA
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H.
66CD
INC H 24
INCrement Register H: Register Pair HL = the second page.
66CE
GOSUB to 5464H, function 0DH, to write the sector at Register Pair HL to cylinder 0 sector 3.
66D1
If the NZ FLAG is set (the write failed), JUMP to 52A0H with the error number in Register A.
66D4
LD DE,0004H 11 04 00
Load Register Pair DE with 0004H: Register D = cylinder 0, Register E = sector 4.
66D7
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H.
66DA
INC H 24
INCrement Register H (the work area's first page) to the second page.
66DB
INC H 24
INCrement Register H: Register Pair HL = the third page (what was there when sector 4 could not be read).
66DC
GOSUB to 5464H, function 0DH, to write the sector at Register Pair HL to cylinder 0 sector 4.
66DF
If the NZ FLAG is set (the write failed), JUMP to 52A0H with the error number in Register A.
66E2H - Copy a File (Run 5DE2H)
The source file is opened (@OPEN, records of 256 bytes, buffer at the work area); a file of more records than the destination's room for data (5DF4H) is passed over with a message. The destination file is opened or created (@INIT) and its whole length written at once by 5FA8H (writing its last record), so a full diskette shows before any data moves: the file is killed, and a new destination diskette is asked for (not during a JCL job). Then the records are read into the work area page by page and written to the destination with @VER until the end of the file; the end of file byte and the record length go across, and the file is closed.
66E2
LD B,00H 06 00
(Run 5DE2H.) Load Register B with 00H: records of 256 bytes for @OPEN.
66E4
GOSUB to 5FDFH (the row at 68DFH) to have the source diskette in its drive; Register Pair DE = 521DH.
66E7
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the buffer of the source file.
66EA
GOSUB to 4424H, @OPEN, to open the file at Register Pair DE (521DH) with the buffer at Register Pair HL and the record length in Register B.
66ED
If the NZ FLAG is set (it cannot be opened), JUMP to 52A0H with the error number in Register A.
66F0
LD HL,(5229H) 2A 29 52
Load Register Pair HL with +0CH-+0DH of the source's control block at 5229H-522AH: the ending record number, the file's records.
66F3
LD DE,0000H 11 00 00
Load Register Pair DE with the operand at 66F4H-66F5H, 0000H in the file: the destination's sectors for data (633FH).
66F6
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the room, Register Pair DE = the file's records.
66F7
SBC HL,DE ED 52
SUBtract Register Pair DE (the records) from Register Pair HL (the room), with the CARRY FLAG as @OPEN left it.
66F9
If the NO CARRY FLAG is set (the file fits), JUMP to 6704H (run 5E04H).
66FB
LD HL,605EH 21 5E 60
Point Register Pair HL to 605EH, the text at 695EH on this page: File is larger than destination capacity - backup is bypassed.
66FE
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL and write it to the job log.
6701
JUMP to 5AEBH (the row at 63EBH): the file is passed over.
6704
LD B,00H 06 00
(Run 5E04H.) Load Register B with 00H: records of 256 bytes for @INIT.
6706
GOSUB to 5FE8H (the row at 68E8H) to have the destination diskette in its drive; Register Pair DE = 523DH.
6709
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the buffer of the destination file.
670C
GOSUB to 4420H, @INIT, to open the file at Register Pair DE (523DH), creating it when the destination lacks it.
670F
If the NZ FLAG is set (it cannot be opened or created), JUMP to 52A0H with the error number in Register A.
6712
LD A,(5244H) 3A 44 52
Load Register A with +07H of the destination's control block at 5244H: the number of the file's directory record.
6715
LD (5E83H),A 32 83 5E
Store Register A (the record number) at 5E83H, the operand of LD B,00H at 6782H (run 5E82H).
6718
LD BC,(5229H) ED 4B 29 52
Load Register Pair BC with the source's ending record number at 5229H-522AH: the records to write.
671C
GOSUB to 5FA8H (the row at 68A8H) to write the destination file's last record; the Z FLAG when the space is there.
671F
If the Z FLAG is set (the space is there), JUMP to 672CH (run 5E2CH).
6721
POP BC C1
Restore Register Pair BC (Register B = the record number) from the stack.
6722
LD L,B 68
Copy Register B (the record number) into Register L.
6723
LD H,58H 26 58
Load Register H with 58H: Register Pair HL into the source's directory sector at 5800H.
6725
PUSH BC C5
Save Register Pair BC (the record number) to the stack again.
6726
GOSUB to 5327H to have the source diskette in its drive.
6729
JUMP to 5BC2H (the row at 64C2H): the same file again, for the new destination diskette.
672C
LD HL,0000H 21 00 00
(Run 5E2CH.) Load Register Pair HL with 0000H.
672F
LD (5249H),HL 22 49 52
Store Register Pair HL (0000H) at 5249H-524AH, +0CH-+0DH of the destination's control block: the ending record number, so the copy writes the file again from its start.
6732
GOSUB to 443FH, @REW, to put the file at Register Pair DE (523DH) back at its first record.
6735
LD HL,(5285H) 2A 85 52
(Run 5E35H.) Load Register Pair HL with the work area start at 5285H-5286H, the first page.
6738
LD (5220H),HL 22 20 52
(Run 5E38H.) Store Register Pair HL (the page) at 5220H-5221H, +03H-+04H of the source's control block: @READ puts the next record there.
673B
GOSUB to 5FDFH (the row at 68DFH) to have the source diskette in its drive; Register Pair DE = 521DH.
673E
GOSUB to 4436H, @READ, to read the next record of the file at Register Pair DE into its buffer.
6741
If the Z FLAG is set (read), JUMP to 674EH (run 5E4EH).
6743
CP 1CH FE 1C
Compare Register A (the error) against 1CH, error 1CH, End of file encountered.
6745
If the Z FLAG is set (the end of the file), JUMP to 676BH (run 5E6BH).
6747
CP 1DH FE 1D
Compare Register A (the error) against 1DH, error 1DH, Record number out of range.
6749
If the Z FLAG is set, JUMP to 676BH (run 5E6BH): the end of the file too.
674B
JUMP to 52A0H with the error number in Register A.
674E
INC H 24
(Run 5E4EH.) INCrement Register H: Register Pair HL to the next page.
674F
LD A,H 7C
Copy Register H (the next page) into Register A.
6750
CP 00H FE 00
Compare Register A against the operand at 6751H: the page where the work area ends (6306H).
6752
If the NZ FLAG is set (pages left), LOOP BACK to 6738H (run 5E38H) for the next record.
6754
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the first page.
6757
LD (5240H),HL 22 40 52
(Run 5E57H.) Store Register Pair HL (the page) at 5240H-5241H, +03H-+04H of the destination's control block: @VER writes the record from there.
675A
GOSUB to 5FE8H (the row at 68E8H) to have the destination diskette in its drive; Register Pair DE = 523DH.
675D
GOSUB to 443CH, @VER, to write the next record of the file at Register Pair DE and read it back.
6760
If the NZ FLAG is set (an error), JUMP to 52A0H with the error number in Register A.
6763
INC H 24
INCrement Register H: Register Pair HL to the next page.
6764
LD A,H 7C
Copy Register H (the next page) into Register A.
6765
CP 00H FE 00
Compare Register A against the operand at 6766H: the page where the work area ends (6309H).
6767
If the NZ FLAG is set (pages left), LOOP BACK to 6757H (run 5E57H).
6769
JUMP to 6735H (run 5E35H) to fill the work area again.
676B
(Run 5E6BH.) GOSUB to 5F89H (the row at 6889H) to write the pages read so far, up to Register H.
676E
LD HL,(5225H) 2A 25 52
Load Register Pair HL with +08H-+09H of the source's control block at 5225H-5226H: the end of file byte and the record length.
6771
LD (5245H),HL 22 45 52
Store Register Pair HL at 5245H-5246H, +08H-+09H of the destination's control block.
6774
JUMP to 6776H (run 5E76H), the next instruction.
6776
(Run 5E76H.) GOSUB to 5FE8H (the row at 68E8H) to have the destination diskette in its drive; Register Pair DE = 523DH.
6779
GOSUB to 4428H, @CLOSE, to close the file at Register Pair DE (523DH).
677C
If the NZ FLAG is set (an error), JUMP to 52A0H with the error number in Register A.
677FH - The Directory Records Afterwards (Run 5E7FH)
The destination file's directory record gets +00H-+04H (with the bit of a changed file cleared) and +10H-+13H of the source's record: attributes, date, end of file byte, record length, password, time and year. With the date conversion count at 00H (an old dated source to a new dated destination) the year (+02H bits 2-0) goes to +13H and +12H is cleared. Then the bit is cleared in the source's record too, unless the source turned out write protected (the message is given once).
677F
LD D,(IY+09H) FD 56 09
(Run 5E7FH.) Load Register D with +09H of the drive code table at Index Register IY: the destination's directory cylinder.
6782
LD B,00H 06 00
Load Register B with the operand at 6783H: the destination file's directory record number (6715H).
6784
LD A,B 78
Copy Register B (the record number) into Register A.
6785
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the sector less 2.
6787
ADD A,02H C6 02
ADD 02H to Register A: the sector of directory records.
6789
LD E,A 5F
Copy Register A (the sector) into Register E.
678A
PUSH DE D5
Save Register Pair DE (the cylinder and sector) to the stack.
678B
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, a page for the sector.
678E
GOSUB to 546CH, function 09H, to read the destination's directory sector (Register D, Register E) into Register Pair HL.
6791
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
6793
LD A,11H 3E 11
Load Register A with 11H, error 11H, Directory read error. LD does not change the flags.
6795
If the NZ FLAG is set (not 06H), JUMP to 52A0H with error 11H in Register A.
6798
LD A,B 78
Copy Register B (the record number) into Register A.
6799
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): the record's place.
679B
LD E,A 5F
Copy Register A (the record's place) into Register E, the low byte of the record's address.
679C
LD A,(5286H) 3A 86 52
Load Register A with the high byte of the work area start at 5286H.
679F
LD D,A 57
Copy Register A into Register D: Register Pair DE = the destination's record.
67A0
POP HL E1
Restore Register Pair HL (the cylinder and sector) from the stack.
67A1
POP BC C1
Restore Register Pair BC (Register B = the source's record number) from the stack.
67A2
PUSH BC C5
Save Register Pair BC (the record number) to the stack again.
67A3
PUSH HL E5
Save Register Pair HL (the cylinder and sector) to the stack again.
67A4
PUSH DE D5
Save Register Pair DE (the destination's record) to the stack.
67A5
LD A,B 78
Copy Register B (the source's record number) into Register A.
67A6
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): its place in the sector.
67A8
LD L,A 6F
Copy Register A (the record's place) into Register L, the low byte of the record's address.
67A9
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = the source's record in 5800H.
67AB
INC L 2C
INCrement Register L to +01H of the source's record.
67AC
RES 6,(HL) CB B6
Clear bit 6 of +01H at Register Pair HL: the file is no longer marked as changed.
67AE
DEC L 2D
DECrement Register L back to +00H of the source's record.
67AF
LD BC,0005H 01 05 00
Load Register Pair BC with 0005H, the count of the bytes: 5.
67B2
LDIR ED B0
Copy Register Pair BC (5) bytes from Register Pair HL to Register Pair DE (LDIR): +00H-+04H, the attributes, the month and flags, the day and year, the end of file byte, the record length.
67B4
LD A,E 7B
Copy Register E (+05H of the destination's record) into Register A.
67B5
ADD A,0BH C6 0B
ADD 0BH to Register A (+05H of the destination's record): +10H.
67B7
LD E,A 5F
Copy Register A into Register E: Register Pair DE at +10H.
67B8
LD A,L 7D
Copy Register L (+05H of the source's record) into Register A.
67B9
ADD A,0BH C6 0B
ADD 0BH to Register A (+05H of the source's record): +10H.
67BB
LD L,A 6F
Copy Register A into Register L: Register Pair HL at +10H.
67BC
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, the count of the bytes: 4.
67BF
LDIR ED B0
Copy Register Pair BC (4) bytes from Register Pair HL to Register Pair DE (LDIR): +10H-+13H, the password hash and the time and year.
67C1
POP HL E1
Restore Register Pair HL (the destination's record) from the stack.
67C2
LD A,(5212H) 3A 12 52
Load Register A with the date conversion count at 5212H.
67C5
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H.
67C6
If the NZ FLAG is set (no conversion), JUMP to 67D2H (run 5ED2H).
67C8
DEC DE 1B
DECrement Register Pair DE from +14H to +13H of the destination's record.
67C9
INC HL 23
INCrement Register Pair HL from +00H to +01H of the destination's record.
67CA
INC HL 23
INCrement Register Pair HL to +02H, the day and the year.
67CB
LD A,(HL) 7E
Load Register A with +02H at Register Pair HL.
67CC
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the year less 1980.
67CE
LD (DE),A 12
Store Register A (the year) at Register Pair DE (+13H): bits 4-0 the year, the time bits 7-5 cleared.
67CF
DEC DE 1B
DECrement Register Pair DE from +13H to +12H of the destination's record.
67D0
XOR A AF
Load Register A with 00H (XOR A), for +12H, the time of the record.
67D1
LD (DE),A 12
Store Register A (00H) at Register Pair DE (+12H): no time.
67D2
LD HL,(5285H) 2A 85 52
(Run 5ED2H.) Load Register Pair HL with the work area start at 5285H-5286H, the destination's sector.
67D5
POP DE D1
Restore Register Pair DE (the cylinder and sector) from the stack.
67D6
GOSUB to 5468H, function 0EH, to write the sector at Register Pair HL to cylinder Register D sector Register E with the deleted data mark.
67D9
LD A,12H 3E 12
Load Register A with 12H, error 12H, Directory write error. LD does not change the flags.
67DB
If the NZ FLAG is set (the write failed), JUMP to 52A0H with error 12H in Register A.
67DE
LD A,00H 3E 00
Load Register A with the operand at 67DFH: 00H, FFH once the source was found write protected (680DH).
67E0
OR A B7
Set the flags from Register A (OR A): the NZ FLAG for FFH.
67E1
If the NZ FLAG is set (write protected), JUMP to 5AEBH (the row at 63EBH) for the next file.
67E4
POP BC C1
Restore Register Pair BC (Register B = the record number) from the stack.
67E5
PUSH BC C5
Save Register Pair BC (the record number) to the stack again.
67E6
LD A,B 78
Copy Register B (the record number) into Register A.
67E7
AND E0H E6 E0
Mask Register A to bits 7-5 (AND E0H): the record's place.
67E9
INC A 3C
INCrement Register A (the record's place): +01H of the record.
67EA
LD L,A 6F
Copy Register A (+01H of the record) into Register L.
67EB
LD H,58H 26 58
Load Register H with 58H: Register Pair HL = +01H of the source's record in 5800H.
67ED
RES 6,(HL) CB B6
Clear bit 6 of +01H at Register Pair HL (cleared at 67ACH already).
67EF
GOSUB to 5327H to have the source diskette in its drive.
67F2
LD D,(IY+09H) FD 56 09
Load Register D with +09H of the drive code table at Index Register IY: the source's directory cylinder.
67F5
LD A,B 78
Copy Register B (the record number) into Register A.
67F6
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the sector less 2.
67F8
ADD A,02H C6 02
ADD 02H to Register A: the sector of directory records.
67FA
LD E,A 5F
Copy Register A (the sector) into Register E.
67FB
LD HL,5800H 21 00 58
Point Register Pair HL to 5800H, the source's directory sector.
67FE
GOSUB to 5468H, function 0EH, to write it to cylinder Register D sector Register E with the deleted data mark.
6801
If the Z FLAG is set (written), JUMP to 5AEBH (the row at 63EBH) for the next file.
6804
CP 0FH FE 0F
Compare Register A (the error) against 0FH, error 0FH, Write protected disk.
6806
LD A,12H 3E 12
Load Register A with 12H, error 12H, Directory write error. LD does not change the flags.
6808
If the NZ FLAG is set (another error), JUMP to 52A0H with error 12H in Register A.
680B
LD A,FFH 3E FF
Load Register A with FFH: the source is write protected.
680D
LD (5EDFH),A 32 DF 5E
Store Register A (FFH) at 5EDFH, the operand of LD A,00H at 67DEH (run 5EDEH): no more tries.
6810
LD HL,55A1H 21 A1 55
Point Register Pair HL to 55A1H, the text Source disk is write protected, can't clear mod flags.
6813
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL (55A1H) and write it to the job log.
6816
JUMP to 5AEBH (the row at 63EBH) for the next file.
6819H - Make the Two File Specifications (Run 5F19H)
Register Pair DE is at the end of NAME/EXT in 521DH. .RS0LT0FF: and the source drive's digit and 03H go after it; the whole block is copied to 523DH and the digit after the colon there becomes the destination drive's.
6819
LD HL,5AE0H 21 E0 5A
(Run 5F19H.) Point Register Pair HL to 5AE0H, the text at 63E0H on this page: .RS0LT0FF: (the master password and the colon).
681C
LD BC,000AH 01 0A 00
Load Register Pair BC with 000AH, the count of the bytes: 10.
681F
LDIR ED B0
Copy Register Pair BC (10) bytes from Register Pair HL to Register Pair DE (LDIR), after the name; Register Pair DE ends after the colon.
6821
LD A,(531BH) 3A 1B 53
Load Register A with the source drive at 531BH.
6824
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the drive number.
6826
ADD A,30H C6 30
ADD 30H to Register A (the drive number): the source drive's digit.
6828
LD (DE),A 12
Store Register A (the digit) at Register Pair DE, after the colon.
6829
INC DE 13
INCrement Register Pair DE to the next place.
682A
LD A,03H 3E 03
Load Register A with 03H, the end of the specification.
682C
LD (DE),A 12
Store Register A (03H) at Register Pair DE: the end of the source's specification.
682D
LD HL,521DH 21 1D 52
Point Register Pair HL to 521DH, the source's specification.
6830
LD DE,523DH 11 3D 52
Point Register Pair DE to 523DH, the destination's file control block.
6833
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the count of the bytes: 32.
6836
LDIR ED B0
Copy Register Pair BC (32) bytes from Register Pair HL (521DH) to Register Pair DE (523DH) (LDIR).
6838
LD HL,523DH 21 3D 52
Point Register Pair HL to 523DH, the copy for the destination, to find its colon.
683B
LD A,(HL) 7E
(Run 5F3BH.) Load Register A with the character at Register Pair HL.
683C
INC HL 23
INCrement Register Pair HL past the character just taken into Register A.
683D
CP 3AH FE 3A
Compare Register A against 3AH, the colon before the drive.
683F
If the NZ FLAG is set (not the colon), LOOP BACK to 683BH (run 5F3BH).
6841
LD A,(5388H) 3A 88 53
Load Register A with the destination drive at 5388H.
6844
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the drive number.
6846
ADD A,30H C6 30
ADD 30H to Register A (the drive number): the destination drive's digit.
6848
LD (HL),A 77
Store Register A (the digit) at Register Pair HL, after the colon of the destination's specification.
6849
RET C9
RETurn with the two specifications made: 521DH for the source, 523DH for the destination.
684AH - Pack a Record's Date (Run 5F4AH)
Register Pair HL at +01H of a directory record. Register Pair DE gets the date packed as 5CCCH packs the DATE parameter: Register D bits 7-3 the year less 1980, bits 2-0 bits 3-1 of the month; Register E bit 7 bit 0 of the month, bits 6-2 the day. The year comes from +13H bits 4-0 when bit 0 of 475DH is set (the date flag of drive 0, whatever drive the record is from), else from +02H bits 2-0.
684A
LD A,(HL) 7E
(Run 5F4AH.) Load Register A with +01H of the record at Register Pair HL.
684B
AND 0FH E6 0F
Mask Register A to bits 3-0 (AND 0FH): the month.
684D
LD E,00H 1E 00
Load Register E with 00H, the low byte to be built.
684F
SRL A CB 3F
Shift Register A (the month) right one bit (SRL): bit 0 into the CARRY FLAG.
6851
RR E CB 1B
Rotate Register E right through the CARRY FLAG (RR): bit 0 of the month into bit 7.
6853
LD D,A 57
Copy Register A (bits 3-1 of the month) into Register D.
6854
INC HL 23
INCrement Register Pair HL to +02H of the record.
6855
LD A,(HL) 7E
Load Register A with +02H at Register Pair HL: bits 7-3 the day, bits 2-0 the year.
6856
AND F8H E6 F8
Mask Register A to bits 7-3 (AND F8H): the day.
6858
RRCA 0F
Rotate Register A right one bit (RRCA): the day in bits 6-2.
6859
OR E B3
OR Register E (bit 0 of the month in bit 7) into Register A.
685A
LD E,A 5F
Copy Register A into Register E: the low byte of the packed date.
685B
LD A,(475DH) 3A 5D 47
Load Register A with the date stamping flags at 475DH (bit n for drive n).
685E
BIT 0,A CB 47
Test bit 0 of Register A: the bit of drive 0.
6860
If the NZ FLAG is set (bit 0 set), JUMP to 686BH (run 5F6BH) for the year at +13H.
6862
LD A,(HL) 7E
Load Register A with +02H at Register Pair HL.
6863
AND 07H E6 07
Mask Register A to bits 2-0 (AND 07H): the year less 1980, 0-7.
6865
RLCA 07
(Run 5F65H.) Rotate Register A left one bit (RLCA), the first of three.
6866
RLCA 07
Rotate Register A left one bit (RLCA), the second of the three shifts.
6867
RLCA 07
Rotate Register A left one bit (RLCA): the year in bits 7-3.
6868
OR D B2
OR Register D (bits 3-1 of the month) into Register A.
6869
LD D,A 57
Copy Register A into Register D: the high byte of the packed date.
686A
RET C9
RETurn with the packed date in Register Pair DE.
686B
LD A,L 7D
(Run 5F6BH.) Copy Register L (+02H of the record) into Register A.
686C
ADD A,11H C6 11
ADD 11H to Register A (+02H of the record): +13H, the year of the new date format.
686E
LD L,A 6F
Copy Register A into Register L: Register Pair HL at +13H of the record.
686F
LD A,(HL) 7E
Load Register A with +13H at Register Pair HL: bits 4-0 the year less 1980.
6870
AND 1FH E6 1F
Mask Register A to bits 4-0 (AND 1FH): the year less 1980, 0-31.
6872
JUMP to 6865H (run 5F65H) to put it in place.
6874H - Write the Allocation Table (Run 5F74H)
Writes the allocation table at Register Pair HL's page (Register L set to 00H) to cylinder Register D sector Register E with the deleted data mark and verifies it: error 15H or 14H.
6874
LD L,00H 2E 00
(Run 5F74H.) Load Register L with 00H: Register Pair HL = 6200H, the start of the allocation table.
6876
GOSUB to 5468H, function 0EH, to write it to cylinder Register D sector Register E with the deleted data mark.
6879
LD A,15H 3E 15
Load Register A with 15H, error 15H, GAT write error. LD does not change the flags.
687B
If the NZ FLAG is set (the write failed), JUMP to 52A0H with error 15H in Register A.
687E
GOSUB to 5470H, function 0AH, to verify cylinder Register D sector Register E.
6881
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark the sector must have.
6883
LD A,14H 3E 14
Load Register A with 14H, error 14H, GAT read error. LD does not change the flags.
6885
If the NZ FLAG is set (not 06H), JUMP to 52A0H with error 14H in Register A.
6888
RET C9
RETurn to 6381H with the allocation table written and verified.
6889H - Write the Pages Read (Run 5F89H)
At the end of a file: the records read into the work area, from its first page up to the page below Register H, are written to the destination with @VER.
6889
LD A,(5286H) 3A 86 52
(Run 5F89H.) Load Register A with the high byte of the work area start at 5286H, its first page.
688C
CP H BC
Compare Register A against Register H (the page after the last record read): the Z FLAG when nothing was read.
688D
RET Z C8
If the Z FLAG is set (no record was read into the work area), RETurn.
688E
LD A,00H 3E 00
Load Register A with the operand at 688FH: the page where the work area ends (630CH).
6890
CP H BC
Compare Register A against Register H: the Z FLAG when the work area was full.
6891
RET Z C8
If the Z FLAG is set, RETurn. 674EH writes a full work area before it reads on, so Register H is never that page here.
6892
LD B,H 44
Copy Register H (the page after the last record) into Register B, the end.
6893
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the first page.
6896
LD (5240H),HL 22 40 52
(Run 5F96H.) Store Register Pair HL (the page) at 5240H-5241H, +03H-+04H of the destination's control block.
6899
GOSUB to 5FE8H (the row at 68E8H) to have the destination diskette in its drive; Register Pair DE = 523DH.
689C
GOSUB to 443CH, @VER, to write the next record of the file at Register Pair DE and read it back.
689F
If the NZ FLAG is set (an error), JUMP to 52A0H with the error number in Register A.
68A2
INC H 24
INCrement Register H: Register Pair HL to the next page.
68A3
LD A,H 7C
Copy Register H (the next page) into Register A.
68A4
CP B B8
Compare Register A against Register B: the Z FLAG at the end of the pages read.
68A5
If the NZ FLAG is set (pages left), LOOP BACK to 6896H (run 5F96H).
68A7
RET C9
RETurn to 676EH with the pages written to the destination file.
68A8H - Take the Space of the Whole File (Run 5FA8H)
Register Pair BC = the records of the file. Its last record (Register Pair BC less 1) is written with E5H bytes, so the file gets all its space at once: the Z FLAG when it fits. When the destination is full (error 1BH) the file is killed; during a JCL job the backup ends, else a new destination diskette is asked for (the prompt flashes until ENTER) and the NZ FLAG is returned.
68A8
LD A,B 78
(Run 5FA8H.) Copy Register B (the high byte of the record count) into Register A.
68A9
OR C B1
OR Register C into Register A: the Z FLAG for an empty file.
68AA
RET Z C8
If the Z FLAG is set (no records), RETurn with the Z FLAG.
68AB
DEC BC 0B
DECrement Register Pair BC: the number of the last record.
68AC
GOSUB to 5FE8H (the row at 68E8H) to have the destination diskette in its drive; Register Pair DE = 523DH.
68AF
PUSH DE D5
Save Register Pair DE (523DH, the destination's control block) to the stack.
68B0
GOSUB to 4442H, @POSN, to put the file at Register Pair DE at record Register Pair BC, its last.
68B3
LD HL,(5285H) 2A 85 52
Load Register Pair HL with the work area start at 5285H-5286H, the file's buffer.
68B6
LD D,H 54
Copy Register H (the page of the buffer) into Register D.
68B7
LD E,L 5D
Copy Register L into Register E: Register Pair DE = the buffer.
68B8
INC DE 13
INCrement Register Pair DE to the byte above it.
68B9
LD BC,00FFH 01 FF 00
Load Register Pair BC with 00FFH, the count of the bytes: 255.
68BC
LD (HL),E5H 36 E5
Store E5H at Register Pair HL, the first byte of the buffer.
68BE
LDIR ED B0
Copy Register Pair BC (255) bytes from Register Pair HL to Register Pair DE (LDIR): the buffer is 256 bytes of E5H.
68C0
POP DE D1
Restore Register Pair DE (523DH) from the stack.
68C1
GOSUB to 443CH, @VER, to write the record at the file Register Pair DE (its last) and read it back.
68C4
RET Z C8
If the Z FLAG is set (written), RETurn with the Z FLAG: the space is there.
68C5
CP 1BH FE 1B
Compare Register A (the error) against 1BH, error 1BH, Disk space full.
68C7
If the NZ FLAG is set (another error), JUMP to 68DCH (run 5FDCH) and on to 52A0H.
68C9
GOSUB to 442CH, @KILL, to delete the file at Register Pair DE from the destination.
68CC
LD A,(442BH) 3A 2B 44
Load Register A with SFLAG$ from 442BH, the system flags.
68CF
BIT 5,A CB 6F
Test bit 5 of Register A: set while a JCL job runs.
68D1
If the NZ FLAG is set (a JCL job), JUMP to 6901H (run 6001H): Disk is full! - Can't switch while <DO> in effect.
68D3
LD HL,601FH 21 1F 60
Point Register Pair HL to 601FH, the prompt at 691FH on this page: Disk is full! - Enter new formatted destination disk <ENTER>.
68D6
GOSUB to 53E0H to show the prompt at Register Pair HL until ENTER (BREAK gives up the backup).
68D9
OR 01H F6 01
Set bit 0 in Register A (OR 01H): the NZ FLAG, a new diskette.
68DB
RET C9
RETurn with the NZ FLAG to 671FH: the same file again on the new diskette.
68DC
(Run 5FDCH.) JUMP to 52A0H with the error number in Register A.
68DFH - The Source and the Destination File (Run 5FDFH, 5FE8H)
5FDFH has the source diskette in its drive and Register Pair DE at the source's control block (521DH); 5FE8H the destination's (523DH). Register Pair BC is kept.
68DF
PUSH BC C5
(Run 5FDFH.) Save Register Pair BC (the caller's value) to the stack.
68E0
LD DE,521DH 11 1D 52
Point Register Pair DE to 521DH, the source file's control block.
68E3
GOSUB to 5327H to have the source diskette in its drive.
68E6
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
68E7
RET C9
RETurn with Register Pair DE = 521DH and the source diskette in its drive.
68E8
PUSH BC C5
(Run 5FE8H.) Save Register Pair BC (the caller's value) to the stack.
68E9
LD DE,523DH 11 3D 52
Point Register Pair DE to 523DH, the destination file's control block.
68EC
GOSUB to 5394H to have the destination diskette in its drive.
68EF
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
68F0
RET C9
RETurn with Register Pair DE = 523DH and the destination diskette in its drive.
68F1H - Read the Hash Index Table (Run 5FF1H)
Reads sector 1 of the directory cylinder of the drive at Index Register IY into 6200H: Register A = 16H and the Z FLAG when it has the deleted data mark.
68F1
LD D,(IY+09H) FD 56 09
(Run 5FF1H.) Load Register D with +09H of the drive code table at Index Register IY: the directory cylinder.
68F4
LD E,01H 1E 01
Load Register E with 01H: sector 1, the hash index table.
68F6
LD HL,6200H 21 00 62
Point Register Pair HL to 6200H, the buffer below the work area.
68F9
GOSUB to 546CH, function 09H, to read cylinder Register D sector Register E into Register Pair HL (6200H).
68FC
CP 06H FE 06
Compare Register A (the result) against 06H: the deleted data mark of a directory sector.
68FE
LD A,16H 3E 16
Load Register A with 16H, error 16H, HIT read error. LD does not change the flags.
6900
RET C9
RETurn with the Z FLAG for success, Register A = 16H for the caller's error.
6901
LD HL,60D1H 21 D1 60
(Run 6001H.) Point Register Pair HL to 60D1H, the text at 69D1H on this page: Disk is full! - Can't switch while <DO> in effect.
6904
JUMP to 52AFH to end with the text at Register Pair HL.
6907H - The Texts and Tables of the File by File Engine
They move to 6007H-6147H with the engine, so its code uses addresses 0900H lower than the rows here.
6907
DEFB 1DH 1D
6907H (run 6007H): 1DH, the cursor to the start of the line: each Copying file: line is written over the last.
6908-6915
DEFM "Copying file: " 43 6F 70 79 69 6E 67 20 66 69 6C 65 3A 20
6908H-6915H: the text of 65F4H before the name of a file being copied without QUERY.
6916
DEFB 03H 03
6916H: 03H, the end of the text; the name follows on the line.
6917-691D
DEFM "Backup " 42 61 63 6B 75 70 20
6917H-691DH (run 6017H-601DH): the start of the question of 6545H with QUERY.
691E
DEFB 03H 03
691EH: 03H, the end of the text; the name and date follow.
691F-695B
DEFM "Disk is full! - Enter new formatted destination disk <ENTER>" 44 69 73 6B 20 69 73 20 66 75 6C 6C 21 20 2D 20 45 6E 74 65 72 20 6E 65 77 20 66 6F 72 6D 61 74 74 65 64 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 64 69 73 6B 20 20 3C 45 4E 54 45 52 3E
691FH-695BH (run 601FH): the prompt of 68D3H when the destination diskette is full.
695C-695D
DEFB 1DH, 03H 1D 03
695CH-695DH: 1DH, the cursor to the start of the line, and 03H, the end of the prompt, so 53E0H can clear the line.
695E-699C
DEFM " File is larger than destination capacity - backup is bypassed" 20 20 46 69 6C 65 20 69 73 20 6C 61 72 67 65 72 20 74 68 61 6E 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 63 61 70 61 63 69 74 79 20 2D 20 62 61 63 6B 75 70 20 69 73 20 62 79 70 61 73 73 65 64
695EH-699CH (run 605EH): the text of 66FBH for a file of more records than the destination has room for.
699D
DEFB 0DH 0D
699DH: 0DH, the end of the text and of its line.
699E-69CF
DEFM "Can't create SYSTEM disk - directory slots in use!" 43 61 6E 27 74 20 63 72 65 61 74 65 20 53 59 53 54 45 4D 20 64 69 73 6B 20 2D 20 64 69 72 65 63 74 6F 72 79 20 73 6C 6F 74 73 20 69 6E 20 75 73 65 21
699EH-69CFH (run 609EH): the text of 639FH, when a place of a system file's record holds another file on the destination.
69D0
DEFB 0DH 0D
69D0H: 0DH, the end of the text and of its line.
69D1-6A01
DEFM "Disk is full! - Can't switch while <DO> in effect" 44 69 73 6B 20 69 73 20 66 75 6C 6C 21 20 2D 20 43 61 6E 27 74 20 73 77 69 74 63 68 20 77 68 69 6C 65 20 3C 44 4F 3E 20 69 6E 20 65 66 66 65 63 74
69D1H-6A01H (run 60D1H): the text of 6901H, a full destination during a JCL job.
6A02
DEFB 0DH 0D
6A02H: 0DH, the end of the text and of its line.
6A03-6A06
DEFM "} ? " 7D 20 3F 20
6A03H-6A06H (run 6103H): the end of the question of QUERY after the date (65D1H).
6A07
DEFB 03H 03
6A07H: 03H, the end of the text: the reply is typed after it.
6A08-6A13
DEFB 1FH, 1CH, 1FH, 1EH, 1FH, 1EH, 1FH, 1FH, 1EH, 1FH, 1EH, 1FH 1F 1C 1F 1E 1F 1E 1F 1F 1E 1F 1E 1F
6A08H-6A13H (run 6108H-6113H): the days of the twelve months, as at 7006H. No code of the engine reads them.
6A14-6A37
DEFM "JanFebMarAprMayJunJulAugSepOctNovDec" 4A 61 6E 46 65 62 4D 61 72 41 70 72 4D 61 79 4A 75 6E 4A 75 6C 41 75 67 53 65 70 4F 63 74 4E 6F 76 44 65 63
6A14H-6A37H (run 6114H-6137H): the names of the months, 3 letters each, for the date of the question (658EH).
6A38-6A39
DEFB A2H, C4H A2 C4
6A38H-6A39H (run 6138H): the hash index bytes of records 00H and 01H: A2H, BOOT/SYS, and C4H, DIR/SYS (the hash of SYS2/SYS of each name).
6A3A-6A3F
DEFB 2EH, 2FH, 2CH, 2DH, 2AH, 2BH 2E 2F 2C 2D 2A 2B
6A3AH-6A3FH: records 02H-07H: SYS0/SYS 2EH, SYS1/SYS 2FH, SYS2/SYS 2CH, SYS3/SYS 2DH, SYS4/SYS 2AH, SYS5/SYS 2BH.
6A40-6A46
DEFB 28H, 29H, 26H, 27H, 27H, A7H, 26H 28 29 26 27 27 A7 26
6A40H-6A46H: records 20H-26H: SYS6/SYS 28H, SYS7/SYS 29H, SYS8/SYS 26H, SYS9/SYS 27H, SYS10/SYS 27H, SYS11/SYS A7H, SYS12/SYS 26H.
6A47
DEFB A6H A6
6A47H (run 6147H): A6H, a 16th byte after the table; the loop at 6394H takes only 15, so no code reads it.
6A48-6BFF
DEFS 440
6A48H-6BFFH: not in the file. The engine selector's LDIR copies 0900H bytes from 6300H, so these bytes, whatever they hold, land at 6148H-62FFH; the file by file engine's work area starts at 6300H and covers this memory.
6C00H - The Engine Selector
Entered from 5C60H and 5C66H, and at 6C13H from 5C6FH. With no selection (6C01H 00H) the mirror image engine (5E00H, 0500H bytes) is moved to 5A00H, over the front end. Otherwise the file by file engine (6300H, 0900H bytes) is moved there, but not for source and destination on one drive; with X the system files 2, 3, 8 and 10 must be kept in memory by SYSRES. The work area starts at the page boundary above the moved bytes (5F00H or 6300H); then the engine runs at 5A00H.
6C00
LD A,00H 3E 00
Load Register A with the operand at 6C01H: the OR of the selections stored by 5B2DH, 00H in the file.
6C02
OR A B7
Set the flags from Register A (OR A): the NZ FLAG for a backup by class.
6C03
If the NZ FLAG is set (by class), JUMP to 6C13H for the file by file engine.
6C06
LD HL,5E00H 21 00 5E
Point Register Pair HL to 5E00H, where the mirror image engine is loaded.
6C09
LD DE,5A00H 11 00 5A
Point Register Pair DE to 5A00H, where it runs.
6C0C
LD BC,0500H 01 00 05
Load Register Pair BC with 0500H, the count of the bytes: 1280 (5E00H-62FFH, the engine is 5E00H-6208H).
6C0F
LDIR ED B0
Copy Register Pair BC (0500H) bytes from Register Pair HL (5E00H) to Register Pair DE (5A00H) (LDIR): the mirror image engine now lies at 5A00H-5EFFH. Register Pair DE ends at 5F00H.
6C11
JUMP to 6C5DH to set the work area and start the engine.
6C13
LD A,(53DCH) 3A DC 53
Load Register A with the byte at 53DCH, the source drive XOR the destination drive.
6C16
OR A B7
Set the flags from Register A (OR A): the Z FLAG for one drive.
6C17
If the NZ FLAG is set (two drives), JUMP to 6C22H.
6C19
LD HL,6F26H 21 26 6F
Point Register Pair HL to 6F26H, the text Single drive BACKUP invalid by files.
6C1C
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL.
6C1F
JUMP to 52ACH to end with Backup aborted after the text.
6C22
LD A,(52CAH) 3A CA 52
Load Register A with the low byte of the X cell at 52CAH: FFH when X was given.
6C25
OR A B7
Set the flags from Register A (OR A): the Z FLAG without X.
6C26
If the Z FLAG is set (no X), JUMP to 6C52H to move the file by file engine.
6C28
LD DE,(4BDEH) ED 5B DE 4B
Load Register Pair DE with the word at 4BDEH-4BDFH, the operand of the CALL in SYS0/SYS's supervisor dispatcher: 4BF4H, the overlay loader, or the hook of the $SR module that SYSRES (SYS7/SYS) puts below HIGH$.
6C2C
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
6C2D
LD HL,4BF4H 21 F4 4B
Load Register Pair HL with 4BF4H, the overlay loader of SYS0/SYS.
6C30
SBC HL,DE ED 52
SUBtract Register Pair DE from Register Pair HL (4BF4H): the Z FLAG when the dispatcher calls the loader, no $SR module.
6C32
LD HL,6F4BH 21 4B 6F
Point Register Pair HL to 6F4BH, the text This backup requires residency of SYS's: 2, 3, 8, & 10. LD does not change the flags.
6C35
If the Z FLAG is set (no system file is kept in memory), JUMP to 6C1CH to display the text at Register Pair HL and end.
6C37
PUSH DE D5
Save Register Pair DE (the $SR module's hook, its +28H) to the stack.
6C38
POP IX DD E1
Restore Index Register IX from the stack: Index Register IX = the hook.
6C3A
LD A,(IX-1BH) DD 7E E5
Load Register A with the byte at Index Register IX-1BH, +0DH of the $SR module: the high byte of the entry of SYS2/SYS in its table (+08H + 2 x n), 00H when the file is not kept.
6C3D
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H.
6C3E
If the Z FLAG is set (SYS2/SYS not kept), JUMP to 6C1CH to display the text at Register Pair HL and end.
6C40
LD A,(IX-19H) DD 7E E7
Load Register A with the byte at Index Register IX-19H, +0FH of the module: the high byte of the entry of SYS3/SYS.
6C43
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H.
6C44
If the Z FLAG is set (SYS3/SYS not kept), JUMP to 6C1CH.
6C46
LD A,(IX-0FH) DD 7E F1
Load Register A with the byte at Index Register IX-0FH, +19H of the module: the high byte of the entry of SYS8/SYS.
6C49
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H.
6C4A
If the Z FLAG is set (SYS8/SYS not kept), JUMP to 6C1CH.
6C4C
LD A,(IX-0BH) DD 7E F5
Load Register A with the byte at Index Register IX-0BH, +1DH of the module: the high byte of the entry of SYS10/SYS.
6C4F
OR A B7
Set the flags from Register A (OR A): the Z FLAG for 00H.
6C50
If the Z FLAG is set (SYS10/SYS not kept), JUMP to 6C1CH.
6C52
LD HL,6300H 21 00 63
Point Register Pair HL to 6300H, where the file by file engine is loaded.
6C55
LD DE,5A00H 11 00 5A
Point Register Pair DE to 5A00H, where it runs.
6C58
LD BC,0900H 01 00 09
Load Register Pair BC with 0900H, the count of the bytes: 2304 (6300H-6BFFH, the engine is 6300H-6A47H).
6C5B
LDIR ED B0
Copy Register Pair BC (0900H) bytes from Register Pair HL (6300H) to Register Pair DE (5A00H) (LDIR): the file by file engine now lies at 5A00H-62FFH. Register Pair DE ends at 6300H.
6C5D
DEC DE 1B
DECrement Register Pair DE: the last byte moved (5EFFH or 62FFH).
6C5E
INC D 14
INCrement Register D (the page of the last byte moved): the page above it.
6C5F
LD E,00H 1E 00
Load Register E with 00H: Register Pair DE = 5F00H or 6300H, a page boundary.
6C61
LD (5285H),DE ED 53 85 52
Store Register Pair DE (the work area start) at 5285H-5286H.
6C65
JUMP to 5A00H, the start of the engine just moved (the row at 5E00H or 6300H on this page).
6C68H - The Requests to SYS2/SYS
6C68H takes 8 characters (6C71H) and falls into request E4H: SYS2/SYS hashes the 8 bytes at Register Pair DE into Register Pair HL. 6C6EH is request 84H, which only loads SYS2/SYS. The supervisor dispatcher drops the return address of the RST 28H, so each request returns to the caller of 6C68H, 6C6BH or 6C6EH.
6C68
GOSUB to 6C71H to put 8 characters at 5900H (from Register Pair DE, or typed after the question at Register Pair HL); Register Pair DE comes back at 5900H.
6C6B
LD A,E4H 3E E4
Load Register A with E4H, the request of SYS2/SYS's function 60H: the hash of the 8 characters at Register Pair DE, returned in Register Pair HL.
6C6D
RST 28H EF
RST 28H, the supervisor call with the request in Register A (E4H). It returns to the caller of 6C68H (5C99H), not here.
6C6E
LD A,84H 3E 84
Load Register A with 84H, the request of SYS2/SYS's function 00H: SYS2/SYS is loaded and returns at once.
6C70
RST 28H EF
RST 28H, the supervisor call with the request in Register A (84H). It returns to the caller of 6C6EH (5B46H).
6C71H - Take Eight Characters
Register Pair DE not 0000H: up to 8 characters of the text at Register Pair DE (a parameter's text, ended by 0DH, a comma or a quote). Register Pair DE 0000H: the question at Register Pair HL is displayed and up to 8 characters are typed (BREAK gives up the backup). The 8 places at 5900H are filled with spaces after the text and lower case letters made upper case; Register Pair DE returns at 5900H.
6C71
LD A,D 7A
Copy Register D (the high byte of the text's address) into Register A.
6C72
OR E B3
OR Register E into Register A: the Z FLAG when Register Pair DE is 0000H (no text given).
6C73
If the Z FLAG is set (no text), JUMP to 6C8FH to ask.
6C75
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer, for the 8 characters.
6C78
PUSH HL E5
Save Register Pair HL (5900H, the first place) to the stack.
6C79
LD B,08H 06 08
Load Register B with 08H: at most 8 characters.
6C7B
LD A,(DE) 1A
Load Register A with the character of the text at Register Pair DE.
6C7C
CP 0DH FE 0D
Compare Register A against 0DH, the end of the command line.
6C7E
If the Z FLAG is set (0DH), JUMP to 6CA9H to fill the rest with spaces.
6C80
CP 2CH FE 2C
Compare Register A against 2CH, a comma: the next parameter follows.
6C82
If the Z FLAG is set (a comma), JUMP to 6CA9H to fill the rest with spaces.
6C84
CP 22H FE 22
Compare Register A against 22H, a quote: the end of a quoted text.
6C86
If the Z FLAG is set (a quote), JUMP to 6CA9H to fill the rest with spaces.
6C88
INC DE 13
INCrement Register Pair DE to the next character of the text.
6C89
LD (HL),A 77
Store Register A (the character) at Register Pair HL.
6C8A
INC HL 23
INCrement Register Pair HL to the next of the 8 places.
6C8B
DECrement Register B and LOOP BACK to 6C7BH for at most 8 characters.
6C8D
JUMP to 6CAEH: the 8 places are full, no space is added.
6C8F
GOSUB to 4467H, @DSPLY, to display the question at Register Pair HL (6FD6H, Master password ?).
6C92
LD B,08H 06 08
Load Register B with 08H: at most 8 characters.
6C94
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the sector buffer, for the reply.
6C97
PUSH HL E5
Save Register Pair HL (5900H, the first place) to the stack.
6C98
GOSUB to 0040H, the ROM's line input: up to Register B (8) characters at Register Pair HL (5900H); Register B comes back with the number typed, Register Pair HL at 5900H, the CARRY FLAG for BREAK.
6C9B
If the CARRY FLAG is set (BREAK), JUMP to 52ACH: Backup aborted.
6C9E
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = 5900H.
6C9F
LD H,00H 26 00
Load Register H with 00H, the high byte of the count of characters typed.
6CA1
LD L,B 68
Copy Register B (the number typed) into Register L: Register Pair HL = that number.
6CA2
ADD HL,DE 19
ADD Register Pair DE (5900H) to Register Pair HL: the place after the last character typed (its 0DH).
6CA3
LD A,08H 3E 08
Load Register A with 08H, the number of places.
6CA5
SUB B 90
SUBtract Register B (the number typed) from Register A: the places left.
6CA6
If the Z FLAG is set (8 were typed), JUMP to 6CAEH.
6CA8
LD B,A 47
Copy Register A (the places left) into Register B, the count of spaces.
6CA9
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL, a place after the text.
6CAB
INC HL 23
INCrement Register Pair HL to the next place.
6CAC
DECrement Register B and LOOP BACK to 6CA9H until the 8 places are filled.
6CAE
POP HL E1
Restore Register Pair HL (5900H) from the stack.
6CAF
PUSH HL E5
Save Register Pair HL (5900H) to the stack again.
6CB0
LD B,08H 06 08
Load Register B with 08H, the count of the places to make upper case.
6CB2
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
6CB3
CP 61H FE 61
Compare Register A against 61H, the letter a: the CARRY FLAG below it.
6CB5
If the CARRY FLAG is set (below 61H), JUMP to 6CBAH.
6CB7
RES 5,A CB AF
Clear bit 5 of Register A: a lower case letter becomes upper case.
6CB9
LD (HL),A 77
Store Register A (the character) at Register Pair HL.
6CBA
INC HL 23
INCrement Register Pair HL to the next place.
6CBB
DECrement Register B and LOOP BACK to 6CB2H for the 8 places.
6CBD
POP DE D1
Restore Register Pair DE (5900H) from the stack: the 8 characters for the hash.
6CBE
RET C9
RETurn with Register Pair DE = 5900H (for 6C68H, into the request E4H at 6C6BH).
6CBFH - Test a Drive and Set Its Table from the Diskette
Called with Index Register IY at the drive's table and the drive state at 53D5H. A drive whose table starts with C9H returns at once (NZ, Register A = 06H). The head is put on a known cylinder (a Restore when +05H is above the highest cylinder), the drive selected; unless +04H bit 4 is set the diskette must turn: the index hole off, on, off within 15 ticks of TIMER$, half a second at the 30 ticks a second of the Model III (6D4FH). The allocation table is read into 4300H, and from its +CCH-+CDH: the bit of the drive in 475DH (the date format, configuration bit 3), +06H (35 + the cylinders less 35, less 1), +04H bit 7 (cylinder 0 in single density, bit 4) and +04H bit 5 (two sides, bit 5). Returns the Z FLAG, with the CARRY FLAG for a write protected diskette (the status or +03H bit 7); a failure gives the NZ FLAG with Register A = 08H.
6CBF
LD A,(53D5H) 3A D5 53
Load Register A with the drive state at 53D5H (bits 2-0 the drive).
6CC2
LD C,A 4F
Copy Register A (the drive state) into Register C, the drive for DIRCYL and the dating bit.
6CC3
LD A,(IY+00H) FD 7E 00
Load Register A with +00H of the drive code table at Index Register IY: C3H for a drive that is present, C9H for one that is not.
6CC6
SUB C3H D6 C3
SUBtract C3H from Register A: 00H, and the Z FLAG, for a drive that is present; 06H for C9H.
6CC8
RET NZ C0
If the NZ FLAG is set (not present), RETurn with Register A = 06H.
6CC9
PUSH HL E5
Save Register Pair HL (the caller's value) to the stack.
6CCA
PUSH DE D5
Save Register Pair DE (the caller's value) to the stack.
6CCB
LD A,(IY+06H) FD 7E 06
Load Register A with +06H of the drive code table at Index Register IY: the highest cylinder.
6CCE
CP (IY+05H) FD BE 05
Compare Register A against +05H of the drive code table at Index Register IY, the cylinder the head is on: the CARRY FLAG when +05H is above the highest cylinder.
6CD1
If the NO CARRY FLAG is set (the head is on a cylinder of the drive), JUMP to 6CDAH.
6CD4
GOSUB to 545CH, function 04H: Restore, the head to cylinder 0 (+05H = 0).
6CD7
If the NZ FLAG is set (the Restore failed), JUMP to 6D5CH: Register A = 08H.
6CDA
LD D,(IY+05H) FD 56 05
Load Register D with +05H of the drive code table at Index Register IY: the cylinder the head is on.
6CDD
LD E,00H 1E 00
Load Register E with 00H: sector 0, for the side.
6CDF
GOSUB to 475EH, SEEK: select the drive and seek cylinder Register D for sector Register E.
6CE2
EI FB
Enable interrupts: TIMER$ (4288H) must count for the test below.
6CE3
GOSUB to 4759H, TSTBSY: wait until the controller of drive Register C is not busy; Register A = the controller's status.
6CE6
BIT 4,(IY+04H) FD CB 04 66
Test bit 4 of +04H of the drive code table at Index Register IY: set for a drive with its own kind of driver.
6CEA
If the NZ FLAG is set (bit 4), JUMP to 6D01H without the index test.
6CEC
LD A,(4288H) 3A 88 42
Load Register A with TIMER$ from 4288H, the tick counter (30 ticks a second on the Model III).
6CEF
ADD A,0FH C6 0F
ADD 0FH (15 ticks of the 30 a second, half a second) to Register A: the deadline.
6CF1
LD D,A 57
Copy Register A (the deadline) into Register D for 6D4FH.
6CF2
GOSUB to 6D4FH: the NZ FLAG while the index hole is at the head (status bit 1).
6CF5
If the NZ FLAG is set (the hole), LOOP BACK to 6CF2H until it has passed.
6CF7
GOSUB to 6D4FH to look at the index again, until the next hole comes.
6CFA
If the Z FLAG is set (no hole), LOOP BACK to 6CF7H until the next hole comes.
6CFC
GOSUB to 6D4FH to look at the index again, until the hole has passed.
6CFF
If the NZ FLAG is set (the hole), LOOP BACK to 6CFCH until it has passed: the diskette turns.
6D01
PUSH AF F5
Save Register Pair AF (Register A = the last status) to the stack.
6D02
GOSUB to 4B64H, DIRCYL: Register D = the directory cylinder of drive Register C (+09H of its table).
6D05
LD HL,4300H 21 00 43
Point Register Pair HL to 4300H, the system's sector buffer.
6D08
LD E,L 5D
Copy Register L (00H) into Register E: sector 0, the allocation table.
6D09
GOSUB to 4B45H, RDSSEC, to read cylinder Register D sector Register E of drive Register C into Register Pair HL (4300H), taken only with the deleted data mark (RDSSEC reads the boot sector for the directory cylinder when needed). The Z FLAG on success.
6D0C
If the NZ FLAG is set (the read failed), JUMP to 6D5BH: Register A = 08H.
6D0E
LD DE,(43CCH) ED 5B CC 43
Load Register Pair DE with +CCH-+CDH of the allocation table at 43CCH: Register E the cylinders less 35, Register D the configuration byte.
6D12
LD A,C 79
Copy Register C (the drive state, bits 2-0 the drive) into Register A.
6D13
RLCA 07
Rotate Register A left one bit (RLCA), the first of three.
6D14
RLCA 07
Rotate Register A left one bit (RLCA), the second of the three shifts.
6D15
RLCA 07
Rotate Register A left one bit (RLCA): the drive in bits 5-3.
6D16
OR C6H F6 C6
Set bits 7, 6, 2 and 1 in Register A (OR C6H): C6H + 8 x drive, the second byte of SET n,(HL) with n the drive.
6D18
BIT 3,D CB 5A
Test bit 3 of Register D (the configuration byte): set when the diskette has the date format of this release.
6D1A
If the NZ FLAG is set (the date format), JUMP to 6D1EH: keep SET.
6D1C
XOR 40H EE 40
Exclusive OR 40H into Register A: 86H + 8 x drive, the second byte of RES n,(HL).
6D1E
LD (6D25H),A 32 25 6D
Store Register A at 6D25H, the second byte of the instruction at 6D24H.
6D21
LD HL,475DH 21 5D 47
Point Register Pair HL to 475DH, the date stamping flags, one bit for each drive.
6D24
RLC B CB 00
The instruction made at 6D25H: SET or RES of bit (drive) of the byte at Register Pair HL (475DH). In the file the bytes CBH 00H read RLC B (a rotate of Register B), which never runs: 6D1EH always stores first.
6D26
LD A,22H 3E 22
Load Register A with 22H (34): the highest cylinder of 35.
6D28
ADD A,E 83
ADD Register E (the cylinders less 35) to Register A: the highest cylinder.
6D29
LD (IY+06H),A FD 77 06
Store Register A (the highest cylinder) at +06H of the drive code table at Index Register IY.
6D2C
RES 7,(IY+04H) FD CB 04 BE
Clear bit 7 of +04H of the drive code table at Index Register IY.
6D30
BIT 4,D CB 62
Test bit 4 of Register D (the configuration byte): set when cylinder 0 is in single density and the rest in double density.
6D32
If the Z FLAG is set (all cylinders alike), JUMP to 6D38H.
6D34
SET 7,(IY+04H) FD CB 04 FE
Set bit 7 of +04H of the drive code table at Index Register IY: the mirror image engine gives cylinder 0 its own sector count (5E59H, 5F36H).
6D38
RES 5,(IY+04H) FD CB 04 AE
Clear bit 5 of +04H of the drive code table at Index Register IY: one side.
6D3C
BIT 5,D CB 6A
Test bit 5 of Register D (the configuration byte): set for two sides.
6D3E
If the Z FLAG is set (one side), JUMP to 6D44H.
6D40
SET 5,(IY+04H) FD CB 04 EE
Set bit 5 of +04H of the drive code table at Index Register IY: two sides.
6D44
POP AF F1
Restore Register Pair AF (Register A = the status saved at 6D01H) from the stack.
6D45
RLCA 07
Rotate Register A left one bit (RLCA): bit 6 of the status, WRITE PROTECT, to bit 7.
6D46
OR (IY+03H) FD B6 03
OR +03H of the drive code table at Index Register IY into Register A: bit 7 of +03H, write protected by LDOS.
6D49
AND 80H E6 80
Mask Register A to bit 7 (AND 80H): either write protection.
6D4B
ADD A,A 87
ADD Register A to itself: bit 7 into the CARRY FLAG, Register A = 00H with the Z FLAG.
6D4C
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
6D4D
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
6D4E
RET C9
RETurn: the Z FLAG (or the NZ FLAG with Register A = 08H from 6D5CH), the CARRY FLAG for write protection.
6D4FH - Look at the Index Hole
Returns the NZ FLAG while the index hole is at the head (status bit 1 after a Type I command). When TIMER$ (4288H) reaches the deadline in Register D, the caller's return address is dropped and 6CBFH returns with error 08H.
6D4F
LD A,(4288H) 3A 88 42
Load Register A with TIMER$ from 4288H, the tick counter of the clock interrupt.
6D52
CP D BA
Compare Register A against Register D (the deadline): the Z FLAG when it is reached.
6D53
If the Z FLAG is set (the time is up), JUMP to 6D5BH.
6D55
GOSUB to 4759H, TSTBSY: wait until the controller of drive Register C is not busy; Register A = the controller's status.
6D58
BIT 1,A CB 4F
Test bit 1 of Register A: the index hole, with no command running.
6D5A
RET C9
RETurn with the NZ FLAG for the hole, the Z FLAG without it.
6D5B
POP AF F1
Discard the top word of the stack (POP AF into Register Pair AF): the return address of the CALL 6D4FH, or from 6D0CH the status saved at 6D01H.
6D5C
LD A,08H 3E 08
Load Register A with 08H, error 08H, Device not available.
6D5E
OR A B7
Set the flags from Register A (OR A): the NZ FLAG, CARRY clear.
6D5F
JUMP to 6D4CH to restore Register Pair DE and Register Pair HL and return the failure.
6D61H - Is the Date Format Bit Set?
Register A = the drive state (bits 2-0 the drive). BIT n,A with n the drive is made at 6D72H and run on 475DH: the NZ FLAG when the drive's diskette has the date format of this release.
6D61
AND 07H E6 07
Mask Register A (the drive state) to bits 2-0 (AND 07H): the drive.
6D63
LD B,A 47
Copy Register A (the drive number) into Register B, for the count of the additions.
6D64
INC B 04
INCrement Register B: the count of the additions below, the drive + 1.
6D65
LD A,3FH 3E 3F
Load Register A with 3FH, which is 47H (BIT 0,A) less 8.
6D67
ADD A,08H C6 08
ADD 08H to Register A: the second byte of BIT for the next bit number.
6D69
DECrement Register B and LOOP BACK to 6D67H: Register A = 47H + 8 x drive, the second byte of BIT n,A.
6D6B
LD (6D72H),A 32 72 6D
Store Register A at 6D72H, the second byte of the instruction at 6D71H.
6D6E
LD A,(475DH) 3A 5D 47
Load Register A with the date stamping flags at 475DH.
6D71
RLC B CB 00
The instruction made at 6D72H: BIT (drive),A, a test of the drive's bit in Register A. In the file the bytes CBH 00H read RLC B (a rotate of Register B), which never runs: 6D6BH always stores first.
6D73
RET C9
RETurn with the NZ FLAG when the drive's bit is set.
6D74H - The Parameter Table and the Texts of the Front End
The table of @PARAM (5A7FH): 16 entries of a name of 6 characters (spaces after it) and the address of the parameter's cell, then 00H. Then the texts of the front end and the days of the months for the DATE parameter.
6D74-6D7B
DEFM "MPW " / DEFW 5C94H 4D 50 57 20 20 20 94 5C
6D74H-6D7BH: MPW, the master password: the address of its text goes to 5C94H, the operand of LD DE at 5C93H.
6D7C-6D83
DEFM "SYS " / DEFW 521BH 53 59 53 20 20 20 1B 52
6D7CH-6D83H: SYS, system files too, and a system diskette made by the file by file engine: the cell 521BH.
6D84-6D8B
DEFM "S " / DEFW 521BH 53 20 20 20 20 20 1B 52
6D84H-6D8BH: S, the short form of SYS: 521BH.
6D8C-6D93
DEFM "INV " / DEFW 5AE4H 49 4E 56 20 20 20 E4 5A
6D8CH-6D93H: INV, invisible files too: the cell 5AE4H, the operand of LD DE at 5AE3H.
6D94-6D9B
DEFM "I " / DEFW 5AE4H 49 20 20 20 20 20 E4 5A
6D94H-6D9BH: I, the short form of INV: 5AE4H.
6D9C-6DA3
DEFM "MOD " / DEFW 5217H 4D 4F 44 20 20 20 17 52
6D9CH-6DA3H: MOD, only the files marked as changed: the cell 5217H.
6DA4-6DAB
DEFM "M " / DEFW 5217H 4D 20 20 20 20 20 17 52
6DA4H-6DABH: M, the short form of MOD: 5217H.
6DAC-6DB3
DEFM "QUERY " / DEFW 5219H 51 55 45 52 59 20 19 52
6DACH-6DB3H: QUERY, a question for each file: the cell 5219H.
6DB4-6DBB
DEFM "Q " / DEFW 5219H 51 20 20 20 20 20 19 52
6DB4H-6DBBH: Q, the short form of QUERY: 5219H.
6DBC-6DC3
DEFM "X " / DEFW 52CAH 58 20 20 20 20 20 CA 52
6DBCH-6DC3H: X, a backup with the system diskette out of drive 0: the cell 52CAH, the operand of LD DE at 52C9H.
6DC4-6DCB
DEFM "DATE " / DEFW 5AA2H 44 41 54 45 20 20 A2 5A
6DC4H-6DCBH: DATE, the files of a range of dates: the address of its text goes to 5AA2H, the operand of LD HL at 5AA1H.
6DCC-6DD3
DEFM "D " / DEFW 5AA2H 44 20 20 20 20 20 A2 5A
6DCCH-6DD3H: D, the short form of DATE: 5AA2H.
6DD4-6DDB
DEFM "NEW " / DEFW 5213H 4E 45 57 20 20 20 13 52
6DD4H-6DDBH: NEW, only the files the destination lacks: the cell 5213H.
6DDC-6DE3
DEFM "N " / DEFW 5213H 4E 20 20 20 20 20 13 52
6DDCH-6DE3H: N, the short form of NEW: 5213H.
6DE4-6DEB
DEFM "OLD " / DEFW 5215H 4F 4C 44 20 20 20 15 52
6DE4H-6DEBH: OLD, only the files the destination has: the cell 5215H.
6DEC-6DF3
DEFM "O " / DEFW 5215H 4F 20 20 20 20 20 15 52
6DECH-6DF3H: O, the short form of OLD: 5215H.
6DF4
DEFB 00H 00
6DF4H: 00H, the end of the table of the parameters.
6DF5-6E26
DEFM "Single drive backup invalid during <DO> processing" 53 69 6E 67 6C 65 20 64 72 69 76 65 20 62 61 63 6B 75 70 20 69 6E 76 61 6C 69 64 20 64 75 72 69 6E 67 20 3C 44 4F 3E 20 70 72 6F 63 65 73 73 69 6E 67
6DF5H-6E26H: the text of 5A9BH, for source and destination on one drive during a JCL job.
6E27
DEFB 0DH 0D
6E27H: 0DH, the end of the text and of its line.
6E28-6E56
DEFM "Destination disk not formatted - Backup aborted" 44 65 73 74 69 6E 61 74 69 6F 6E 20 64 69 73 6B 20 6E 6F 74 20 66 6F 72 6D 61 74 74 65 64 20 2D 20 42 61 63 6B 75 70 20 61 62 6F 72 74 65 64
6E28H-6E56H: the text of 5C1EH, when sector 0 of cylinder 0 of the destination cannot be verified.
6E57
DEFB 0DH 0D
6E57H: 0DH, the end of the text and of its line.
6E58
DEFB 0AH 0A
6E58H: 0AH, a new line before the banner of 5A04H.
6E59-6E89
DEFM "BACKUP - LDOS Disk Backup Utility - Version 5.3.1" 42 41 43 4B 55 50 20 2D 20 4C 44 4F 53 20 44 69 73 6B 20 42 61 63 6B 75 70 20 55 74 69 6C 69 74 79 20 2D 20 56 65 72 73 69 6F 6E 20 35 2E 33 2E 31
6E59H-6E89H: the first line of the banner, the name and version of the program.
6E8A
DEFB 0AH 0A
6E8AH: 0AH, a new line before the copyright line of the banner.
6E8B-6EBB
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 41 6C 6C 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64
6E8BH-6EBBH: the second line of the banner, the copyright.
6EBC-6EBD
DEFB 0AH, 0DH 0A 0D
6EBCH-6EBDH: 0AH, a new line, and 0DH, the end of the banner.
6EBE-6EDA
DEFM "Source drive number ? " 53 6F 75 72 63 65 20 64 72 69 76 65 20 6E 75 6D 62 65 72 20 3F 20 20 20 20 20 20 20 20
6EBEH-6EDAH: the question of 5A34H when the command line names no source drive; the spaces clear the rest of the line.
6EDB
DEFB 03H 03
6EDBH: 03H, the end of the question: the cursor stays after the spaces, where the reply is typed.
6EDC-6EF8
DEFM "Destination drive number ? " 44 65 73 74 69 6E 61 74 69 6F 6E 20 64 72 69 76 65 20 6E 75 6D 62 65 72 20 3F 20 20 20
6EDCH-6EF8H: the question of 5A5FH when the command line names no destination drive.
6EF9
DEFB 03H 03
6EF9H: 03H, the end of the question: the reply is typed after it.
6EFA-6F0C
DEFM "No date established" 4E 6F 20 64 61 74 65 20 65 73 74 61 62 6C 69 73 68 65 64
6EFAH-6F0CH: the text of 5B3AH, when the system date was never set (421CH 00H).
6F0D
DEFB 0DH 0D
6F0DH: 0DH, the end of the text and of its line.
6F0E-6F24
DEFM "Backup by class invoked" 42 61 63 6B 75 70 20 62 79 20 63 6C 61 73 73 20 69 6E 76 6F 6B 65 64
6F0EH-6F24H: the text of 5B30H, when a partspec or a selection was given.
6F25
DEFB 0DH 0D
6F25H: 0DH, the end of the text and of its line.
6F26-6F49
DEFM "Single drive BACKUP invalid by files" 53 69 6E 67 6C 65 20 64 72 69 76 65 20 42 41 43 4B 55 50 20 69 6E 76 61 6C 69 64 20 62 79 20 66 69 6C 65 73
6F26H-6F49H: the text of 6C19H: the file by file engine needs two drives.
6F4A
DEFB 0DH 0D
6F4AH: 0DH, the end of the text and of its line.
6F4B-6F81
DEFM "This backup requires residency of SYS's: 2, 3, 8, & 10." 54 68 69 73 20 62 61 63 6B 75 70 20 72 65 71 75 69 72 65 73 20 72 65 73 69 64 65 6E 63 79 20 6F 66 20 53 59 53 27 73 3A 20 32 2C 20 33 2C 20 38 2C 20 26 20 31 30 2E
6F4BH-6F81H: the text of 6C32H, for X with a file by file backup when SYS2/SYS, SYS3/SYS, SYS8/SYS or SYS10/SYS is not kept in memory by SYSRES.
6F82
DEFB 0DH 0D
6F82H: 0DH, the end of the text and of its line.
6F83-6F9C
DEFM "Backup-reconstruct invoked" 42 61 63 6B 75 70 2D 72 65 63 6F 6E 73 74 72 75 63 74 20 69 6E 76 6F 6B 65 64
6F83H-6F9CH: the text of 5C69H, when the diskettes are not alike and the file by file engine copies every file.
6F9D
DEFB 0DH 0D
6F9DH: 0DH, the end of the text and of its line.
6F9E-6FD4
DEFM "Cylinder count differs - Attempt mirror-image backup ? " 43 79 6C 69 6E 64 65 72 20 63 6F 75 6E 74 20 64 69 66 66 65 72 73 20 2D 20 41 74 74 65 6D 70 74 20 6D 69 72 72 6F 72 2D 69 6D 61 67 65 20 62 61 63 6B 75 70 20 3F 20
6F9EH-6FD4H: the question of 5C72H, when the two cylinder counts differ.
6FD5
DEFB 03H 03
6FD5H: 03H, the end of the question: the reply is typed after it.
6FD6-6FEC
DEFM "Master password ? " 4D 61 73 74 65 72 20 70 61 73 73 77 6F 72 64 20 3F 20 20 20 20 20 20
6FD6H-6FECH: the question of 5C96H (displayed by 6C8FH) when MPW was not given.
6FED
DEFB 03H 03
6FEDH: 03H, the end of the question: the reply is typed after it.
6FEE-7004
DEFM "Invalid master password" 49 6E 76 61 6C 69 64 20 6D 61 73 74 65 72 20 70 61 73 73 77 6F 72 64
6FEEH-7004H: the text of 5CABH, when the master password given is wrong.
7005
DEFB 0DH 0D
7005H: 0DH, the end of the text and of its line.
7006-7011
DEFB 1FH, 1CH, 1FH, 1EH, 1FH, 1EH, 1FH, 1FH, 1EH, 1FH, 1EH, 1FH 1F 1C 1F 1E 1F 1E 1F 1F 1E 1F 1E 1F
7006H-7011H: the days of January to December (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), read by 5CF7H; 5CE4H adds one to February (7007H) for a leap year.
7012-7020
DEFM "Bad date format" 42 61 64 20 64 61 74 65 20 66 6F 72 6D 61 74
7012H-7020H: the text of 5D1AH, for a DATE text that cannot be read.
7021
DEFB 0DH 0D
7021H: 0DH, the end of the text, the last byte of the file's last load block.