DOSPLUS 3.5 for the Model I - SYS10/SYS Disassembled

Page Customization

Introduction/Summary

DOSPLUS 3.5 SYS10/SYS Disassembly - The Library Commands COPY, APPEND and LIST (Model I)

SYS10/SYS is the second of the high overlays, which hold the library commands: it loads at 5200H, over the area 5200H-5BFFH that SYS0/SYS keeps for them, and holds COPY (request code 93H), APPEND (94H) and LIST (95H). CMNDI@ takes these codes from SYS1/SYS's table of the library commands (51C5H, 51B9H and 51D5H) and passes them to the overlay request handler, which loads SYS10/SYS and calls routine 3, 4 or 5 of its table at 5200H with Register Pair HL at the rest of the command line. No file of the diskette requests routine 2 (92H) or calls into SYS10/SYS. The file is a load module of 7 blocks, 1632 bytes, from 5200H to 585FH, with the transfer address 5200H and no gaps; the work area after it runs from 5860H, with a sector buffer at 5900H and the copy buffer from 5A00H to the top of memory.

The Parts of SYS10/SYS

AddressContents
5200H-5209HThe routine table (routines 2-5) and routine 2 (5200H, 5208H).
520AH-5286HCOPY: the switches, the command line, the buffer, the choice of the kind of copy (520AH).
5287H-5325HThe wildmask copy: the directory of the source drive, entry by entry (5287H, 52C1H).
5326H-54FDHThe file copy: the names, QUERY, OLD, NEW, OVER, ECHO, the size, the data, closing, KILL and the attributes (5326H, 5346H, 53F1H, 5412H, 5463H).
54FEH-556FHThe device copy, also used by LIST and APPEND (54FEH, 551AH).
5570H-55EEHCOPY's evaluation block and parameter table (5570H).
55EFH-5641HLIST and its evaluation block (55EFH, 562FH).
5642H-56CFHAPPEND and its evaluation block (5642H, 56B4H).
56D0H-57EEHThe helpers: a low overlay, the keyboard, the prompt, the question, texts, WILD@, building a specification, the drive, the error exit (56D0H, 56D1H, 56E2H, 5712H, 5725H, 5740H, 5750H, 575EH, 5769H, 57BAH, 57E2H).
57EFH-585FHThe questions and the prompts (57EFH).
5860H-5AFFHThe work area after the file (5860H).

Parameters Stored into the Code

Every switch of the three commands is the operand of an instruction further on: the parameter tables (5570H, 562FH, 56B4H) give EVAL@ (4479H) the operands' addresses, so the value of MOD, for one, goes straight into the LD DE,0000H at 52E4H, which then tests Register E. Each command clears the low bytes of its own switches first. CTL (5553H) is shared: COPY and APPEND set it to FFH, so that every character of a device copy goes out as it is, and LIST clears it and lets its parameter CTL set it. The passwords SPW and DPW are strings: EVAL@ stores the address of the quoted text into the LD BC,0000H at 52FFH and 5308H.

The Three Kinds of COPY

COPY needs both a source and a destination (else error 2FH, I/o field not found) and at least 5B00H of memory (21H). A device on either side makes a device copy (54FEH); a file name as the source a file copy (5326H); a drive as the source a wildmask copy (5287H), to a drive only (a name is 2EH), and not with PROMPT (2EH). The wildmask copy reads directory sectors 2 to the last of the source drive into 5900H and takes each entry in use that is not an extended entry (52C1H): a system file only with SYSTEM, and then without the INVIS and MOD tests; an invisible file only with INVIS; with MOD only a file whose modified flag (bit 6 of +01H) is set; and only names that match the wildmask (WILD@, 575EH). For each, NAME/EXT.PASSWORD:D is built for both sides from the entry, the password being SPW or DPW (5769H), and the file is copied as by a file copy.

Copying a File

A destination given as a drive takes the source's name, extension and password (5333H). QUERY asks Copy ? on the name's line (5725H); the answer is one character by KEYIN@, Y or y for yes, BREAK error 30H. The source is opened, then the destination: with OLD by OPEN@, so that a file not on the destination is passed over; else by INIT@, which creates it when needed. NEW passes over a file that exists, OVER asks Overwrite ? for it, and ECHO shows the name when neither QUERY nor OVER has shown it (53C8H). The destination is then written once at the source's last sector, which gives it all its space before any data moves, and rewound (53F1H). The data goes through the buffer from 5A00H, as many pages as memory holds (one with TINY): READ@ fills the pages, WRITE@ empties them, until READ@ reports the end (1CH or 1DH) (5412H). The destination is closed with the source's end of file byte and ending record; then the source is killed (KILL) or its modified flag cleared, and the destination's directory entry gets the source's flag byte (protection level, invisible, system), logical record length and both password codes, with its own modified flag clear (5463H). The dates are the destination's own.

One Drive: PROMPT and the Overlays

With PROMPT, COPY asks for the disk each step needs: Insert SOURCE disk (ENTER), Insert DESTINATION disk (ENTER) and Insert SYSTEM disk (ENTER) (57EFH). The text flashes on the cursor's line until a key is pressed and is then cleared (56E2H); nothing is asked while a DO file runs. Since OPEN@ and INIT@ are in SYS2/SYS, WRITE@'s allocation in SYS4/SYS and CLOSE@ in SYS3/SYS, COPY has each of them loaded before the prompt that may take the system disk away, by requesting its routine 2, which does nothing (56D0H, 5357H, 53E6H, 5469H). The error exit asks for the system disk before ERROR@ (57E2H).

The Device Copy, LIST and APPEND

The device copy (551AH) opens the source by OPEN@ and the destination by INIT@ and passes the characters through the ROM's 0013H and 001BH, which reach a file through SYS0/SYS and a device through its DCB. A source file ends at its end of file (1CH); a source device ends with ETX (03H, CONTROL-C at the keyboard), and a device that has no character (00H) is asked again. While the source is not the keyboard, each character also scans the keyboard (56D1H): the SPACE BAR pauses and BREAK ends. A destination file is closed. Without CTL, a control code other than the carriage return and every character of 80H or more go out as a period (5553H). LIST (55EFH) takes a source and an optional destination; without one it makes the destination a device block for @DO (LOCDCB% 4488H) and lists to the display. APPEND (5642H) opens its destination by OPEN@ with a logical record length of 1, so the file must exist; it positions it to its end by PEOF@, backs it up by four bytes with CMD (the transfer address record of a load module) or one byte with STRIP, and appends the source. A device as APPEND's destination simply receives the source.

Differences from the Manual

The manual's parameter table of COPY lacks SYSTEM, which its text describes; the bytes have it. Its abbreviation O is given for both OVER and OLD: EVAL@ takes the first name in the table that starts with the letters given, and OVER comes before OLD, so O is OVER and OLD needs OL. LIST's CTL turns more than the control codes 00H-1FH into periods: the bytes do the same to every character of 80H or more and pass the carriage return. The manual says BREAK ends LIST @KI @PR; when the keyboard is the source, SYS10/SYS does not scan the keyboard itself and ends only on 03H. TINY copies through one page at 5A00H, inside the overlay area, as the manual says, but COPY still requires memory up to 5B00H. APPEND opens its destination file without creating it, and with both CMD and STRIP backs up only CMD's four bytes; its test for a file too short to back up looks only at an empty file. A system file taken by SYSTEM in a wildmask copy is not tested against INVIS or MOD. The questions take the answer Y or y; anything else, ENTER alone included, is no, as the manual says.

Variables

Self-Modified Operands

Address
Size
Contents
5292H-5293H
2 bytes
PROMPT
The operand of LD DE,0000H at 5291H, also read by 56E2H.
5347H-5348H
2 bytes
QUERY
The operand of LD BC,0000H at 5346H, also read by 53CFH.
54ABH-54ACH
2 bytes
KILL
The operand of LD DE,0000H at 54AAH.
52E5H-52E6H
2 bytes
MOD
The operand of LD DE,0000H at 52E4H.
53B4H-53B5H
2 bytes
OVER
The operand of LD BC,0000H at 53B3H.
52D1H-52D2H
2 bytes
SYSTEM
The operand of LD DE,0000H at 52D0H.
52DEH-52DFH
2 bytes
INVIS
The operand of LD DE,0000H at 52DDH.
5261H-5262H
2 bytes
TINY
The operand of LD DE,0000H at 5260H.
53C9H-53CAH
2 bytes
ECHO
The operand of LD DE,0000H at 53C8H.
5386H-5387H
2 bytes
OLD
The operand of LD BC,0000H at 5385H.
53ACH-53ADH
2 bytes
NEW
The operand of LD BC,0000H at 53ABH.
5300H-5301H
2 bytes
SPW
The address of the source's master password: the operand of LD BC,0000H at 52FFH.
5309H-530AH
2 bytes
DPW
The address of the destination's master password: the operand of LD BC,0000H at 5308H.
5554H-5555H
2 bytes
CTL
The operand of LD DE,0000H at 5553H: FFH for COPY (522DH) and APPEND (564DH).
568BH-568CH
2 bytes
CMD
The operand of LD HL,0000H at 568AH.
5694H-5695H
2 bytes
STRIP
The operand of LD HL,0000H at 5693H.
5724H
1 byte
Flash State
The prompt's state, 1EH while the text is off (5724H).

Work Area (5860H-5AFFH)

Address
Size
Contents
5860H
1 byte
End Flag
5860H
5861H-5862H
2 bytes
End of the Data
5861H
5863H-5864H
2 bytes
Top of the Buffer
5863H
5867H-5868H
2 bytes
Answer
5867H
586AH
1 byte
Source Flags
586AH
586BH-588AH
32 bytes
Source Block
586BH
588BH
1 byte
Destination Flags
588BH
588CH-58ABH
32 bytes
Destination Block
588CH
58ACH
1 byte
Wildmask Flags
58ACH
58ADH-58CCH
32 bytes
Wildmask, then Copies
58ADH
5900H-59FFH
256 bytes
Sector Buffer
5900H
5A00H
to the top
Copy Buffer
5A00H

Outside Routines

AddressContents
4479HSYS0/SYS: EVAL@ (523FH, 55FAH, 5654H).
447CHSYS0/SYS: WILD@ (575AH, 5765H).
4424HSYS0/SYS: OPEN@.
4420HSYS0/SYS: INIT@.
4428HSYS0/SYS: CLOSE@.
442CHSYS0/SYS: KILL@ (54B4H).
4436HSYS0/SYS: READ@ (5421H).
4439HSYS0/SYS: WRITE@.
443FHSYS0/SYS: REW@ (540CH).
4442HSYS0/SYS: POSN@ (5403H).
4445HSYS0/SYS: BKSP@ (56A8H).
4448HSYS0/SYS: PEOF@ (5687H).
4409HSYS0/SYS: ERROR@ (57ECH).
4485HSYS0/SYS: DISKIO%, functions 0 DCHECK and 6 SREAD.
448BHSYS0/SYS: LOCDCT% (52BEH).
4488HSYS0/SYS: LOCDCB% (5620H).
490CHSYS0/SYS: read the directory sector of a logical file number (5498H, 54CCH).
4915HSYS0/SYS: write the directory sector back (54C2H, 54F0H).
4525HSYS0/SYS: call the routine after the CALL with the registers saved (56EDH).
0013HROM: input a character from the control block at Register Pair DE.
001BHROM: output the character in Register A to the control block at Register Pair DE.
002BHROM: scan the keyboard.
0033HROM: display the character in Register A.
0040HROM: input a line (KEYIN@).
0049HROM: wait for a key.

Disassembly

5200H - The Routine Table

Data: SYS10/SYS's table of routines 2-5, one word each, used by SYS0/SYS's overlay request handler (its 49C9H-49DCH) for the request codes 92H-95H. CMNDI@ takes the codes of the library commands from SYS1/SYS's table: COPY 93H (51C5H), APPEND 94H (51B9H), LIST 95H (51D5H). No file of the diskette requests 92H.

5200-5201
DEFW 5208H 08 52
Routine 2: 5208H, XOR A and RET, which SYS0/SYS's record locator requests when it loads SYS10/SYS back (its 4D55H-4D62H).
5202-5203
DEFW 520AH 0A 52
Routine 3: 520AH, COPY, request code 93H, entered from CMNDI@ with Register Pair HL at the rest of the command line.
5204-5205
DEFW 5642H 42 56
Routine 4: 5642H, APPEND, request code 94H: a file or device added to the end of a file, or sent to a device.
5206-5207
DEFW 55EFH EF 55
Routine 5: 55EFH, LIST, request code 95H: a file or device listed to the display or to a destination.

5208H - Routine 2

Nothing to do when SYS0/SYS's record locator brings SYS10/SYS back.

5208
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: routine 2 has no work to do.
5209
RET C9
RETurn to SYS0/SYS's overlay request handler (49DDH) with Register A = 00H.

520AH - COPY

Routine 3, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. The eleven switches of COPY are the operands of instructions further on, which EVAL@ stores the values into; COPY clears the low byte of each first, sets CTL (5554H) to FFH so that a device copy passes every character as it is, and clears the two password addresses SPW and DPW. EVAL@ then takes the command line with the block at 5570H: the source field, the destination field, a wildmask and the parameters. Both fields must be given. A device as either field makes a device copy (54FEH), a file name as the source a file copy (5326H), and a drive as the source a wildmask copy of the whole directory (5291H).

520A
XOR A AF
Set Register A to 00H by XORing it with itself, to clear the switches of COPY below.
520B
LD (5292H),A 32 92 52
Store Register A (00H) to 5292H, the low byte of the PROMPT value: the operand of LD DE,0000H at 5291H, also read by 56E2H.
520E
LD (5347H),A 32 47 53
Store Register A (00H) to 5347H, the low byte of the QUERY value: the operand of LD BC,0000H at 5346H, also read by 53CFH.
5211
LD (54ABH),A 32 AB 54
Store Register A (00H) to 54ABH, the low byte of the KILL value: the operand of LD DE,0000H at 54AAH.
5214
LD (52E5H),A 32 E5 52
Store Register A (00H) to 52E5H, the low byte of the MOD value: the operand of LD DE,0000H at 52E4H.
5217
LD (53B4H),A 32 B4 53
Store Register A (00H) to 53B4H, the low byte of the OVER value: the operand of LD BC,0000H at 53B3H.
521A
LD (52D1H),A 32 D1 52
Store Register A (00H) to 52D1H, the low byte of the SYSTEM value: the operand of LD DE,0000H at 52D0H.
521D
LD (52DEH),A 32 DE 52
Store Register A (00H) to 52DEH, the low byte of the INVIS value: the operand of LD DE,0000H at 52DDH.
5220
LD (5261H),A 32 61 52
Store Register A (00H) to 5261H, the low byte of the TINY value: the operand of LD DE,0000H at 5260H.
5223
LD (53C9H),A 32 C9 53
Store Register A (00H) to 53C9H, the low byte of the ECHO value: the operand of LD DE,0000H at 53C8H.
5226
LD (5386H),A 32 86 53
Store Register A (00H) to 5386H, the low byte of the OLD value: the operand of LD BC,0000H at 5385H.
5229
LD (53ACH),A 32 AC 53
Store Register A (00H) to 53ACH, the low byte of the NEW value: the operand of LD BC,0000H at 53ABH.
522C
DEC A 3D
DECrement Register A by 1 to FFH, the value of CTL that passes every character of a device copy unchanged.
522D
LD (5554H),A 32 54 55
Store Register A (FFH) to 5554H, the low byte of the CTL value: the operand of LD DE,0000H at 5553H, which COPY has no parameter for.
5230
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the value of a password that was not given.
5233
LD (5300H),BC ED 43 00 53
Store Register Pair BC (0000H) to 5300H-5301H, the SPW value: the operand of LD BC,0000H at 52FFH, the address of the source disk's master password.
5237
LD (5309H),BC ED 43 09 53
Store Register Pair BC (0000H) to 5309H-530AH, the DPW value: the operand of LD BC,0000H at 5308H, the address of the destination disk's master password.
523B
LD IX,5570H DD 21 70 55
Point Index Register IX to 5570H, the evaluation block of COPY: source 586AH, destination 588BH, wildmask 58ACH, parameters 5579H.
523F
GOSUB to 4479H, EVAL@, to take the source, destination and wildmask fields and the parameters from the command line at Register Pair HL.
5242
If the NZ FLAG is set (an error in the command line), JUMP to 57E2H to post the error in Register A (2EH, Invalid parameter).
5245
LD A,(IX+00H) DD 7E 00
Load Register A with the evaluation block's flags at Index Register IX+00H: bit 0 a source field, bit 1 a destination field.
5248
CPL 2F
Invert every bit of Register A (CPL), so that bits 0 and 1 are set for the fields that are missing.
5249
AND 03H E6 03
AND Register A with 03H, bits 0 and 1: the NZ FLAG when the source or the destination field is missing.
524B
LD A,2FH 3E 2F
Load Register A with 2FH, the error code I/o field not found; the load keeps the flags of the AND.
524D
If the NZ FLAG is set (a field is missing), JUMP to 57E2H to post error 2FH in Register A.
5250
LD HL,(4049H) 2A 49 40
Load Register Pair HL with the top of memory, HMEM$, from 4049H.
5253
LD (5863H),HL 22 63 58
Store Register Pair HL (HMEM$) to 5863H-5864H, the top of the copy buffer: the big buffer runs from 5A00H up to the top of memory.
5256
LD BC,5B00H 01 00 5B
Load Register Pair BC with 5B00H, the top of the smallest buffer, one page at 5A00H.
5259
SBC HL,BC ED 42
SUBtract Register Pair BC (5B00H) from Register Pair HL (HMEM$) with the C FLAG (clear after the AND): the C FLAG when memory ends below 5B00H.
525B
LD A,21H 3E 21
Load Register A with 21H, the error code No memory space available; the load keeps the flags of the SBC.
525D
If the C FLAG is set (HMEM$ below 5B00H), JUMP to 57E2H to post error 21H in Register A.
5260
LD DE,0000H 11 00 00
Load Register Pair DE with the TINY value, the operand at 5261H-5262H that EVAL@ stored (0000H when TINY was not given).
5263
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
5264
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when Register E is 00H, TINY not given.
5265
If the Z FLAG is set (no TINY), JUMP to 526BH with the big buffer up to HMEM$.
5267
LD (5863H),BC ED 43 63 58
TINY: store Register Pair BC (5B00H) to 5863H-5864H, so that the copy buffer is the one page at 5A00H.
526B
LD A,(586AH) 3A 6A 58
Load Register A with the flag byte of the source block at 586AH (bit 7 a device or a drive, bit 6 a name, bit 3 a drive).
526E
AND C8H E6 C8
AND Register A with C8H, bits 7, 6 and 3, which tell a device from a drive and a name.
5270
CP 80H FE 80
Compare Register A against 80H: the Z FLAG when only bit 7 is set, a device such as @KI.
5272
If the Z FLAG is set (the source is a device), JUMP to 54FEH for a device copy.
5275
LD A,(588BH) 3A 8B 58
Load Register A with the flag byte of the destination block at 588BH.
5278
AND C8H E6 C8
AND Register A with C8H, bits 7, 6 and 3, which tell a device from a drive and a name.
527A
CP 80H FE 80
Compare Register A against 80H: the Z FLAG when the destination is a device such as @PR.
527C
If the Z FLAG is set (the destination is a device), JUMP to 54FEH for a device copy.
527F
LD A,(586AH) 3A 6A 58
Load Register A with the flag byte of the source block at 586AH again.
5282
BIT 6,A CB 77
Test bit 6 of Register A, which EVAL@ sets for a field with a file name.
5284
If the NZ FLAG is set (the source is a file), JUMP to 5326H for a copy of one file.

5287H - The Wildmask Copy

The source is a drive: every file of its directory that the switches and the wildmask let through is copied to the destination drive under its own name. The destination must be a drive too (a name is error 2EH), and PROMPT is refused (2EH): a wildmask copy cannot be made with one drive. The wildmask is set for WILD@, the source drive must be ready (08H), and directory sectors 2 to the last are read one by one into 5900H.

5287
LD A,(588BH) 3A 8B 58
Load Register A with the flag byte of the destination block at 588BH.
528A
BIT 6,A CB 77
Test bit 6 of Register A: the NZ FLAG when the destination is a file name, which a drive to drive copy cannot take.
528C
LD A,2EH 3E 2E
Load Register A with 2EH, the error code Invalid parameter; the load keeps the flags of the BIT.
528E
If the NZ FLAG is set (a file name as the destination), JUMP to 57E2H to post error 2EH in Register A.
5291
LD DE,0000H 11 00 00
Load Register Pair DE with the PROMPT value, the operand at 5292H-5293H that EVAL@ stored (0000H when PROMPT was not given).
5294
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
5295
DEC E 1D
DECrement Register E by 1 back to its value: the NZ FLAG when PROMPT was given.
5296
LD A,2EH 3E 2E
Load Register A with 2EH, the error code Invalid parameter; the load keeps the flags of the DEC.
5298
If the NZ FLAG is set (PROMPT with a wildmask copy), JUMP to 57E2H to post error 2EH in Register A.
529B
LD HL,58ADH 21 AD 58
Point Register Pair HL to 58ADH, the text of the wildmask block (its flag byte is at 58ACH).
529E
GOSUB to 5750H, which sets WILD@'s mask from the text at Register Pair HL when a wildmask was given.
52A1
LD A,(586AH) 3A 6A 58
Load Register A with the flag byte of the source block at 586AH, which holds the drive in bits 0-2.
52A4
AND 07H E6 07
AND Register A with 07H, bits 0-2: the number of the source drive.
52A6
LD C,A 4F
Load Register C with Register A, the source drive, for DISKIO%.
52A7
LD A,00H 3E 00
Load Register A with 00H, the DISKIO% function DCHECK, to see whether the source drive is ready.
52A9
GOSUB to 4485H, DISKIO%, function 0 DCHECK, for the drive in Register C: the Z FLAG when the drive is ready.
52AC
LD A,08H 3E 08
Load Register A with 08H, the error code Drive not available; the load keeps the flags of DISKIO%.
52AE
If the NZ FLAG is set (the drive is not ready), JUMP to 57E2H to post error 08H in Register A.
52B1
LD E,02H 1E 02
Load Register E with 02H, the first sector of the directory that holds file entries (sector 0 is the GAT, 1 the HIT).
52B3
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the buffer for one directory sector.
52B6
LD A,06H 3E 06
Load Register A with 06H, the DISKIO% function SREAD, which reads a sector of the directory cylinder.
52B8
GOSUB to 4485H, DISKIO%, function 6 SREAD, to read sector Register E of the drive in Register C to Register Pair HL (5900H).
52BB
If the NZ FLAG is set (the read failed), JUMP to 57E2H to post the error in Register A.
52BE
GOSUB to 448BH, LOCDCT%, to point Index Register IY to the drive control table of the drive in Register C.

52C1H - One Directory Entry

Register Pair HL points to an entry of the sector at 5900H. An entry not in use (bit 4 clear) and an extended entry (bit 7) are passed over. A system file (bit 6) is taken only with SYSTEM, and then without the INVIS and MOD tests; an invisible file (bit 3) only with INVIS; with MOD only a file whose bit 6 of +01H is set, which a file gets when it is written to. The name must match the wildmask (WILD@). The file's specification is then built for each side, with SPW or DPW as its password, and the file is copied by 5346H.

52C1
PUSH BC C5
Save Register Pair BC (Register C the source drive) to the top of the stack.
52C2
PUSH DE D5
Save Register Pair DE (Register E the directory sector) to the top of the stack.
52C3
PUSH HL E5
Save Register Pair HL (the entry in the sector at 5900H) to the top of the stack.
52C4
BIT 4,(HL) CB 66
Test bit 4 of the entry's flag byte at Register Pair HL: the Z FLAG when the entry is not in use.
52C6
If the Z FLAG is set (the entry is free or deleted), JUMP to 5313H for the next entry.
52C8
BIT 7,(HL) CB 7E
Test bit 7 of the entry's flag byte at Register Pair HL: the NZ FLAG for an extended entry (FXDE), which holds no file of its own.
52CA
If the NZ FLAG is set (an extended entry), JUMP to 5313H for the next entry.
52CC
BIT 6,(HL) CB 76
Test bit 6 of the entry's flag byte at Register Pair HL: the NZ FLAG for a system file.
52CE
If the Z FLAG is set (not a system file), JUMP to 52D9H for the invisible test.
52D0
LD DE,0000H 11 00 00
A system file: load Register Pair DE with the SYSTEM value, the operand at 52D1H-52D2H (0000H in the file) that EVAL@ stored.
52D3
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
52D4
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when SYSTEM was not given.
52D5
If the Z FLAG is set (no SYSTEM), JUMP to 5313H: a system file is not copied.
52D7
JUMP to 52F1H with SYSTEM given: a system file is copied without the INVIS and MOD tests.
52D9
BIT 3,(HL) CB 5E
Test bit 3 of the entry's flag byte at Register Pair HL: the NZ FLAG for an invisible file.
52DB
If the Z FLAG is set (not invisible), JUMP to 52E4H for the MOD test.
52DD
LD DE,0000H 11 00 00
An invisible file: load Register Pair DE with the INVIS value, the operand at 52DEH-52DFH (0000H in the file) that EVAL@ stored.
52E0
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
52E1
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when INVIS was not given.
52E2
If the Z FLAG is set (no INVIS), JUMP to 5313H: an invisible file is not copied.
52E4
LD DE,0000H 11 00 00
Load Register Pair DE with the MOD value, the operand at 52E5H-52E6H (0000H in the file) that EVAL@ stored.
52E7
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
52E8
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when MOD was not given.
52E9
If the Z FLAG is set (no MOD), JUMP to 52F1H: every file is a candidate.
52EB
INC L 2C
INCrement Register L by 1, to point Register Pair HL to +01H of the entry.
52EC
BIT 6,(HL) CB 76
Test bit 6 of +01H of the entry at Register Pair HL, the modified flag that DIR shows as +.
52EE
If the Z FLAG is set (the file was not written to since its flag was cleared), JUMP to 5313H: MOD passes it over.
52F0
DEC L 2D
DECrement Register L by 1, to point Register Pair HL back to the entry's flag byte.
52F1
LD A,05H 3E 05
Load Register A with 05H, the offset of the name in a directory entry.
52F3
ADD A,L 85
ADD Register L to Register A: the low byte of the entry's name.
52F4
LD L,A 6F
Load Register L with Register A, so that Register Pair HL points to the 11 bytes of the name and extension at +05H.
52F5
GOSUB to 575EH to compare the name at Register Pair HL with the wildmask: the Z FLAG when it matches or no wildmask was given.
52F8
If the NZ FLAG is set (the name does not match), JUMP to 5313H for the next entry.
52FA
PUSH IX DD E5
Save Index Register IX (the evaluation block, 5570H) to the top of the stack: OPEN@ and the rest load Index Register IX with a file control block.
52FC
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the text of the source block, where the source's specification is built.
52FF
LD BC,0000H 01 00 00
Load Register Pair BC with the SPW value, the operand at 5300H-5301H: the address of the source disk's master password, or 0000H.
5302
GOSUB to 5769H to build NAME/EXT.PASSWORD:D at Register Pair DE from the name at Register Pair HL and the password at Register Pair BC.
5305
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the text of the destination block, where the destination's specification is built.
5308
LD BC,0000H 01 00 00
Load Register Pair BC with the DPW value, the operand at 5309H-530AH: the address of the destination disk's master password, or 0000H.
530B
GOSUB to 5769H to build the destination's NAME/EXT.PASSWORD:D at Register Pair DE from the same name at Register Pair HL.
530E
GOSUB to 5346H to copy the file, with the QUERY, OVER, NEW, OLD, ECHO and KILL tests.
5311
POP IX DD E1
Restore Index Register IX, the evaluation block, from the top of the stack.
5313
POP HL E1
Restore Register Pair HL, the entry, from the top of the stack.
5314
POP DE D1
Restore Register Pair DE (Register E the directory sector) from the top of the stack.
5315
POP BC C1
Restore Register Pair BC (Register C the source drive) from the top of the stack.
5316
LD A,20H 3E 20
Load Register A with 20H, the length of a directory entry.
5318
ADD A,L 85
ADD Register L to Register A: the low byte of the next entry, with the C FLAG past the end of the sector.
5319
LD L,A 6F
Load Register L with Register A, so that Register Pair HL points to the next entry.
531A
If the NC FLAG is set (an entry is left in the sector), JUMP back to 52C1H for it.
531C
LD A,(IY+0EH) FD 7E 0E
Load Register A with the number of directory sectors from +0EH of the drive control table at Index Register IY+0EH.
531F
DEC A 3D
DECrement Register A by 1: the number of the last directory sector.
5320
INC E 1C
INCrement Register E by 1, the next directory sector.
5321
CP E BB
Compare Register A (the last sector) against Register E: the NC FLAG while Register E is not past it.
5322
If the NC FLAG is set (sectors are left), JUMP back to 52B3H to read the next one.
5324
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: the wildmask copy is done.
5325
RET C9
RETurn to SYS0/SYS's overlay request handler (49DDH), which returns to CMNDI@'s caller with Register A = 00H.

5326H - The File Copy

The source is a file. A destination given as a drive alone takes the source's NAME/EXT.PASSWORD with the destination's drive (5333H-5343H). 5346H on is also the copy of each file of a wildmask copy (530EH): QUERY asks Copy ?, the source is opened, the destination is opened (OLD: it must exist, else the file is passed over) or created by INIT@ (NEW: a file that exists is passed over; OVER asks Overwrite ? for it); ECHO shows the name. Before each disk access that may follow a change of diskette, SYS10/SYS has the low overlay it will need loaded (SYS2/SYS, SYS4/SYS, SYS3/SYS: 56D0H) and, with PROMPT, asks for the SOURCE, DESTINATION or SYSTEM disk.

5326
LD A,(588BH) 3A 8B 58
Load Register A with the flag byte of the destination block at 588BH.
5329
BIT 6,A CB 77
Test bit 6 of Register A: the NZ FLAG when the destination field has a file name of its own.
532B
If the NZ FLAG is set (a name was given), JUMP to 5346H with the two specifications as EVAL@ left them.
532D
LD HL,586BH 21 6B 58
Point Register Pair HL to 586BH, the source's specification as typed, NAME/EXT.PASSWORD:D.
5330
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the text of the destination block, which holds only the drive.
5333
LD A,(HL) 7E
Load Register A with the character of the source's specification at Register Pair HL.
5334
CP 3AH FE 3A
Compare Register A against 3AH, the colon that starts the drive.
5336
If the Z FLAG is set (the colon), JUMP to 5340H: the source's name, extension and password are copied.
5338
CP 03H FE 03
Compare Register A against 03H, the end of the specification.
533A
If the Z FLAG is set (the end, no drive), JUMP to 5340H.
533C
LDI ED A0
Copy the character at Register Pair HL to Register Pair DE (LDI), and INCrement both; Register Pair BC is DECremented and not used.
533E
JUMP back to 5333H for the next character of the source's specification.
5340
LD A,(588BH) 3A 8B 58
Load Register A with the flag byte of the destination block at 588BH, which holds the destination drive in bits 0-2 with bit 7.
5343
GOSUB to 57BAH to add :D, the destination drive's name from DCTTBL, and 03H at Register Pair DE.

5346H - Copy One File

The copy of one file, for a file copy and for each file of a wildmask copy: the blocks at 586BH (source) and 588CH (destination) hold the two specifications, ended by 03H. A RET NZ or a JUMP to 54F6H passes the file over.

5346
LD BC,0000H 01 00 00
Load Register Pair BC with the QUERY value, the operand at 5347H-5348H (0000H in the file) that EVAL@ stored.
5349
INC C 0C
INCrement Register C by 1, the first half of a test of Register C against 00H.
534A
DEC C 0D
DECrement Register C by 1 back to its value: the Z FLAG when QUERY was not given.
534B
If the Z FLAG is set (no QUERY), JUMP to 5357H to copy the file.
534D
LD HL,586BH 21 6B 58
QUERY: point Register Pair HL to 586BH, the source's specification, whose NAME/EXT is shown.
5350
LD DE,57FFH 11 FF 57
Point Register Pair DE to 57FFH, the question Copy ? on the same line.
5353
GOSUB to 5725H to show the name and the question and take the answer: the Z FLAG for Y.
5356
RET NZ C0
If the NZ FLAG is set (not Y), RETurn: the file is not copied.
5357
LD A,12H 3E 12
Load Register A with 12H, a request for routine 2 of SYS2/SYS (XOR A and RET), which OPEN@ and INIT@ need resident.
5359
GOSUB to 56D0H to have SYS0/SYS load SYS2/SYS now, while the system disk is in the drive.
535C
LD HL,580AH 21 0A 58
Point Register Pair HL to 580AH, the text Insert SOURCE disk (ENTER).
535F
GOSUB to 56E2H, which shows the text at Register Pair HL and waits for a key when PROMPT was given.
5362
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the source block's text, which OPEN@ makes the source's file control block.
5365
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
5367
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the source's sector buffer: the first page of the copy buffer.
536A
GOSUB to 4424H, OPEN@, to open the source file at Register Pair DE.
536D
If the NZ FLAG is set (the source could not be opened), JUMP to 57E2H to post the error in Register A.
5370
PUSH AF F5
Save Register Pair AF to the top of the stack, around the prompt.
5371
LD HL,5825H 21 25 58
Point Register Pair HL to 5825H, the text Insert DESTINATION disk (ENTER).
5374
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
5377
POP AF F1
Restore Register Pair AF from the top of the stack.
5378
LD HL,588CH 21 8C 58
Point Register Pair HL to 588CH, the destination's specification.
537B
PUSH HL E5
Save Register Pair HL (588CH) to the top of the stack, for Register Pair DE below.
537C
LD DE,58ADH 11 AD 58
Point Register Pair DE to 58ADH, a place for a copy of the destination's specification (the wildmask's text is not needed again).
537F
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of the destination block's text.
5382
LDIR ED B0
Copy the 32 bytes from Register Pair HL (588CH) to Register Pair DE (58ADH) by LDIR: OPEN@ and INIT@ turn the text into a file control block, and the copy keeps the name for OVER and ECHO. Register Pair BC counts down.
5384
POP DE D1
Restore Register Pair DE with 588CH from the top of the stack, the destination for OPEN@ or INIT@.
5385
LD BC,0000H 01 00 00
Load Register Pair BC with the OLD value, the operand at 5386H-5387H (0000H in the file) that EVAL@ stored.
5388
INC C 0C
INCrement Register C by 1, the first half of a test of Register C against 00H.
5389
DEC C 0D
DECrement Register C by 1 back to its value: the Z FLAG when OLD was not given.
538A
If the Z FLAG is set (no OLD), JUMP to 539EH to open or create the destination by INIT@.
538C
LD B,00H 06 00
OLD: load Register B with 00H, the logical record length 256.
538E
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the destination's sector buffer.
5391
GOSUB to 4424H, OPEN@, to open the destination at Register Pair DE: the file must exist already.
5394
If the Z FLAG is set (the destination exists), JUMP to 53B3H for the OVER test.
5396
CP 18H FE 18
Compare Register A, the error code, against 18H, File not in directory.
5398
If the NZ FLAG is set (another error), JUMP to 57E2H to post the error in Register A.
539B
JUMP to 54F6H: with OLD, a file that is not on the destination is passed over.
539E
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
53A0
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the destination's sector buffer.
53A3
GOSUB to 4420H, INIT@, to open the destination at Register Pair DE, or create it: the C FLAG when it was created.
53A6
If the NZ FLAG is set (INIT@ failed), JUMP to 57E2H to post the error in Register A.
53A9
If the C FLAG is set (a new file), JUMP to 53C8H: NEW and OVER do not apply.
53AB
LD BC,0000H 01 00 00
The destination exists: load Register Pair BC with the NEW value, the operand at 53ACH-53ADH (0000H in the file) that EVAL@ stored.
53AE
INC C 0C
INCrement Register C by 1, the first half of a test of Register C against 00H.
53AF
DEC C 0D
DECrement Register C by 1 back to its value: the NZ FLAG when NEW was given.
53B0
If the NZ FLAG is set (NEW), JUMP to 54F6H: a file that exists on the destination is passed over.
53B3
LD BC,0000H 01 00 00
Load Register Pair BC with the OVER value, the operand at 53B4H-53B5H (0000H in the file) that EVAL@ stored.
53B6
INC C 0C
INCrement Register C by 1, the first half of a test of Register C against 00H.
53B7
DEC C 0D
DECrement Register C by 1 back to its value: the Z FLAG when OVER was not given.
53B8
If the Z FLAG is set (no OVER), JUMP to 53C8H: the file is overwritten.
53BA
LD HL,58ADH 21 AD 58
OVER: point Register Pair HL to 58ADH, the copy of the destination's specification, whose NAME/EXT is shown.
53BD
LD DE,57EFH 11 EF 57
Point Register Pair DE to 57EFH, the question Overwrite ? on the same line.
53C0
GOSUB to 5725H to show the name and the question and take the answer: the Z FLAG for Y.
53C3
If the NZ FLAG is set (not Y), JUMP to 54F6H: the file is not overwritten.
53C6
JUMP to 53E0H: the name has been shown, so ECHO does not show it again.
53C8
LD DE,0000H 11 00 00
Load Register Pair DE with the ECHO value, the operand at 53C9H-53CAH (0000H in the file) that EVAL@ stored.
53CB
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
53CC
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when ECHO was not given.
53CD
If the Z FLAG is set (no ECHO), JUMP to 53E0H.
53CF
LD A,(5347H) 3A 47 53
Load Register A with the QUERY value from 5347H: QUERY has shown the name already.
53D2
OR A B7
OR Register A with itself, to set the NZ FLAG when QUERY was given.
53D3
If the NZ FLAG is set (QUERY), JUMP to 53E0H without showing the name again.
53D5
LD HL,58ADH 21 AD 58
ECHO: point Register Pair HL to 58ADH, the copy of the destination's specification.
53D8
GOSUB to 5740H to show its NAME/EXT, up to the period of a password or the colon of the drive.
53DB
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the name's line.
53DD
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (0DH).
53E0
LD HL,5845H 21 45 58
Point Register Pair HL to 5845H, the text Insert SYSTEM disk (ENTER).
53E3
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
53E6
LD A,32H 3E 32
Load Register A with 32H, a request for routine 2 of SYS4/SYS (XOR A and RET): WRITE@ needs SYS4/SYS to allocate granules.
53E8
GOSUB to 56D0H to have SYS0/SYS load SYS4/SYS now, while the system disk is in the drive.
53EB
LD HL,5825H 21 25 58
Point Register Pair HL to 5825H, the text Insert DESTINATION disk (ENTER).
53EE
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.

53F1H - The Destination's Size

Before any data is moved, the destination is positioned to the source's last sector and written once, so that it gets all its granules at the start (in one piece when the disk allows), then it is rewound. A source that is empty (end of file byte 00H, ending record 0) is not positioned.

53F1
LD A,(5873H) 3A 73 58
Load Register A with the source's end of file byte, +08H of its file control block at 5873H.
53F4
LD BC,(5877H) ED 4B 77 58
Load Register Pair BC with the source's ending record, +0CH-+0DH of its file control block at 5877H-5878H.
53F8
OR A B7
OR Register A with itself: the NZ FLAG when the end of file byte is not 00H, a last sector that is only partly used.
53F9
If the NZ FLAG is set (a partly used last sector), JUMP to 5400H: Register Pair BC is the number of that sector.
53FB
LD A,B 78
Load Register A with Register B, the high byte of the ending record.
53FC
OR C B1
OR Register A with Register C, the low byte: the Z FLAG when the ending record is 0, an empty file.
53FD
If the Z FLAG is set (an empty source), JUMP to 5412H without positioning the destination.
53FF
DEC BC 0B
DECrement Register Pair BC by 1: the last full sector, numbered from 0.
5400
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination's file control block.
5403
GOSUB to 4442H, POSN@, to position the destination to record Register Pair BC.
5406
GOSUB to 4439H, WRITE@, to write that record: the destination is extended to the source's size.
5409
If the NZ FLAG is set (the write failed), JUMP to 57E2H to post the error in Register A.
540C
GOSUB to 443FH, REW@, to rewind the destination at Register Pair DE to its first record.
540F
If the NZ FLAG is set (an error), JUMP to 57E2H to post the error in Register A.

5412H - The Data

The copy loop: as many sectors of the source as the buffer holds (from 5A00H up to the page below the top at 5863H) are read by READ@, each into the next page of the buffer, then written to the destination by WRITE@ from the same pages. The end of the source (error 1CH or 1DH from READ@) ends the loop after the last write.

5412
LD HL,580AH 21 0A 58
Point Register Pair HL to 580AH, the text Insert SOURCE disk (ENTER).
5415
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
5418
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the source's file control block.
541B
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the first page of the copy buffer.
541E
LD (586EH),HL 22 6E 58
Store Register Pair HL to 586EH-586FH, +03H of the source's file control block: its buffer is the next page.
5421
GOSUB to 4436H, READ@, to read the source's next sector into the page at Register Pair HL.
5424
If the Z FLAG is set (a sector was read), JUMP to 5431H.
5426
CP 1CH FE 1C
Compare Register A, the error code, against 1CH, Attempted to read past eof.
5428
If the Z FLAG is set (the end of the file), JUMP to 543AH with Register A = 1CH.
542A
CP 1DH FE 1D
Compare Register A, the error code, against 1DH, Attempted to read outside of file limits.
542C
If the Z FLAG is set (the end of the file), JUMP to 543AH with Register A = 1DH.
542E
JUMP to 57E2H to post the read error in Register A.
5431
LD A,(5864H) 3A 64 58
Load Register A with the high byte of the buffer's top from 5864H.
5434
DEC A 3D
DECrement Register A by 1: the last page of the buffer.
5435
INC H 24
INCrement Register H by 1, to the next page of the copy buffer.
5436
SUB H 94
SUBtract Register H from Register A: the NC FLAG while the next page is within the buffer.
5437
If the NC FLAG is set (a page is left), JUMP back to 541EH to read into it.
5439
XOR A AF
Set Register A to 00H by XORing it with itself: the buffer is full and the source has more.
543A
LD (5860H),A 32 60 58
Store Register A to 5860H, the end flag: 00H when the source has more, 1CH or 1DH at its end.
543D
LD (5861H),HL 22 61 58
Store Register Pair HL to 5861H-5862H: Register H is the page after the last one read.
5440
LD HL,5825H 21 25 58
Point Register Pair HL to 5825H, the text Insert DESTINATION disk (ENTER).
5443
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
5446
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination's file control block.
5449
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the first page of the copy buffer.
544C
LD (588FH),HL 22 8F 58
Store Register Pair HL to 588FH-5890H, +03H of the destination's file control block: its buffer is the page to write.
544F
GOSUB to 4439H, WRITE@, to write the page at Register Pair HL as the destination's next sector.
5452
If the NZ FLAG is set (the write failed), JUMP to 57E2H to post the error in Register A.
5455
LD A,(5862H) 3A 62 58
Load Register A with the high byte of the end of the data from 5862H.
5458
DEC A 3D
DECrement Register A by 1: the last page that was read.
5459
INC H 24
INCrement Register H by 1, to the next page of the copy buffer.
545A
CP H BC
Compare Register A against Register H: the NC FLAG while the next page was read.
545B
If the NC FLAG is set (a page is left), JUMP back to 544CH to write it.
545D
LD A,(5860H) 3A 60 58
Load Register A with the end flag from 5860H.
5460
OR A B7
OR Register A with itself: the Z FLAG when the source has more.
5461
If the Z FLAG is set (more to copy), JUMP back to 5412H to fill the buffer again.

5463H - Closing the Destination

The destination is closed with the source's end: its end of file byte and ending record are those of the source, since every sector was written whole. The source's entry is read back from the directory and kept at 58ADH; KILL kills the source, otherwise the source's modified flag (bit 6 of +01H) is cleared. Then the destination's entry gets the source's flag byte, logical record length and both password codes, with its own modified flag cleared: the copy keeps the source's protection, invisible and system attributes.

5463
LD HL,5845H 21 45 58
Point Register Pair HL to 5845H, the text Insert SYSTEM disk (ENTER).
5466
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
5469
LD A,22H 3E 22
Load Register A with 22H, a request for routine 2 of SYS3/SYS (XOR A and RET), which CLOSE@ needs resident.
546B
GOSUB to 56D0H to have SYS0/SYS load SYS3/SYS now, while the system disk is in the drive.
546E
LD HL,5825H 21 25 58
Point Register Pair HL to 5825H, the text Insert DESTINATION disk (ENTER).
5471
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
5474
LD A,(5873H) 3A 73 58
Load Register A with the source's end of file byte from 5873H, +08H of its file control block.
5477
LD HL,(5877H) 2A 77 58
Load Register Pair HL with the source's ending record from 5877H-5878H, +0CH-+0DH of its file control block.
547A
LD (5894H),A 32 94 58
Store Register A to 5894H, +08H of the destination's file control block: the same end of file byte.
547D
LD (5898H),HL 22 98 58
Store Register Pair HL to 5898H-5899H, +0CH-+0DH of the destination's file control block: the same ending record.
5480
LD BC,(5892H) ED 4B 92 58
Load Register Pair BC with +06H-+07H of the destination's file control block at 5892H-5893H: Register C the drive, Register B the logical file number.
5484
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination's file control block.
5487
GOSUB to 4428H, CLOSE@, to close the destination at Register Pair DE.
548A
If the NZ FLAG is set (an error), JUMP to 57E2H to post the error in Register A.
548D
LD HL,580AH 21 0A 58
Point Register Pair HL to 580AH, the text Insert SOURCE disk (ENTER).
5490
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
5493
PUSH BC C5
Save Register Pair BC, the destination's drive and logical file number, to the top of the stack.
5494
LD BC,(5871H) ED 4B 71 58
Load Register Pair BC with +06H-+07H of the source's file control block at 5871H-5872H: Register C the drive, Register B the logical file number.
5498
GOSUB to 490CH to read the directory sector of the entry of logical file number Register B on drive Register C to 4200H, with Register Pair HL at the entry.
549B
If the NZ FLAG is set (a read error), JUMP to 57E2H to post the error in Register A.
549E
PUSH HL E5
Save Register Pair HL, the source's entry, to the top of the stack.
549F
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX), to keep them for the write.
54A0
POP HL E1
Restore Register Pair HL (an alternate) with the source's entry from the top of the stack.
54A1
LD DE,58ADH 11 AD 58
Point Register Pair DE to 58ADH, where the source's entry is kept for the destination's.
54A4
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of a directory entry.
54A7
LDIR ED B0
Copy the source's entry from Register Pair HL to Register Pair DE (58ADH) by LDIR. Register Pair BC counts down.
54A9
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX): Register Pair HL is the source's entry again.
54AA
LD DE,0000H 11 00 00
Load Register Pair DE with the KILL value, the operand at 54ABH-54ACH (0000H in the file) that EVAL@ stored.
54AD
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
54AE
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when KILL was not given.
54AF
If the Z FLAG is set (no KILL), JUMP to 54BCH to clear the source's modified flag.
54B1
LD DE,586BH 11 6B 58
KILL: point Register Pair DE to 586BH, the source's file control block, still open.
54B4
GOSUB to 442CH, KILL@, to kill the source file at Register Pair DE.
54B7
If the NZ FLAG is set (an error), JUMP to 57E2H to post the error in Register A.
54BA
JUMP to 54C5H to give the destination's entry the source's attributes.
54BC
INC HL 23
INCrement Register Pair HL by 1, to +01H of the source's entry.
54BD
BIT 6,(HL) CB 76
Test bit 6 of +01H of the entry at Register Pair HL, the modified flag: the NZ FLAG when it is set.
54BF
RES 6,(HL) CB B6
Reset bit 6 of +01H of the entry at Register Pair HL; the flags of the BIT are kept.
54C1
DEC HL 2B
DECrement Register Pair HL by 1, back to the entry's flag byte.
54C2
If the NZ FLAG is set (the flag was set), GOSUB to 4915H to write the directory sector at 4200H back to the drive in Register C.
54C5
POP BC C1
Restore Register Pair BC with the destination's drive and logical file number from the top of the stack.
54C6
LD HL,5825H 21 25 58
Point Register Pair HL to 5825H, the text Insert DESTINATION disk (ENTER).
54C9
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
54CC
GOSUB to 490CH to read the directory sector of the destination's entry (logical file number Register B, drive Register C) to 4200H, Register Pair HL at the entry.
54CF
If the NZ FLAG is set (a read error), JUMP to 57E2H to post the error in Register A.
54D2
PUSH HL E5
Save Register Pair HL, the destination's entry, to the top of the stack.
54D3
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX), to keep them for the write.
54D4
POP DE D1
Restore Register Pair DE (an alternate) with the destination's entry from the top of the stack.
54D5
LD HL,58ADH 21 AD 58
Point Register Pair HL to 58ADH, the copy of the source's entry.
54D8
LDI ED A0
Copy the source's flag byte from Register Pair HL to the destination's at Register Pair DE (LDI): protection level, invisible and system bits. Register Pair BC counts down.
54DA
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = +01H of the destination's entry.
54DB
RES 6,(HL) CB B6
Reset bit 6 of +01H of the destination's entry at Register Pair HL: the copy is not marked as modified.
54DD
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, from +01H to +04H, the logical record length.
54E0
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: +04H of the destination's entry.
54E1
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = +04H of the destination's entry, Register Pair HL = +01H of the copy.
54E2
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: +04H of the source's entry at 58B1H.
54E3
LDI ED A0
Copy the logical record length from Register Pair HL to Register Pair DE (LDI); Register Pair BC goes down to 0002H.
54E5
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = +05H of the destination's entry.
54E6
LD C,0BH 0E 0B
Load Register C with 0BH, the 11 bytes of the name and extension, which stay as they are (Register B is 00H).
54E8
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: +10H of the destination's entry.
54E9
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = +10H of the destination's entry, Register Pair HL = +05H of the copy.
54EA
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: +10H of the source's entry at 58BDH.
54EB
LD C,04H 0E 04
Load Register C with 04H, the two password codes at +10H-+13H.
54ED
LDIR ED B0
Copy the two password codes from Register Pair HL to Register Pair DE by LDIR. Register Pair BC counts down.
54EF
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX): Register Pair BC is the destination's drive and logical file number again.
54F0
GOSUB to 4915H to write the directory sector at 4200H back to the drive in Register C.
54F3
If the NZ FLAG is set (a write error), JUMP to 57E2H to post the error in Register A.
54F6
LD HL,5845H 21 45 58
Point Register Pair HL to 5845H, the text Insert SYSTEM disk (ENTER): the end of a copy and of a file passed over.
54F9
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
54FC
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG.
54FD
RET C9
RETurn with Register A = 00H: to 5311H in a wildmask copy, or to CMNDI@'s caller through 49DDH.

54FEH - The Device Copy

COPY with a device as the source or the destination: the source is opened by OPEN@ (a device gets a control block of type 90H that points to its DCB), the destination by INIT@, and the characters are passed one by one through the ROM's 0013H and 001BH, which work for files and devices alike. LIST (5609H) and APPEND (5681H) use the same loop. The loop ends at the end of a source file (1CH), at an ETX (03H) or BREAK from a source device, and on BREAK from the keyboard unless the keyboard is the source itself. CTL (5554H) decides whether every character goes out as it is or only the printable ones.

54FE
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the source block's text, which OPEN@ makes the source's control block.
5501
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
5503
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the source's sector buffer.
5506
GOSUB to 4424H, OPEN@, to open the source file or device at Register Pair DE.
5509
If the NZ FLAG is set (it could not be opened), JUMP to 57E2H to post the error in Register A.
550C
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination block's text; LIST comes here with a destination given.
550F
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
5511
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the destination's sector buffer.
5514
GOSUB to 4420H, INIT@, to open or create the destination file, or open the device, at Register Pair DE.
5517
If the NZ FLAG is set (INIT@ failed), JUMP to 57E2H to post the error in Register A.

551AH - One Character

The loop of the device copy, LIST and APPEND.

551A
LD A,(586AH) 3A 6A 58
Load Register A with the flag byte of the source block at 586AH (bit 7 with bits 0-3 the device number).
551D
AND CFH E6 CF
AND Register A with CFH, every bit but bits 5 and 4: 80H is left only for device 0, the keyboard @KI.
551F
CP 80H FE 80
Compare Register A against 80H: the Z FLAG when the source is the keyboard.
5521
If the Z FLAG is set (the keyboard), JUMP to 5528H: its keys are the data, so BREAK and the SPACE BAR are not read here.
5523
GOSUB to 56D1H to scan the keyboard: the SPACE BAR pauses, BREAK gives the Z FLAG.
5526
If the Z FLAG is set (BREAK), JUMP to 5546H to close the destination and end.
5528
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the source's control block.
552B
GOSUB to 0013H, the ROM's input routine, to get a character from the file or device at Register Pair DE into Register A: the Z FLAG when it worked.
552E
PUSH AF F5
Save Register Pair AF, the character and its flags, to the top of the stack.
552F
LD A,(DE) 1A
Load Register A with the type byte of the source's control block at Register Pair DE.
5530
CP 90H FE 90
Compare Register A against 90H, the type of an open device: the Z FLAG for a device, NZ for a file.
5532
If the NZ FLAG is set (a file), JUMP to 553EH.
5534
POP AF F1
A device: restore Register Pair AF, the character, from the top of the stack.
5535
OR A B7
OR Register A with itself: the Z FLAG when the device had no character (00H).
5536
If the Z FLAG is set (nothing yet), JUMP back to 551AH to try again.
5538
CP 03H FE 03
Compare Register A against 03H, ETX (CONTROL-C at the keyboard), which ends a device copy.
553A
If the Z FLAG is set (ETX), JUMP to 5546H to close the destination and end.
553C
JUMP to 5553H to output the character in Register A.
553E
POP AF F1
A file: restore Register Pair AF, the character and the flags of 0013H, from the top of the stack.
553F
If the Z FLAG is set (a character was read), JUMP to 5553H to output it.
5541
CP 1CH FE 1C
Compare Register A, the error code, against 1CH, Attempted to read past eof: the end of the source file.
5543
If the NZ FLAG is set (another error), JUMP to 57E2H to post the error in Register A.
5546
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination's control block.
5549
LD A,(DE) 1A
Load Register A with the type byte of the destination's control block at Register Pair DE.
554A
CP 90H FE 90
Compare Register A against 90H: the Z FLAG when the destination is a device, which is not closed.
554C
If the NZ FLAG is set (a file), GOSUB to 4428H, CLOSE@, to close the destination at Register Pair DE.
554F
If the NZ FLAG is set (CLOSE@ failed), JUMP to 57E2H to post the error in Register A.
5552
RET C9
RETurn to SYS0/SYS's overlay request handler (49DDH), which returns to CMNDI@'s caller.
5553
LD DE,0000H 11 00 00
Load Register Pair DE with the CTL value, the operand at 5554H-5555H (0000H in the file): FFH for COPY and APPEND, LIST's parameter for LIST.
5556
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
5557
DEC E 1D
DECrement Register E by 1 back to its value: the NZ FLAG when every character goes out as it is.
5558
If the NZ FLAG is set (CTL), JUMP to 5568H to output the character unchanged.
555A
CP 80H FE 80
Compare Register A against 80H: the NC FLAG for a character 80H-FFH, graphics or space compression.
555C
If the NC FLAG is set (80H or more), JUMP to 5566H: it is listed as a period.
555E
CP 20H FE 20
Compare Register A against 20H: the NC FLAG for a printable character 20H-7FH.
5560
If the NC FLAG is set (printable), JUMP to 5568H to output it.
5562
CP 0DH FE 0D
Compare Register A against 0DH, the carriage return, the only control code LIST passes without CTL.
5564
If the Z FLAG is set (0DH), JUMP to 5568H to output it.
5566
LD A,2EH 3E 2E
Load Register A with 2EH, the period that stands for a control code or a character of 80H or more.
5568
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination's control block.
556B
GOSUB to 001BH, the ROM's output routine, to send the character in Register A to the file or device at Register Pair DE; its errors are not tested.
556E
JUMP back to 551AH for the next character of the source.

5570H - COPY's Evaluation Block

Data: the block that Index Register IX points to for EVAL@ (523BH): EVAL@'s flags, the addresses of the source, destination and wildmask blocks, and the parameter table. Each entry of the table is the name (6 characters), the address its value is stored to (here the operands of instructions of COPY) and a type byte: 20H a switch (the name alone gives FFFFH, =Y or =N and the like), 80H a string (the address of the quoted text is stored). The manual lists the same twelve parameters plus SYSTEM, which its text describes.

5570
DEFB 00H 00
The flags EVAL@ sets: bit 0 a source, bit 1 a destination, bit 2 a wildmask, bit 3 parameters.
5571-5572
DEFW 586AH 6A 58
The address of the source block, 586AH: the flag byte, then the field, a file, device or drive.
5573-5574
DEFW 588BH 8B 58
The address of the destination block, 588BH: the flag byte, then the field, a file, device or drive.
5575-5576
DEFW 58ACH AC 58
The address of the wildmask block, 58ACH: the flag byte, then the wildmask for WILD@ (529BH).
5577-5578
DEFW 5579H 79 55
The address of the parameter table at 5579H, the thirteen parameters of COPY.
5579-557E
DEFM "MOD " 4D 4F 44 20 20 20
The name of the first parameter, MOD: copy only the files whose modified flag is set (wildmask copy).
557F-5580
DEFW 52E5H E5 52
MOD's value goes to 52E5H-52E6H, the operand of LD DE,0000H at 52E4H.
5581
DEFB 20H 20
The type byte of MOD: 20H, bit 5, a switch, so the name alone sets it.
5582-5587
DEFM "QUERY " 51 55 45 52 59 20
The name of QUERY: ask Copy ? before each file.
5588-5589
DEFW 5347H 47 53
QUERY's value goes to 5347H-5348H, the operand of LD BC,0000H at 5346H.
558A
DEFB 20H 20
The type byte of QUERY: 20H, a switch, so the name alone sets it.
558B-5590
DEFM "KILL " 4B 49 4C 4C 20 20
The name of KILL: kill each source file once it is copied.
5591-5592
DEFW 54ABH AB 54
KILL's value goes to 54ABH-54ACH, the operand of LD DE,0000H at 54AAH.
5593
DEFB 20H 20
The type byte of KILL: 20H, a switch, so the name alone sets it.
5594-5599
DEFM "PROMPT" 50 52 4F 4D 50 54
The name of PROMPT: ask for the source, destination and system disks (a copy with one drive).
559A-559B
DEFW 5292H 92 52
PROMPT's value goes to 5292H-5293H, the operand of LD DE,0000H at 5291H, read by 56E2H.
559C
DEFB 20H 20
The type byte of PROMPT: 20H, a switch, so the name alone sets it.
559D-55A2
DEFM "SYSTEM" 53 59 53 54 45 4D
The name of SYSTEM: copy system files too (wildmask copy).
55A3-55A4
DEFW 52D1H D1 52
SYSTEM's value goes to 52D1H-52D2H, the operand of LD DE,0000H at 52D0H.
55A5
DEFB 20H 20
The type byte of SYSTEM: 20H, a switch, so the name alone sets it.
55A6-55AB
DEFM "INVIS " 49 4E 56 49 53 20
The name of INVIS: copy invisible files too (wildmask copy).
55AC-55AD
DEFW 52DEH DE 52
INVIS's value goes to 52DEH-52DFH, the operand of LD DE,0000H at 52DDH.
55AE
DEFB 20H 20
The type byte of INVIS: 20H, a switch, so the name alone sets it.
55AF-55B4
DEFM "OVER " 4F 56 45 52 20 20
The name of OVER: ask Overwrite ? before a file on the destination is overwritten.
55B5-55B6
DEFW 53B4H B4 53
OVER's value goes to 53B4H-53B5H, the operand of LD BC,0000H at 53B3H.
55B7
DEFB 20H 20
The type byte of OVER: 20H, a switch, so the name alone sets it.
55B8-55BD
DEFM "TINY " 54 49 4E 59 20 20
The name of TINY: copy through a buffer of one page at 5A00H.
55BE-55BF
DEFW 5261H 61 52
TINY's value goes to 5261H-5262H, the operand of LD DE,0000H at 5260H.
55C0
DEFB 20H 20
The type byte of TINY: 20H, a switch, so the name alone sets it.
55C1-55C6
DEFM "ECHO " 45 43 48 4F 20 20
The name of ECHO: show the name of each file as it is copied.
55C7-55C8
DEFW 53C9H C9 53
ECHO's value goes to 53C9H-53CAH, the operand of LD DE,0000H at 53C8H.
55C9
DEFB 20H 20
The type byte of ECHO: 20H, a switch, so the name alone sets it.
55CA-55CF
DEFM "OLD " 4F 4C 44 20 20 20
The name of OLD: copy only the files that the destination has already.
55D0-55D1
DEFW 5386H 86 53
OLD's value goes to 5386H-5387H, the operand of LD BC,0000H at 5385H.
55D2
DEFB 20H 20
The type byte of OLD: 20H, a switch, so the name alone sets it.
55D3-55D8
DEFM "NEW " 4E 45 57 20 20 20
The name of NEW: copy only the files that the destination does not have.
55D9-55DA
DEFW 53ACH AC 53
NEW's value goes to 53ACH-53ADH, the operand of LD BC,0000H at 53ABH.
55DB
DEFB 20H 20
The type byte of NEW: 20H, a switch, so the name alone sets it.
55DC-55E1
DEFM "SPW " 53 50 57 20 20 20
The name of SPW: the source disk's master password, used for each file of a wildmask copy.
55E2-55E3
DEFW 5300H 00 53
The address of SPW's text goes to 5300H-5301H, the operand of LD BC,0000H at 52FFH.
55E4
DEFB 80H 80
The type byte of SPW: 80H, bit 7, a string: the address of the quoted text is stored.
55E5-55EA
DEFM "DPW " 44 50 57 20 20 20
The name of DPW: the destination disk's master password, used for each file of a wildmask copy.
55EB-55EC
DEFW 5309H 09 53
The address of DPW's text goes to 5309H-530AH, the operand of LD BC,0000H at 5308H.
55ED
DEFB 80H 80
The type byte of DPW: 80H, bit 7, a string: the address of the quoted text is stored.
55EE
DEFB 00H 00
The end of the parameter table for EVAL@: a 00H in place of the next name.

55EFH - LIST

Routine 5, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. CTL and PROMPT are cleared (PROMPT is cleared so that the error exit at 57E2H does not ask for the system disk) and EVAL@ takes the command line with the block at 562FH: a source must be given (2FH). The source is opened; a destination makes LIST the device copy of COPY (550CH). Without one, the destination is the display: its control block at 588CH is made type 90H with the address of @DO's DCB from LOCDCB%, without INIT@.

55EF
XOR A AF
Set Register A to 00H by XORing it with itself, to clear the two switches below.
55F0
LD (5554H),A 32 54 55
Store Register A (00H) to 5554H, the low byte of the CTL value: the operand of LD DE,0000H at 5553H, which LIST's parameter CTL sets.
55F3
LD (5292H),A 32 92 52
Store Register A (00H) to 5292H, the low byte of the PROMPT value read by 56E2H, so that no disk is asked for.
55F6
LD IX,562FH DD 21 2F 56
Point Index Register IX to 562FH, the evaluation block of LIST: source 586AH, destination and wildmask both 588BH, parameters 5638H.
55FA
GOSUB to 4479H, EVAL@, to take the source and destination fields and the parameter CTL from the command line at Register Pair HL.
55FD
If the NZ FLAG is set (an error in the command line), JUMP to 57E2H to post the error in Register A.
5600
BIT 0,(IX+00H) DD CB 00 46
Test bit 0 of the evaluation block's flags at Index Register IX+00H: the NZ FLAG when a source field was given.
5604
LD A,2FH 3E 2F
Load Register A with 2FH, the error code I/o field not found; the load keeps the flags of the BIT.
5606
If the Z FLAG is set (no source), JUMP to 57E2H to post error 2FH in Register A.
5609
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the source block's text, which OPEN@ makes the source's control block.
560C
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
560E
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the source's sector buffer.
5611
GOSUB to 4424H, OPEN@, to open the source file or device at Register Pair DE.
5614
If the NZ FLAG is set (it could not be opened), JUMP to 57E2H to post the error in Register A.
5617
BIT 1,(IX+00H) DD CB 00 4E
Test bit 1 of the evaluation block's flags at Index Register IX+00H: the NZ FLAG when a destination field was given.
561B
If the NZ FLAG is set (a destination), JUMP to 550CH to open it by INIT@ and copy to it.
561E
LD A,01H 3E 01
Load Register A with 01H, the number of the display device @DO in the DCB table.
5620
GOSUB to 4488H, LOCDCB%, to load Register Pair DE with the address of the DCB of device Register A (01H, @DO).
5623
LD (588DH),DE ED 53 8D 58
Store Register Pair DE, @DO's DCB, to 588DH-588EH, +01H of the destination's control block.
5627
LD A,90H 3E 90
Load Register A with 90H, the type byte of an open device.
5629
LD (588CH),A 32 8C 58
Store Register A (90H) to 588CH, the destination's type: the ROM's 001BH then outputs through @DO's DCB.
562C
JUMP to 551AH, the loop of the device copy, with the display as the destination.

562FH - LIST's Evaluation Block

Data: the block that Index Register IX points to for EVAL@ (55F6H). The wildmask block is the destination block (588BH), so a field with a wildcard goes to the destination.

562F
DEFB 00H 00
The flags EVAL@ sets: bit 0 a source, bit 1 a destination, bit 2 a wildmask, bit 3 parameters.
5630-5631
DEFW 586AH 6A 58
The address of the source block, 586AH: the flag byte, then the file or device to list.
5632-5633
DEFW 588BH 8B 58
The address of the destination block, 588BH: the flag byte, then the file or device that takes the list.
5634-5635
DEFW 588BH 8B 58
The address of the wildmask block: 588BH again, the destination block.
5636-5637
DEFW 5638H 38 56
The address of the parameter table at 5638H, LIST's one parameter.
5638-563D
DEFM "CTL " 43 54 4C 20 20 20
The name of CTL: output control codes and characters of 80H or more as they are, not as periods.
563E-563F
DEFW 5554H 54 55
CTL's value goes to 5554H-5555H, the operand of LD DE,0000H at 5553H.
5640
DEFB 20H 20
The type byte of CTL: 20H, bit 5, a logical value, so the name alone sets it.
5641
DEFB 00H 00
The end of the parameter table for EVAL@: a 00H in place of the next name.

5642H - APPEND

Routine 4, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. CMD, PROMPT and STRIP are cleared, CTL is set to FFH (every character as it is), and EVAL@ takes the command line with the block at 56B4H: both fields must be given (2FH). The source is opened, and the destination is opened by OPEN@ with a logical record length of 1, so it must exist (an error 18H otherwise). A device destination takes the characters as a device copy. A file is positioned to its end by PEOF@; CMD then backs it up by four bytes, the transfer address record of a load module, and STRIP by one, an end of file mark; then the device copy loop appends the source.

5642
XOR A AF
Set Register A to 00H by XORing it with itself, to clear the switches below.
5643
LD (568BH),A 32 8B 56
Store Register A (00H) to 568BH, the low byte of the CMD value: the operand of LD HL,0000H at 568AH.
5646
LD (5292H),A 32 92 52
Store Register A (00H) to 5292H, the low byte of the PROMPT value read by 56E2H, so that no disk is asked for.
5649
LD (5694H),A 32 94 56
Store Register A (00H) to 5694H, the low byte of the STRIP value: the operand of LD HL,0000H at 5693H.
564C
DEC A 3D
DECrement Register A by 1 to FFH, the value of CTL that passes every character unchanged.
564D
LD (5554H),A 32 54 55
Store Register A (FFH) to 5554H, the low byte of the CTL value: the operand of LD DE,0000H at 5553H.
5650
LD IX,56B4H DD 21 B4 56
Point Index Register IX to 56B4H, the evaluation block of APPEND: source 586AH, destination and wildmask both 588BH, parameters 56BDH.
5654
GOSUB to 4479H, EVAL@, to take the source and destination fields and the parameters CMD and STRIP from the command line at Register Pair HL.
5657
If the NZ FLAG is set (an error in the command line), JUMP to 57E2H to post the error in Register A.
565A
LD A,(IX+00H) DD 7E 00
Load Register A with the evaluation block's flags at Index Register IX+00H: bit 0 a source field, bit 1 a destination field.
565D
CPL 2F
Invert every bit of Register A (CPL), so that bits 0 and 1 are set for the fields that are missing.
565E
AND 03H E6 03
AND Register A with 03H, bits 0 and 1: the NZ FLAG when the source or the destination field is missing.
5660
LD A,2FH 3E 2F
Load Register A with 2FH, the error code I/o field not found; the load keeps the flags of the AND.
5662
If the NZ FLAG is set (a field is missing), JUMP to 57E2H to post error 2FH in Register A.
5665
LD DE,586BH 11 6B 58
Point Register Pair DE to 586BH, the source block's text, which OPEN@ makes the source's control block.
5668
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
566A
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the source's sector buffer.
566D
GOSUB to 4424H, OPEN@, to open the source file or device at Register Pair DE.
5670
If the NZ FLAG is set (it could not be opened), JUMP to 57E2H to post the error in Register A.
5673
LD DE,588CH 11 8C 58
Point Register Pair DE to 588CH, the destination block's text, which OPEN@ makes the destination's control block.
5676
LD B,01H 06 01
Load Register B with 01H, a logical record length of 1, so that BKSP@ backs up one byte at a time.
5678
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the destination's sector buffer.
567B
GOSUB to 4424H, OPEN@, to open the destination at Register Pair DE: a file must exist already.
567E
If the NZ FLAG is set (it could not be opened), JUMP to 57E2H to post the error in Register A.
5681
LD A,(DE) 1A
Load Register A with the type byte of the destination's control block at Register Pair DE.
5682
CP 90H FE 90
Compare Register A against 90H: the Z FLAG when the destination is a device.
5684
If the Z FLAG is set (a device), JUMP to 551AH to copy the source to it.
5687
GOSUB to 4448H, PEOF@, to position the destination file at Register Pair DE to its end; the result is not tested.
568A
LD HL,0000H 21 00 00
Load Register Pair HL with the CMD value, the operand at 568BH-568CH (0000H in the file) that EVAL@ stored.
568D
INC L 2C
INCrement Register L by 1, the first half of a test of Register L against 00H.
568E
DEC L 2D
DECrement Register L by 1 back to its value: the NZ FLAG when CMD was given.
568F
LD C,04H 0E 04
Load Register C with 04H, the bytes CMD backs up over: the transfer address record 02H 02H and its address.
5691
If the NZ FLAG is set (CMD), JUMP to 569DH to back up four bytes.
5693
LD HL,0000H 21 00 00
Load Register Pair HL with the STRIP value, the operand at 5694H-5695H (0000H in the file) that EVAL@ stored.
5696
INC L 2C
INCrement Register L by 1, the first half of a test of Register L against 00H.
5697
DEC L 2D
DECrement Register L by 1 back to its value: the Z FLAG when STRIP was not given.
5698
LD C,01H 0E 01
Load Register C with 01H, the one byte STRIP backs up over, an end of file mark.
569A
If the Z FLAG is set (neither CMD nor STRIP), JUMP to 551AH to append the source at the end.
569D
LD A,(5894H) 3A 94 58
Load Register A with the destination's end of file byte, +08H of its control block at 5894H.
56A0
LD HL,(5898H) 2A 98 58
Load Register Pair HL with the destination's ending record, +0CH-+0DH of its control block at 5898H-5899H.
56A3
OR H B4
OR Register A with Register H, the high byte of the ending record.
56A4
OR L B5
OR Register A with Register L, the low byte: the Z FLAG when the file is empty (the test does not count the bytes backed up).
56A5
If the Z FLAG is set (an empty file), JUMP to 551AH: there is nothing to back up over.
56A8
GOSUB to 4445H, BKSP@, to back the destination at Register Pair DE up by one record, one byte.
56AB
If the NZ FLAG is set (an error), JUMP to 57E2H to post the error in Register A.
56AE
DEC C 0D
DECrement Register C by 1, the count of bytes left to back up.
56AF
If the NZ FLAG is set (bytes are left), JUMP back to 569DH for the next one.
56B1
JUMP to 551AH to append the source from that place.

56B4H - APPEND's Evaluation Block

Data: the block that Index Register IX points to for EVAL@ (5650H). As for LIST, the wildmask block is the destination block.

56B4
DEFB 00H 00
The flags EVAL@ sets: bit 0 a source, bit 1 a destination, bit 2 a wildmask, bit 3 parameters.
56B5-56B6
DEFW 586AH 6A 58
The address of the source block, 586AH: the flag byte, then the file or device to append.
56B7-56B8
DEFW 588BH 8B 58
The address of the destination block, 588BH: the flag byte, then the file or device appended to.
56B9-56BA
DEFW 588BH 8B 58
The address of the wildmask block: 588BH again, the destination block.
56BB-56BC
DEFW 56BDH BD 56
The address of the parameter table at 56BDH, APPEND's two parameters.
56BD-56C2
DEFM "CMD " 43 4D 44 20 20 20
The name of CMD: append a load module, backing up over the destination's transfer address record.
56C3-56C4
DEFW 568BH 8B 56
CMD's value goes to 568BH-568CH, the operand of LD HL,0000H at 568AH.
56C5
DEFB 20H 20
The type byte of CMD: 20H, bit 5, a logical value, so the name alone sets it.
56C6-56CB
DEFM "STRIP " 53 54 52 49 50 20
The name of STRIP: back up over one byte, an end of file mark, before appending.
56CC-56CD
DEFW 5694H 94 56
STRIP's value goes to 5694H-5695H, the operand of LD HL,0000H at 5693H.
56CE
DEFB 20H 20
The type byte of STRIP: 20H, bit 5, a logical value, so the name alone sets it.
56CF
DEFB 00H 00
The end of the parameter table for EVAL@: a 00H in place of the next name.

56D0H - Load a Low Overlay

Entered by a GOSUB with a request code in Register A (12H, 22H, 32H: routine 2 of SYS2/SYS, SYS3/SYS, SYS4/SYS, which is XOR A and RET). The overlay request handler drops the return address of the RST 28H, loads the overlay unless it is resident, and its routine 2 returns straight to the caller: the overlay is in memory before a prompt asks for another diskette.

56D0
RST 28H EF
RESTART to 28H, the overlay request handler, with the request code in Register A; it returns to the caller of 56D0H, not to 56D1H.

56D1H - The Keyboard

Returns the NZ FLAG at once while a DO file runs (bit 5 of SFLAG1$). Otherwise the keyboard is scanned once: the SPACE BAR waits for the next key, and the Z FLAG is returned when the key is BREAK (01H).

56D1
LD A,(4302H) 3A 02 43
Load Register A with SFLAG1$ from 4302H, whose bit 5 is set while a DO file runs.
56D4
AND 20H E6 20
AND Register A with 20H, bit 5: the NZ FLAG while a DO file runs.
56D6
RET NZ C0
If the NZ FLAG is set (a DO file runs), RETurn with the NZ FLAG: the keyboard is not read.
56D7
GOSUB to 002BH, the ROM's keyboard scan, which returns the key pressed in Register A, or 00H.
56DA
CP 20H FE 20
Compare Register A against 20H, the SPACE BAR.
56DC
If the Z FLAG is set (the SPACE BAR), GOSUB to 0049H, the ROM's routine that waits for a key and returns it in Register A.
56DF
CP 01H FE 01
Compare Register A against 01H, the BREAK key: the Z FLAG for BREAK.
56E1
RET C9
RETurn to the caller with the Z FLAG when the key was BREAK.

56E2H - The Prompt

With PROMPT given and no DO file running: the text at Register Pair HL, ended by 03H, is shown on the line of the cursor, flashing (on and off every 500 scans of the keyboard), until a key is pressed; the line is then cleared. The registers are kept by SYS0/SYS's wrapper (4525H). 5724H holds 1EH while the text is off.

56E2
LD A,(5292H) 3A 92 52
Load Register A with the PROMPT value from 5292H.
56E5
OR A B7
OR Register A with itself, to set the Z FLAG when PROMPT was not given.
56E6
RET Z C8
If the Z FLAG is set (no PROMPT), RETurn: no disk is asked for.
56E7
LD A,(4302H) 3A 02 43
Load Register A with SFLAG1$ from 4302H, whose bit 5 is set while a DO file runs.
56EA
AND 20H E6 20
AND Register A with 20H, bit 5: the NZ FLAG while a DO file runs.
56EC
RET NZ C0
If the NZ FLAG is set (a DO file runs), RETurn without waiting for a key.
56ED
GOSUB to 4525H, SYS0/SYS's wrapper, which saves the registers, runs the code after this CALL as a subroutine and restores them when it returns.
56F0
LD BC,01F4H 01 F4 01
Load Register Pair BC with 01F4H, the 500 scans of the keyboard that the text stays on or off.
56F3
PUSH HL E5
Save Register Pair HL, the text, to the top of the stack.
56F4
LD A,(5724H) 3A 24 57
Load Register A with the flash state from 5724H: 1EH while the text is off.
56F7
XOR 1EH EE 1E
XOR Register A with 1EH: the Z FLAG when the text is off, else Register A becomes 1EH.
56F9
PUSH AF F5
Save Register Pair AF, the new state and its flag, to the top of the stack.
56FA
If the Z FLAG is set (the text was off), GOSUB to 5712H to clear the line; it also stores 1EH to 5724H.
56FD
POP AF F1
Restore Register Pair AF, the new state, from the top of the stack.
56FE
LD (5724H),A 32 24 57
Store Register A to the flash state at 5724H: 00H when the text is to be shown next, 1EH while it is shown.
5701
If the NZ FLAG is set (the text is due), GOSUB to 5740H to show the text at Register Pair HL.
5704
POP HL E1
Restore Register Pair HL, the text, from the top of the stack.
5705
GOSUB to 002BH, the ROM's keyboard scan, which returns the key pressed in Register A, or 00H.
5708
OR A B7
OR Register A with itself, to set the NZ FLAG when a key was pressed.
5709
If the NZ FLAG is set (a key), JUMP to 5712H to clear the line and return.
570B
DEC BC 0B
DECrement Register Pair BC by 1, the scans left before the text flashes.
570C
LD A,B 78
Load Register A with Register B, the high byte of the count.
570D
OR C B1
OR Register A with Register C, the low byte: the Z FLAG when the count is 0.
570E
If the NZ FLAG is set (scans are left), JUMP back to 5705H to scan again.
5710
JUMP back to 56F0H to switch the text on or off.

5712H - Clear the Line

Moves the cursor to the start of its line (carriage return, then up a line) and clears to the end of the line; the flash state at 5724H becomes 1EH, off.

5712
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return, which moves the cursor to the start of the next line.
5714
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (0DH).
5717
LD A,1BH 3E 1B
Load Register A with 1BH, the code that moves the cursor up one line, back to the line of the text.
5719
GOSUB to 0033H, the ROM's display routine, to send the code in Register A (1BH).
571C
LD A,1EH 3E 1E
Load Register A with 1EH, the code that clears to the end of the line, which is also the off state of the flash.
571E
LD (5724H),A 32 24 57
Store Register A (1EH) to the flash state at 5724H: the text is off.
5721
JUMP to 0033H, the ROM's display routine, to send the code in Register A (1EH); its RETurn goes to the caller.
5724
DEFB 1EH 1E
The flash state of the prompt: 1EH while the text is off (so the first pass clears the line), 00H while it is on.

5725H - The Question

Shows the name at Register Pair HL (up to its period or colon) and the question at Register Pair DE (Copy ? or Overwrite ? at column 16 of the same line), and takes an answer of one character by KEYIN@. Returns the Z FLAG when the answer is Y (or y); ENTER alone is no. BREAK ends COPY with error 30H.

5725
PUSH DE D5
Save Register Pair DE, the question, to the top of the stack.
5726
GOSUB to 5740H to show the name at Register Pair HL, up to its period, colon or 03H.
5729
POP HL E1
Restore Register Pair HL with the question from the top of the stack.
572A
GOSUB to 5740H to show the question at Register Pair HL: 0DH, sixteen spaces (D0H), up a line (1BH), then the text.
572D
LD B,01H 06 01
Load Register B with 01H, the most characters KEYIN@ is to take.
572F
LD HL,5867H 21 67 58
Point Register Pair HL to 5867H, the buffer for the answer.
5732
GOSUB to 0040H, the ROM's line input (KEYIN@), to take up to Register B (01H) characters into the buffer at Register Pair HL: the C FLAG for BREAK.
5735
LD A,30H 3E 30
Load Register A with 30H, the error code Terminated; the load keeps the flags of KEYIN@.
5737
If the C FLAG is set (BREAK), JUMP to 57E2H to post error 30H in Register A.
573A
LD A,(HL) 7E
Load Register A with the answer from the buffer at Register Pair HL (5867H), 0DH when ENTER alone was pressed.
573B
RES 5,A CB AF
Reset bit 5 of Register A, which makes a lower case letter upper case.
573D
SUB 59H D6 59
SUBtract 59H, the letter Y, from Register A: the Z FLAG when the answer is Y.
573F
RET C9
RETurn to the caller with the Z FLAG when the answer was Y.

5740H - Show a Text

Shows the characters at Register Pair HL through the ROM's 0033H, up to a 03H, a period or a colon, which is not shown. Register Pair HL ends after it.

5740
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
5741
INC HL 23
INCrement Register Pair HL by 1, past the character.
5742
CP 03H FE 03
Compare Register A against 03H, the end of a text.
5744
RET Z C8
If the Z FLAG is set (03H, the end of the text), RETurn.
5745
CP 2EH FE 2E
Compare Register A against 2EH, the period that starts the password of a specification.
5747
RET Z C8
If the Z FLAG is set (a period), RETurn: the password is not shown.
5748
CP 3AH FE 3A
Compare Register A against 3AH, the colon that starts the drive of a specification.
574A
RET Z C8
If the Z FLAG is set (a colon), RETurn: the drive is not shown.
574B
GOSUB to 0033H, the ROM's display routine, to show the character in Register A.
574E
JUMP back to 5740H for the next character of the text.

5750H - Set the Wildmask

When the command had a wildmask (bit 2 of the flags at Index Register IX+00H), WILD@ with Register B = 01H sets its mask from the text at 58ADH.

5750
BIT 2,(IX+00H) DD CB 00 56
Test bit 2 of the evaluation block's flags at Index Register IX+00H: the NZ FLAG when a wildmask was given.
5754
RET Z C8
If the Z FLAG is set (no wildmask), RETurn: every name will match.
5755
LD B,01H 06 01
Load Register B with 01H: WILD@ with Register B not zero sets the mask.
5757
LD HL,58ADH 21 AD 58
Point Register Pair HL to 58ADH, the text of the wildmask block.
575A
GOSUB to 447CH, WILD@, to set its mask from the wildmask at Register Pair HL.
575D
RET C9
RETurn to the caller, with the mask set for the compares at 575EH.

575EH - Match the Wildmask

Returns the Z FLAG when no wildmask was given, else WILD@'s compare of the 11 bytes of a directory entry's name and extension at Register Pair HL: the Z FLAG when they match.

575E
BIT 2,(IX+00H) DD CB 00 56
Test bit 2 of the evaluation block's flags at Index Register IX+00H: the NZ FLAG when a wildmask was given.
5762
RET Z C8
If the Z FLAG is set (no wildmask), RETurn with the Z FLAG: the name matches.
5763
LD B,00H 06 00
Load Register B with 00H: WILD@ with Register B = 00H compares a name with its mask.
5765
GOSUB to 447CH, WILD@, to compare the 11 bytes at Register Pair HL with the mask: the Z FLAG when they match.
5768
RET C9
RETurn to the caller with the flags of WILD@: the Z FLAG for a match.

5769H - Build a Specification

From the 11 bytes of a directory entry's name and extension at Register Pair HL, builds NAME/EXT.PASSWORD:D at Register Pair DE, ended by 03H: trailing spaces are dropped, the extension and its slash only when there is one, the password (Register Pair BC, the address of a quoted string, 0000H for none) up to 8 characters ending at a control code or a quotation mark, and the drive from the flag byte in front of Register Pair DE. Register Pairs BC, DE and HL are kept.

5769
PUSH HL E5
Save Register Pair HL, the name, to the top of the stack.
576A
PUSH DE D5
Save Register Pair DE, the text of the block, to the top of the stack.
576B
PUSH BC C5
Save Register Pair BC, the password's address, to the top of the stack.
576C
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the eight characters of the name.
576F
LD A,(HL) 7E
Load Register A with the next character of the name at Register Pair HL.
5770
CP 20H FE 20
Compare Register A against 20H, the space that pads the name.
5772
If the Z FLAG is set (a space), JUMP to 5779H: the name ends.
5774
LDI ED A0
Copy the character at Register Pair HL to Register Pair DE (LDI), INCrementing both and DECrementing Register Pair BC.
5776
If the PE FLAG is set (Register Pair BC is not 0), JUMP back to 576FH for the next character of the name.
5779
ADD HL,BC 09
ADD Register Pair BC, the characters of the name not used, to Register Pair HL: the extension at +08H of the name.
577A
LD A,(HL) 7E
Load Register A with the first character of the extension at Register Pair HL.
577B
CP 20H FE 20
Compare Register A against 20H: the Z FLAG when the file has no extension.
577D
If the Z FLAG is set (no extension), JUMP to 578FH for the password.
577F
LD A,2FH 3E 2F
Load Register A with 2FH, the slash in front of the extension.
5781
LD (DE),A 12
Store Register A (2FH, the slash) at Register Pair DE in the specification.
5782
INC DE 13
INCrement Register Pair DE by 1, past the slash.
5783
LD C,03H 0E 03
Load Register C with 03H, the three characters of the extension (Register B is 00H).
5785
LD A,(HL) 7E
Load Register A with the next character of the extension at Register Pair HL.
5786
CP 20H FE 20
Compare Register A against 20H, the space that pads the extension.
5788
If the Z FLAG is set (a space), JUMP to 578FH: the extension ends.
578A
LDI ED A0
Copy the character at Register Pair HL to Register Pair DE (LDI), INCrementing both and DECrementing Register Pair BC.
578C
If the PE FLAG is set (Register Pair BC is not 0), JUMP back to 5785H for the next character of the extension.
578F
POP HL E1
Restore Register Pair HL with the password's address (Register Pair BC on entry) from the top of the stack.
5790
LD A,H 7C
Load Register A with Register H, the high byte of the address.
5791
OR L B5
OR Register A with Register L, the low byte: the Z FLAG when no password was given.
5792
If the Z FLAG is set (no password), JUMP to 57B2H for the drive.
5794
LD A,2EH 3E 2E
Load Register A with 2EH, the period in front of the password.
5796
LD (DE),A 12
Store Register A (2EH, the period) at Register Pair DE in the specification.
5797
INC DE 13
INCrement Register Pair DE by 1, past the period.
5798
LD C,08H 0E 08
Load Register C with 08H, the eight characters of a password (Register B is 00H).
579A
LD A,(HL) 7E
Load Register A with the next character of the password at Register Pair HL.
579B
CP 20H FE 20
Compare Register A against 20H: the C FLAG for a control code, which ends the password.
579D
If the C FLAG is set (a control code), JUMP to 57ACH.
579F
CP 27H FE 27
Compare Register A against 27H, the single quotation mark.
57A1
If the Z FLAG is set (the closing quotation mark), JUMP to 57ACH.
57A3
CP 22H FE 22
Compare Register A against 22H, the double quotation mark.
57A5
If the Z FLAG is set (the closing quotation mark), JUMP to 57ACH.
57A7
LDI ED A0
Copy the character at Register Pair HL to Register Pair DE (LDI), INCrementing both and DECrementing Register Pair BC.
57A9
If the PE FLAG is set (Register Pair BC is not 0), JUMP back to 579AH for the next character of the password.
57AC
LD A,C 79
Load Register A with Register C, the characters of the password not used.
57AD
CP 08H FE 08
Compare Register A against 08H: the Z FLAG when the password was empty.
57AF
If the NZ FLAG is set (a password was copied), JUMP to 57B2H.
57B1
DEC DE 1B
DECrement Register Pair DE by 1, to drop the period of an empty password.
57B2
POP HL E1
Restore Register Pair HL with the text of the block (Register Pair DE on entry) from the top of the stack.
57B3
DEC HL 2B
DECrement Register Pair HL by 1, to the block's flag byte in front of its text.
57B4
LD A,(HL) 7E
Load Register A with the block's flag byte at Register Pair HL, the drive in bits 0-2 with bit 7.
57B5
GOSUB to 57BAH to add :D and 03H at Register Pair DE.
57B8
POP HL E1
Restore Register Pair HL, the name, from the top of the stack.
57B9
RET C9
RETurn to the caller with the specification built at Register Pair DE.

57BAH - Add the Drive

With bit 7 of Register A set, adds a colon and the drive's name (one or two characters from DCTTBL, the drive in bits 0-2) at Register Pair DE; then 03H ends the text. Register Pairs BC and HL are kept; Register A returns 00H with the Z FLAG.

57BA
PUSH BC C5
Save Register Pair BC to the top of the stack.
57BB
PUSH HL E5
Save Register Pair HL to the top of the stack.
57BC
OR A B7
OR Register A with itself, to set the S FLAG from bit 7, the drive flag.
57BD
If the P FLAG is set (bit 7 clear, no drive), JUMP to 57DBH to end the text.
57C0
LD HL,43ABH 21 AB 43
Point Register Pair HL to 43ABH, DCTTBL, eight entries of 4 bytes: the DCT's address and the drive's two character name.
57C3
AND 07H E6 07
AND Register A with 07H, bits 0-2: the drive number.
57C5
ADD A,A 87
ADD Register A to Register A: the drive number times 2.
57C6
ADD A,A 87
ADD Register A to Register A: the drive number times 4, the offset of its entry in DCTTBL.
57C7
ADD A,02H C6 02
ADD 02H to Register A, the offset of the name in the entry.
57C9
ADD A,L 85
ADD Register L to Register A: the low byte of the name's address.
57CA
LD L,A 6F
Load Register L with Register A, the low byte of the name's address in Register Pair HL.
57CB
If the NC FLAG is set (no carry), JUMP to 57CEH.
57CD
INC H 24
INCrement Register H by 1, for the carry into the high byte.
57CE
LD A,3AH 3E 3A
Load Register A with 3AH, the colon in front of the drive.
57D0
LD (DE),A 12
Store Register A (3AH, the colon) at Register Pair DE in the specification.
57D1
INC DE 13
INCrement Register Pair DE by 1, past the colon.
57D2
LDI ED A0
Copy the first character of the drive's name at Register Pair HL to Register Pair DE (LDI), INCrementing both. Register Pair BC counts down.
57D4
LD A,(HL) 7E
Load Register A with the second character of the drive's name at Register Pair HL.
57D5
CP 20H FE 20
Compare Register A against 20H: the Z FLAG when the name has one character.
57D7
If the Z FLAG is set (a space), JUMP to 57DBH.
57D9
LDI ED A0
Copy the second character of the drive's name at Register Pair HL to Register Pair DE (LDI), INCrementing both. Register Pair BC counts down.
57DB
LD A,03H 3E 03
Load Register A with 03H, the byte that ends the text of a specification.
57DD
LD (DE),A 12
Store Register A (03H) at Register Pair DE, after the specification.
57DE
POP HL E1
Restore Register Pair HL from the top of the stack.
57DF
POP BC C1
Restore Register Pair BC from the top of the stack.
57E0
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG.
57E1
RET C9
RETurn to the caller with Register A = 00H and the Z FLAG set.

57E2H - The Error Exit

Every error of COPY, APPEND and LIST: with PROMPT, the system disk is asked for, then the error in Register A is posted by ERROR@ with bit 6 set (no frame) and bit 7 clear, so ERROR@ ends with ABORT@.

57E2
PUSH AF F5
Save Register Pair AF, the error code, to the top of the stack.
57E3
LD HL,5845H 21 45 58
Point Register Pair HL to 5845H, the text Insert SYSTEM disk (ENTER).
57E6
GOSUB to 56E2H to show the text at Register Pair HL and wait for a key when PROMPT was given.
57E9
POP AF F1
Restore Register Pair AF, the error code, from the top of the stack.
57EA
OR 40H F6 40
OR Register A with 40H, bit 6, so that ERROR@ shows the message without its frame.
57EC
JUMP to 4409H, ERROR@, to show the message of the error in Register A and end through ABORT@.

57EFH - The Texts

Data: the two questions and the three prompts, each ended by 03H. A question starts with a carriage return, sixteen spaces (D0H, the ROM's space compression code) and a move up a line, so that it stands at column 16 of the name's line.

57EF-57F1
DEFB 0DH,D0H,1BH 0D D0 1B
The start of OVER's question: carriage return, 16 spaces (D0H), cursor up a line (1BH).
57F2-57FD
DEFM "Overwrite ? " 4F 76 65 72 77 72 69 74 65 20 3F 20
The question of OVER (53BDH), shown by 5725H after the destination's name.
57FE
DEFB 03H 03
The byte that ends the question Overwrite ? for 5740H.
57FF-5801
DEFB 0DH,D0H,1BH 0D D0 1B
The start of QUERY's question: carriage return, 16 spaces (D0H), cursor up a line (1BH).
5802-5808
DEFM "Copy ? " 43 6F 70 79 20 3F 20
The question of QUERY (5350H), shown by 5725H after the source's name.
5809
DEFB 03H 03
The byte that ends the question Copy ? for 5740H.
580A-5823
DEFM "Insert SOURCE disk (ENTER)" 49 6E 73 65 72 74 20 53 4F 55 52 43 45 20 64 69 73 6B 20 28 45 4E 54 45 52 29
The prompt for the source diskette, shown by 56E2H when PROMPT was given.
5824
DEFB 03H 03
The byte that ends the prompt Insert SOURCE disk for 5740H.
5825-5843
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 28 45 4E 54 45 52 29
The prompt for the destination diskette, shown by 56E2H when PROMPT was given.
5844
DEFB 03H 03
The end of the prompt Insert DESTINATION disk.
5845-585E
DEFM "Insert SYSTEM disk (ENTER)" 49 6E 73 65 72 74 20 53 59 53 54 45 4D 20 64 69 73 6B 20 28 45 4E 54 45 52 29
The prompt for the system diskette, shown by 56E2H when PROMPT was given and by the error exit (57E3H).
585F
DEFB 03H 03
The end of the prompt Insert SYSTEM disk, the last byte of the file.

5860H - The Work Area

Not in the file: SYS10/SYS uses the memory after its last byte (585FH) for the copy's pointers, the answer buffer, the three blocks of EVAL@, the sector buffer at 5900H and the copy buffer from 5A00H to the top of memory.

5860
DEFS 1
The end flag of the copy loop (543AH): 00H while the source has more, 1CH or 1DH at its end (545DH).
5861-5862
DEFS 2
The end of the data read into the buffer (543DH): 5862H holds the page after the last one read (5455H).
5863-5864
DEFS 2
The top of the copy buffer: HMEM$ (5253H), or 5B00H with TINY (5267H); 5864H is read by 5431H.
5865-5866
DEFS 2
Two bytes of the work area that no instruction of SYS10/SYS uses.
5867-5868
DEFS 2
The answer to Copy ? or Overwrite ?, taken by KEYIN@ (572FH), and the 0DH after it.
5869
DEFS 1
A byte of the work area that no instruction of SYS10/SYS uses.
586A
DEFS 1
The flag byte of the source block of EVAL@ (526BH): bit 7 a device or drive, bit 6 a name, bit 3 a drive, bits 0-3 the number.
586B-588A
DEFS 32
The source's text, which OPEN@ makes its file control block (+03H the buffer 586EH, +06H the drive 5871H, +08H the end of file byte 5873H, +0CH the ending record 5877H).
588B
DEFS 1
The flag byte of the destination block of EVAL@ (5275H).
588C-58AB
DEFS 32
The destination's text, which OPEN@ or INIT@ makes its control block (+03H 588FH, +06H 5892H, +08H 5894H, +0CH 5898H), or type 90H with @DO's DCB for LIST (5623H).
58AC
DEFS 1
The flag byte of the wildmask block of EVAL@.
58AD-58CC
DEFS 32
The wildmask's text (529BH), then a copy of the destination's specification (5382H), then a copy of the source's directory entry (54A7H).
5900-59FF
DEFS 256
The sector buffer of a directory sector (52B3H) in a wildmask copy, and of the source of a device copy, LIST and APPEND.
5A00-5AFF
DEFS 256
The first page of the copy buffer, which runs on to the top of memory (5863H), a page a sector; also the destination's sector buffer of a device copy and APPEND.