5200H - The Routine Table
Data: SYS11/SYS's table of routines 2-7, one word each, used by SYS0/SYS's overlay request handler (its 49D3H-49E6H) for the request codes A2H-A7H. CMNDI@ takes the codes of the library commands from SYS1/SYS's table: FORCE A3H (51CBH), RESET A4H (51D7H), ASSIGN A5H (51B7H), JOIN A6H (51CFH), FILTER A7H (51CAH). No file of the diskette requests A2H. The words for FORCE and JOIN point three bytes apart, into the same instruction (5210H).
5200-5201
DEFW 520CH 0C 52
Routine 2: 520CH, XOR A and RET, which SYS0/SYS's record locator requests when it loads SYS11/SYS back (its 4D5FH-4D6CH).
5202-5203
DEFW 520EH 0E 52
Routine 3: 520EH, FORCE, which loads Register A with 90H, the FORCE bits of a device's type byte.
5204-5205
DEFW 5375H 75 53
Routine 4: 5375H, RESET: the FORCE, JOIN and NIL settings of one device, or of devices 0-5, undone.
5206-5207
DEFW 539FH 9F 53
Routine 5: 539FH, ASSIGN: a driver program for a device or drive, or the driver of another one.
5208-5209
DEFW 5211H 11 52
Routine 6: 5211H, JOIN, the operand bytes of LD BC,A03EH at 5210H, which read as LD A,A0H when entered there.
520A-520B
DEFW 5426H 26 54
Routine 7: 5426H, FILTER: a table of character translations for a device, loaded from a file.
520CH - Routine 2
Nothing to do when SYS0/SYS's record locator brings SYS11/SYS back.
520C
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.
520D
RET C9
RETurn to SYS0/SYS's overlay request handler (49E7H) with Register A = 00H.
520EH - FORCE and JOIN
Routines 3 (FORCE, 520EH) and 6 (JOIN, 5211H), entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. FORCE loads Register A with 90H and JOIN, entering inside the LD BC,A03EH, with A0H: the bits given to the device's type byte (bit 7 with bit 4 FORCE or bit 5 JOIN) go to 5359H, the operand of OR 00H at 5358H. EVAL@ then takes the command line with the block at 5730H. With no field at all, the six devices are listed with their settings (5228H); otherwise the device is routed (52F2H).
520E
LD A,90H 3E 90
Load Register A with 90H, the type bits of a FORCEd device: bit 7 and bit 4.
5210
LD BC,A03EH 01 3E A0
JOIN enters at 5211H inside this LD BC,A03EH: its bytes 3EH A0H read as LD A,A0H, the type bits of a JOINed device (bit 7 and bit 5); for FORCE the instruction only loads Register Pair BC.
5213
LD (5359H),A 32 59 53
Store Register A (90H for FORCE, A0H for JOIN) to 5359H, the operand of OR 00H at 5358H that sets the device's type byte.
5216
LD IX,5730H DD 21 30 57
Point Index Register IX to 5730H, the evaluation block of FORCE and JOIN: source 577AH, destination and wildmask 579BH, no parameters (5742H).
521A
GOSUB to 4479H, EVAL@, to take the source and destination fields from the command line at Register Pair HL.
521D
If the NZ FLAG is set (an error in the command line), JUMP to 5719H to post the error in Register A.
5220
LD A,(IX+00H) DD 7E 00
Load Register A with the evaluation block's flags at Index Register IX+00H: bits 0-2 a source, a destination, a wildmask field.
5223
AND 07H E6 07
AND Register A with 07H, bits 0-2: the NZ FLAG when any field was given.
5225
If the NZ FLAG is set (a field), JUMP to 52F2H to route the device.
5228H - The Device List
FORCE or JOIN alone lists the six character devices, one line each: $nn, the device's number in two decimal digits, @ and its name, the directions it can do (< input, - , > output), then FORCE and the device or file it is routed to, NIL, or the address of its driver; a JOINed device adds JOIN and the device or file it is linked to.
5228
LD IY,44A6H FD 21 A6 44
Point Index Register IY to 44A6H, the DCB table: six entries of 11 bytes, one for each character device.
522C
LD B,00H 06 00
Load Register B with 00H, the number of the first device, @KI.
522E
LD A,24H 3E 24
Load Register A with 24H, the dollar sign that starts each line of the list.
5230
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (24H).
5233
LD A,B 78
Load Register A with Register B, the number of the device.
5234
GOSUB to 55D1H to show the number in Register A as two decimal digits.
5237
GOSUB to 56D9H to show a space after the device number.
523A
GOSUB to 56C8H to show @, the device's two character name from the entry at Index Register IY, and a space.
523D
GOSUB to 524CH to show the device's directions and its driver, FORCE, NIL or JOIN.
5240
LD DE,000BH 11 0B 00
Load Register Pair DE with 000BH, the length of an entry of the DCB table.
5243
ADD IY,DE FD 19
ADD Register Pair DE (000BH) to Index Register IY: the next device's entry.
5245
LD A,05H 3E 05
Load Register A with 05H, the number of the last device, @U2.
5247
INC B 04
INCrement Register B by 1, the next device's number.
5248
CP B B8
Compare Register A (05H) against Register B: the NC FLAG while Register B is 5 or less.
5249
If the NC FLAG is set (a device is left), JUMP back to 522EH for its line.
524B
RET C9
RETurn to SYS0/SYS's overlay request handler (49E7H), which returns to CMNDI@'s caller.
524CH - One Device's Line
Index Register IY points to the device's entry in the DCB table, whose first word is the address of its DCB. The direction bits come from the DCB's type byte, or from the type saved at entry+08H while the device is NIL, FORCEd or JOINed. The registers are kept by SYS0/SYS's wrapper (4485H).
524C
GOSUB to 4485H, SYS0/SYS's wrapper, which saves the registers, runs the code after this CALL as a subroutine and restores them when it returns.
524F
LD E,(IY+00H) FD 5E 00
Load Register E with the low byte of the DCB's address from the entry at Index Register IY+00H.
5252
LD D,(IY+01H) FD 56 01
Load Register D with the high byte of the DCB's address from Index Register IY+01H.
5255
PUSH DE D5
Save Register Pair DE, the DCB's address, to the top of the stack.
5256
POP IX DD E1
Restore Index Register IX with the DCB's address from the top of the stack.
5258
LD A,(IX+00H) DD 7E 00
Load Register A with the DCB's type byte at Index Register IX+00H: bit 0 input, 1 output, 2 control, 3 NIL, 4 FORCE, 5 JOIN.
525B
LD C,A 4F
Load Register C with Register A, the type byte whose direction bits are shown.
525C
AND 38H E6 38
AND Register A with 38H, bits 3, 4 and 5: the NZ FLAG when the device is NIL, FORCEd or JOINed.
525E
If the Z FLAG is set (none of them), JUMP to 5263H with the device's own type in Register C.
5260
LD C,(IY+08H) FD 4E 08
Load Register C with the type byte saved at +08H of the entry at Index Register IY+08H, the device's own type.
5263
LD B,20H 06 20
Load Register B with 20H, the space shown for a direction the device does not have.
5265
LD A,3CH 3E 3C
Load Register A with 3CH, the < that shows that the device does input.
5267
BIT 0,C CB 41
Test bit 0 of Register C, the input bit of the type byte.
5269
If the NZ FLAG is set (input), JUMP to 526CH to show the <.
526B
LD A,B 78
Load Register A with Register B, a space (20H).
526C
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (< or a space).
526F
LD A,2DH 3E 2D
Load Register A with 2DH, the hyphen between the two directions.
5271
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (2DH).
5274
LD A,3EH 3E 3E
Load Register A with 3EH, the > that shows that the device does output.
5276
BIT 1,C CB 49
Test bit 1 of Register C, the output bit of the type byte.
5278
If the NZ FLAG is set (output), JUMP to 527BH to show the >.
527A
LD A,B 78
Load Register A with Register B, a space (20H).
527B
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (> or a space).
527E
LD A,B 78
Load Register A with Register B, a space (20H).
527F
GOSUB to 0033H, the ROM's display routine, to show the space in Register A.
5282
BIT 4,(IX+00H) DD CB 00 66
Test bit 4 of the DCB's type byte at Index Register IX+00H, the FORCE bit.
5286
If the Z FLAG is set (not FORCEd), JUMP to 5296H.
5288
LD HL,571EH 21 1E 57
Point Register Pair HL to 571EH, the text FORCE.
528B
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL up to its 03H.
528E
LD L,(IX+01H) DD 6E 01
Load Register L with the low byte of DCB+01H at Index Register IX+01H: a FORCEd device's DCB+01H holds the control block it goes to.
5291
LD H,(IX+02H) DD 66 02
Load Register H with the high byte of DCB+02H at Index Register IX+02H.
5294
JUMP to 52CBH to show the device or file it is FORCEd to.
5296
BIT 3,(IX+00H) DD CB 00 5E
Test bit 3 of the DCB's type byte at Index Register IX+00H, the NIL bit.
529A
If the Z FLAG is set (not NIL), JUMP to 52A4H to show the driver's address.
529C
LD HL,572AH 21 2A 57
Point Register Pair HL to 572AH, the text NIL.
529F
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL up to its 03H.
52A2
JUMP to 52B9H for the JOIN test of the NIL device.
52A4
LD L,(IX+01H) DD 6E 01
Load Register L with the low byte of the driver's address from DCB+01H at Index Register IX+01H.
52A7
LD H,(IX+02H) DD 66 02
Load Register H with the high byte of the driver's address from DCB+02H at Index Register IX+02H.
52AA
BIT 5,(IX+00H) DD CB 00 6E
Test bit 5 of the DCB's type byte at Index Register IX+00H, the JOIN bit: a JOINed DCB+01H points to the entry, not the driver.
52AE
If the Z FLAG is set (not JOINed), JUMP to 52B6H with the driver's address in Register Pair HL.
52B0
LD L,(IY+06H) FD 6E 06
Load Register L with the low byte of the driver saved at +06H of the entry at Index Register IY+06H.
52B3
LD H,(IY+07H) FD 66 07
Load Register H with the high byte of the saved driver at Index Register IY+07H.
52B6
GOSUB to 55B0H to show Register Pair HL, the driver's address, as four hexadecimal digits and H.
52B9
BIT 5,(IX+00H) DD CB 00 6E
Test bit 5 of the DCB's type byte at Index Register IX+00H, the JOIN bit.
52BD
If the Z FLAG is set (not JOINed), JUMP to 52EDH to end the line.
52BF
LD HL,5724H 21 24 57
Point Register Pair HL to 5724H, the text JOIN with a space before it.
52C2
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL up to its 03H.
52C5
LD L,(IY+04H) FD 6E 04
Load Register L with the low byte of the linked control block from +04H of the entry at Index Register IY+04H.
52C8
LD H,(IY+05H) FD 66 05
Load Register H with the high byte of the linked control block at Index Register IY+05H.
52CB
GOSUB to 56D9H to show a space before the device or file.
52CE
LD A,(HL) 7E
Load Register A with the type byte of the control block at Register Pair HL, the device or file routed or linked to.
52CF
CP 80H FE 80
Compare Register A against 80H, the type of an open file control block.
52D1
If the Z FLAG is set (a file), JUMP to 52E0H to show its specification.
52D3
GOSUB to 565BH to look up the DCB at Register Pair HL in the DCB table: the Z FLAG with Index Register IY at its entry.
52D6
PUSH AF F5
Save Register Pair AF, the flags of the search, to the top of the stack.
52D7
If the NZ FLAG is set (not a device of the table), GOSUB to 55B0H to show the address in Register Pair HL in hexadecimal.
52DA
POP AF F1
Restore Register Pair AF, the flags of the search, from the top of the stack.
52DB
If the Z FLAG is set (a device of the table), GOSUB to 56C8H to show @ and its name from the entry at Index Register IY.
52DE
JUMP to 52EDH to end the line of the device list.
52E0
LD DE,577BH 11 7B 57
Point Register Pair DE to 577BH, the source block's text, unused in the list, for a copy of the file control block.
52E3
PUSH DE D5
Save Register Pair DE (577BH) to the top of the stack.
52E4
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of a file control block.
52E7
LDIR ED B0
Copy the file control block from Register Pair HL to Register Pair DE (577BH) by LDIR, with Register Pair BC as the count.
52E9
POP DE D1
Restore Register Pair DE (577BH) from the top of the stack.
52EA
GOSUB to 56DEH, which has SYS3/SYS put the specification back into the copy at Register Pair DE and shows it.
52ED
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the device's line.
52EF
JUMP to 0033H, the ROM's display routine, to show the character in Register A (0DH); its RETurn ends the line.
52F2H - Routing a Device
FORCE or JOIN with fields: both are needed (2FH), and the source must be a device (2BH). The source device is first reset (5618H); a destination that is the same device ends the command there (FORCE @PR @PR resets @PR). A destination with a name is a file: 288 bytes are taken below HMEM$ for its buffer and file control block and it is opened by INIT@; else it is a device and LOCDCB% gives its DCB. The source gets a DCB of its own if it shares the NIL block (5679H), its driver and type are saved in its entry (+06H, +08H), its type gets bit 7 and the FORCE or JOIN bit, and DCB+01H points to the target (FORCE) or to the entry's +04H, which holds the target (JOIN).
52F2
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.
52F5
CPL 2F
Invert every bit of Register A (CPL), so that bits 0 and 1 are set for the fields that are missing.
52F6
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.
52F8
If the NZ FLAG is set (a field is missing), JUMP to 5711H to post error 2FH, I/o field not found.
52FB
LD A,(577AH) 3A 7A 57
Load Register A with the flag byte of the source block at 577AH (bit 7 a device or a drive, bit 6 a name, bit 3 a drive, bits 0-2 the number).
52FE
LD E,A 5F
Load Register E with Register A, the source's flag byte, for 5618H and 5679H.
52FF
AND C8H E6 C8
AND Register A with C8H, bits 7, 6 and 3, which tell a device from a drive and a name.
5301
CP 80H FE 80
Compare Register A against 80H: the Z FLAG when only bit 7 is set, a device.
5303
If the NZ FLAG is set (a drive or a file), JUMP to 570BH to post error 2BH, Illegal devicespec.
5306
GOSUB to 5618H to reset the source device (number in Register E): any FORCE or JOIN is undone and a file it went to is closed.
5309
LD A,(579BH) 3A 9B 57
Load Register A with the flag byte of the destination block at 579BH.
530C
XOR E AB
XOR Register A with Register E, the source's flag byte: the bits that differ.
530D
AND CFH E6 CF
AND Register A with CFH, every bit but bits 5 and 4: the Z FLAG when the destination is the source device itself.
530F
RET Z C8
If the Z FLAG is set (the same device), RETurn: the device stays reset.
5310
LD A,(579BH) 3A 9B 57
Load Register A with the flag byte of the destination block at 579BH again.
5313
BIT 6,A CB 77
Test bit 6 of Register A, which EVAL@ sets for a field with a file name.
5315
If the NZ FLAG is set (a file), JUMP to 531EH to open it.
5317
AND 07H E6 07
AND Register A with 07H, bits 0-2: the device number of the destination (the drive bit is not tested).
5319
GOSUB to 44A0H, LOCDCB%, to load Register Pair DE with the address of the DCB of device Register A.
531C
JUMP to 5338H with the destination's DCB in Register Pair DE.
531E
LD DE,57BBH 11 BB 57
Point Register Pair DE to 57BBH, the last byte of the destination block's text (579CH-57BBH).
5321
LD BC,0120H 01 20 01
Load Register Pair BC with 0120H, the 288 bytes of a sector buffer and a file control block.
5324
GOSUB to 56ECH to take Register Pair BC bytes below HMEM$: Register Pair HL returns the first byte of the block.
5327
PUSH HL E5
Save Register Pair HL, the start of the block, the file's buffer, to the top of the stack.
5328
DEC BC 0B
DECrement Register Pair BC by 1 to 011FH, the offset of the block's last byte.
5329
ADD HL,BC 09
ADD Register Pair BC (011FH) to Register Pair HL: the last byte of the block.
532A
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the last byte of the block, Register Pair HL = 57BBH.
532B
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of the destination's text.
532E
LDDR ED B8
Copy the text from 579CH-57BBH to the last 32 bytes of the block by LDDR (Register Pair HL down from 57BBH, Register Pair DE down from the block's end, Register Pair BC the count).
5330
INC DE 13
INCrement Register Pair DE by 1: the file control block at the start of the block's last 32 bytes, after the 256 byte buffer.
5331
POP HL E1
Restore Register Pair HL with the start of the block, the file's buffer, from the top of the stack.
5332
GOSUB to 4420H, INIT@, to open or create the file at Register Pair DE with the buffer at Register Pair HL; Register B is 00H (256) after the LDDR.
5335
If the NZ FLAG is set (INIT@ failed), JUMP to 5719H to post the error in Register A.
5338
PUSH DE D5
Save Register Pair DE, the target's DCB or file control block, to the top of the stack.
5339
LD A,(577AH) 3A 7A 57
Load Register A with the flag byte of the source block at 577AH.
533C
LD E,A 5F
Load Register E with Register A, the source's flag byte, for 5679H.
533D
GOSUB to 5679H to point Index Register IX to the source's DCB, given one of its own when it shares the NIL block, and Index Register IY to its entry.
5340
LD A,(IX+00H) DD 7E 00
Load Register A with the source DCB's type byte at Index Register IX+00H.
5343
LD E,(IX+01H) DD 5E 01
Load Register E with the low byte of the source's driver address from DCB+01H at Index Register IX+01H.
5346
LD D,(IX+02H) DD 56 02
Load Register D with the high byte of the driver address from DCB+02H at Index Register IX+02H.
5349
LD (IY+06H),E FD 73 06
Store Register E, the low byte of the driver, to +06H of the entry at Index Register IY+06H, the saved driver.
534C
LD (IY+07H),D FD 72 07
Store Register D, the high byte of the driver, to +07H of the entry at Index Register IY+07H.
534F
LD (IY+08H),A FD 77 08
Store Register A, the device's own type byte, to +08H of the entry at Index Register IY+08H, the saved type.
5352
POP DE D1
Restore Register Pair DE, the target's DCB or file control block, from the top of the stack.
5353
LD A,(IX+00H) DD 7E 00
Load Register A with the source DCB's type byte at Index Register IX+00H.
5356
AND F8H E6 F8
AND Register A with F8H to clear bits 0-2: the ROM's 03C2H then finds no direction bit and leaves the I/O to SYS0/SYS through 4033H.
5358
OR 00H F6 00
OR Register A with the operand at 5359H (00H in the file): 90H for FORCE, A0H for JOIN, stored by 5213H.
535A
LD (IX+00H),A DD 77 00
Store Register A to the source DCB's type byte at Index Register IX+00H.
535D
AND 20H E6 20
AND Register A with 20H, bit 5, the JOIN bit: the NZ FLAG for JOIN.
535F
If the Z FLAG is set (FORCE), JUMP to 536EH: DCB+01H gets the target itself.
5361
LD (IY+04H),E FD 73 04
JOIN: store Register E, the low byte of the target, to +04H of the entry at Index Register IY+04H, the linked control block.
5364
LD (IY+05H),D FD 72 05
Store Register D, the high byte of the target, to +05H of the entry at Index Register IY+05H.
5367
PUSH IY FD E5
Save Index Register IY, the entry, to the top of the stack.
5369
POP DE D1
Restore Register Pair DE with the entry's address from the top of the stack.
536A
INC DE 13
INCrement Register Pair DE by 1, the first of four.
536B
INC DE 13
INCrement Register Pair DE by 1 again, the second time.
536C
INC DE 13
INCrement Register Pair DE by 1 again, the third time.
536D
INC DE 13
INCrement Register Pair DE by 1 again: Register Pair DE = +04H of the entry, which SYS0/SYS's JOIN code reads (its 44F8H).
536E
LD (IX+01H),E DD 73 01
Store Register E to DCB+01H at Index Register IX+01H: the target (FORCE) or the entry's +04H (JOIN).
5371
LD (IX+02H),D DD 72 02
Store Register D to DCB+02H at Index Register IX+02H.
5374
RET C9
RETurn to SYS0/SYS's overlay request handler (49E7H), which returns to CMNDI@'s caller.
5375H - RESET
Routine 4, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. EVAL@ takes the command line with the block at 5739H, whose three blocks are all 577AH. A source must be a device (2BH: a drive cannot be RESET), which is reset by 5618H; without one, devices 0-5 are reset in turn. The drives are not touched.
5375
LD IX,5739H DD 21 39 57
Point Index Register IX to 5739H, the evaluation block of RESET: source, destination and wildmask all 577AH, no parameters (5742H).
5379
GOSUB to 4479H, EVAL@, to take the device field from the command line at Register Pair HL.
537C
If the NZ FLAG is set (an error in the command line), JUMP to 5719H to post the error in Register A.
537F
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 field was given.
5383
If the Z FLAG is set (no field), JUMP to 5393H to reset every device.
5385
LD A,(577AH) 3A 7A 57
Load Register A with the flag byte of the block at 577AH (bit 7 a device or drive, bit 6 a name, bit 3 a drive, bits 0-2 the number).
5388
LD E,A 5F
Load Register E with Register A, the flag byte, for 5618H.
5389
AND C8H E6 C8
AND Register A with C8H, bits 7, 6 and 3, which tell a device from a drive and a name.
538B
CP 80H FE 80
Compare Register A against 80H: the Z FLAG when the field is a device.
538D
If the NZ FLAG is set (a drive or a file), JUMP to 570BH to post error 2BH, Illegal devicespec.
5390
JUMP to 5618H to reset the device in Register E; its RETurn ends RESET.
5393
LD E,00H 1E 00
Load Register E with 00H, the first device, @KI.
5395
GOSUB to 5618H to reset the device in Register E.
5398
LD A,05H 3E 05
Load Register A with 05H, the last device, @U2.
539A
INC E 1C
INCrement Register E by 1, the number of the next device to reset.
539B
CP E BB
Compare Register A (05H) against Register E: the NC FLAG while Register E is 5 or less.
539C
If the NC FLAG is set (a device is left), JUMP back to 5395H to reset it.
539E
RET C9
RETurn to SYS0/SYS's overlay request handler (49E7H), which returns to CMNDI@'s caller.
539FH - ASSIGN
Routine 5, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. The two fields are taken one by one by SYS7/SYS's routine 6 (request 66H), not by EVAL@, so the rest of the line stays for a driver's parameters. The first must be a device or a drive (2BH); a device is reset first. A second field with a name is a driver program: it is RUN with Index Register IX at the first field's DCB and Register Pair HL at the rest of the line (540CH). Otherwise the second field must be of the same kind as the first (2BH) and have a driver (29H), and its DCB (8 bytes) or drive control table (20 bytes) is copied over the first one's; a drive gets its NIL bit cleared and is logged again.
539F
LD DE,577AH 11 7A 57
Point Register Pair DE to 577AH, the source block, for the first field.
53A2
GOSUB to 5409H to have SYS7/SYS's routine 6 take one field from the command line at Register Pair HL into the block at Register Pair DE.
53A5
If the NZ FLAG is set (no valid field), JUMP to 570BH to post error 2BH, Illegal devicespec.
53A8
LD DE,579BH 11 9B 57
Point Register Pair DE to 579BH, the destination block, for the second field.
53AB
GOSUB to 5409H to have SYS7/SYS's routine 6 take the second field from the command line at Register Pair HL.
53AE
If the NZ FLAG is set (no valid field), JUMP to 570EH to post error 2CH, Illegal filespec.
53B1
LD A,(577AH) 3A 7A 57
Load Register A with the flag byte of the first field at 577AH (bit 6 a name, bit 3 a drive, bits 0-2 the number).
53B4
LD E,A 5F
Load Register E with Register A, the first field's flag byte, for 5618H, 5679H and 569FH.
53B5
BIT 6,A CB 77
Test bit 6 of Register A: the NZ FLAG when the first field is a file name.
53B7
If the NZ FLAG is set (a file name), JUMP to 570BH to post error 2BH, Illegal devicespec.
53BA
BIT 3,A CB 5F
Test bit 3 of Register A, the drive bit: the Z FLAG for a device.
53BC
If the Z FLAG is set (a device), GOSUB to 5618H to reset it: any FORCE or JOIN is undone first.
53BF
LD A,(579BH) 3A 9B 57
Load Register A with the flag byte of the second field at 579BH.
53C2
BIT 6,A CB 77
Test bit 6 of Register A: the NZ FLAG when the second field is a file name, the driver program.
53C4
If the NZ FLAG is set (a driver program), JUMP to 540CH to run it.
53C6
XOR E AB
XOR Register A with Register E, the first field's flag byte: the bits that differ.
53C7
AND 88H E6 88
AND Register A with 88H, bits 7 and 3: the NZ FLAG when one field is a device and the other a drive.
53C9
If the NZ FLAG is set (not the same kind), JUMP to 570BH to post error 2BH, Illegal devicespec.
53CC
GOSUB to 5679H to point Index Register IX to the first field's DCB or drive control table, given one of its own when it shares the NIL block.
53CF
LD B,08H 06 08
Load Register B with 08H, the bytes of a DCB that are copied.
53D1
BIT 3,E CB 5B
Test bit 3 of Register E, the drive bit of the first field.
53D3
If the Z FLAG is set (a device), JUMP to 53D7H with Register B = 08H.
53D5
LD B,14H 06 14
Load Register B with 14H, the 20 bytes of a drive control table.
53D7
PUSH DE D5
Save Register Pair DE, the first field's flag byte in Register E, to the top of the stack.
53D8
PUSH IX DD E5
Save Index Register IX, the first field's DCB or drive control table, to the top of the stack, to restore below.
53DA
PUSH IX DD E5
Save Index Register IX again, for Register Pair DE of the copy.
53DC
LD A,(579BH) 3A 9B 57
Load Register A with the flag byte of the second field at 579BH.
53DF
LD E,A 5F
Load Register E with Register A, the second field's flag byte, for 569FH.
53E0
GOSUB to 569FH to point Index Register IX to the second field's DCB or drive control table and Index Register IY to its entry.
53E3
LD L,(IX+01H) DD 6E 01
Load Register L with the low byte of the second one's driver address at Index Register IX+01H.
53E6
LD H,(IX+02H) DD 66 02
Load Register H with the high byte of the driver address at Index Register IX+02H.
53E9
INC HL 23
INCrement Register Pair HL by 1: 0000H when the driver address is FFFFH, none.
53EA
LD DE,FFFEH 11 FE FF
Load Register Pair DE with FFFEH, to add for the test below.
53ED
ADD HL,DE 19
ADD Register Pair DE (FFFEH) to Register Pair HL: the NC FLAG when the driver address is FFFFH or 0000H.
53EE
PUSH IX DD E5
Save Index Register IX, the second field's DCB or drive control table, to the top of the stack.
53F0
POP HL E1
Restore Register Pair HL with the second field's DCB or drive control table, the source of the copy, from the top of the stack.
53F1
POP DE D1
Restore Register Pair DE with the first field's DCB or drive control table, the destination of the copy, from the top of the stack.
53F2
If the NC FLAG is set (the second has no driver), JUMP to 5717H to post error 29H, Device not available.
53F5
LD C,B 48
Load Register C with Register B, the bytes to copy (08H or 14H).
53F6
LD B,00H 06 00
Load Register B with 00H, the high byte of the count.
53F8
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (the second's block) to Register Pair DE (the first's) by LDIR.
53FA
POP IX DD E1
Restore Index Register IX with the first field's DCB or drive control table from the top of the stack.
53FC
POP DE D1
Restore Register Pair DE (Register E the first field's flag byte) from the top of the stack.
53FD
BIT 3,E CB 5B
Test bit 3 of Register E, the drive bit of the first field.
53FF
RET Z C8
If the Z FLAG is set (a device), RETurn: ASSIGN is done.
5400
RES 3,(IX+00H) DD CB 00 9E
A drive: reset bit 3, the NIL bit, of the type byte of the drive control table at Index Register IX+00H.
5404
SET 0,(IX+03H) DD CB 03 C6
Set bit 0 of +03H of the drive control table at Index Register IX+03H, the flag that has the diskette logged at its next access.
5408
RET C9
RETurn to SYS0/SYS's overlay request handler (49E7H), which returns to CMNDI@'s caller.
5409H - One Field
Requests SYS7/SYS's routine 6 (66H), which takes one field of the command line at Register Pair HL into the block at Register Pair DE. The overlay request handler drops the return address of the RST 28H, so the routine returns straight to the caller of 5409H.
5409
LD A,66H 3E 66
Load Register A with 66H, the request code for SYS7/SYS's routine 6, one command line field.
540B
RST 28H EF
RESTART to 28H, the overlay request handler; it returns to the caller of 5409H, not to 540CH.
540CH - A Driver Program
ASSIGN with a file name as its second field: the first field gets a DCB of its own if it shares the NIL block, the name goes to the file control block at 42DEH that CMNDI@ uses, OVLYH$ is set to FFH (the program may load over SYS11/SYS), and RUN@ loads and runs the driver with Index Register IX at the DCB or drive control table, Index Register IY at its entry and Register Pair HL at the rest of the command line, for its parameters.
540C
PUSH HL E5
Save Register Pair HL, the rest of the command line, to the top of the stack.
540D
GOSUB to 5679H to point Index Register IX to the first field's DCB or drive control table, given one of its own when it shares the NIL block.
5410
LD HL,579CH 21 9C 57
Point Register Pair HL to 579CH, the second field's text, the driver program's file specification.
5413
LD DE,42DEH 11 DE 42
Point Register Pair DE to 42DEH, the file control block in which CMNDI@ also puts the commands it runs.
5416
PUSH DE D5
Save Register Pair DE (42DEH) to the top of the stack.
5417
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of the text.
541A
LDIR ED B0
Copy the specification from Register Pair HL (579CH) to Register Pair DE (42DEH) by LDIR, with Register Pair BC as the count.
541C
POP DE D1
Restore Register Pair DE (42DEH) from the top of the stack, the file control block for RUN@.
541D
LD A,FFH 3E FF
Load Register A with FFH, which names no overlay.
541F
LD (429EH),A 32 9E 42
Store Register A (FFH) to 429EH, OVLYH$: no high overlay is resident, since the driver may load over SYS11/SYS.
5422
POP HL E1
Restore Register Pair HL, the rest of the command line, from the top of the stack, for the driver's parameters.
5423
JUMP to 4433H, RUN@, to load and run the driver program named at Register Pair DE.
5426H - FILTER
Routine 7, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. The parameters NO/OFF (54D2H) and MAP (54E6H) and the count of the table (55AFH) are cleared, and EVAL@ takes the command line with the block at 5743H: a device must be given (2FH, 2BH). With a file as the second field, the device's filter is switched off (bit 6 of its type byte), its old table is given back when it is the lowest block in high memory, and the file's pairs are read into a new table below HMEM$, whose address goes to +02H of the device's entry. Then the filter is switched on unless NO or OFF was given and the device has a table; MAP lists the table.
5426
XOR A AF
Set Register A to 00H by XORing it with itself, to clear the parameters and the count below.
5427
LD (54E6H),A 32 E6 54
Store Register A (00H) to 54E6H, the low byte of the MAP value: the operand of LD DE,0000H at 54E5H.
542A
LD (55AFH),A 32 AF 55
Store Register A (00H) to 55AFH, the count of the pairs read from the filter file.
542D
LD (54D2H),A 32 D2 54
Store Register A (00H) to 54D2H, the low byte of the NO and OFF value: the operand of LD DE,0000H at 54D1H.
5430
LD IX,5743H DD 21 43 57
Point Index Register IX to 5743H, the evaluation block of FILTER: source 577AH, destination and wildmask 579BH, parameters 574CH.
5434
GOSUB to 4479H, EVAL@, to take the device, the filter file and the parameters from the command line at Register Pair HL.
5437
If the NZ FLAG is set (an error in the command line), JUMP to 5719H to post the error in Register A.
543A
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.
543E
If the Z FLAG is set (no device), JUMP to 5711H to post error 2FH, I/o field not found.
5441
LD A,(577AH) 3A 7A 57
Load Register A with the flag byte of the source block at 577AH (bit 7 a device or drive, bit 6 a name, bit 3 a drive).
5444
LD E,A 5F
Load Register E with Register A, the device's flag byte, for 569FH.
5445
AND C8H E6 C8
AND Register A with C8H, bits 7, 6 and 3, which tell a device from a drive and a name.
5447
CP 80H FE 80
Compare Register A against 80H: the Z FLAG when the field is a device.
5449
If the NZ FLAG is set (a drive or a file), JUMP to 570BH to post error 2BH, Illegal devicespec.
544C
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 filter file was given.
5450
If the Z FLAG is set (no file), JUMP to 54C6H to switch the device's filter on or off and list it.
5453
LD A,(579BH) 3A 9B 57
Load Register A with the flag byte of the destination block at 579BH.
5456
BIT 6,A CB 77
Test bit 6 of Register A: the NZ FLAG when the second field is a file name.
5458
If the Z FLAG is set (not a file), JUMP to 570EH to post error 2CH, Illegal filespec.
545B
GOSUB to 569FH to point Index Register IX to the device's DCB and Index Register IY to its entry in the DCB table.
545E
RES 6,(IX+00H) DD CB 00 B6
Reset bit 6 of the DCB's type byte at Index Register IX+00H: the filter is off while its table is replaced.
5462
LD L,(IY+02H) FD 6E 02
Load Register L with the low byte of the filter table's address from +02H of the entry at Index Register IY+02H.
5465
LD H,(IY+03H) FD 66 03
Load Register H with the high byte of the filter table's address at Index Register IY+03H.
5468
LD A,H 7C
Load Register A with Register H, the high byte of the address.
5469
AND L A5
AND Register A with Register L, the low byte: FFH only when the address is FFFFH.
546A
INC A 3C
INCrement Register A by 1: the Z FLAG when the device has no table (FFFFH).
546B
If the Z FLAG is set (no old table), JUMP to 5480H to read the file.
546D
LD (IY+02H),FFH FD 36 02 FF
Store FFH to +02H of the entry at Index Register IY+02H: the device has no table for now.
5471
LD (IY+03H),FFH FD 36 03 FF
Store FFH to +03H of the entry at Index Register IY+03H.
5475
LD C,(HL) 4E
Load Register C with the old table's first byte at Register Pair HL, its count of pairs.
5476
LD B,00H 06 00
Load Register B with 00H, the high byte of the size.
5478
SLA C CB 21
Shift Register C left (SLA): the count times 2, the low byte.
547A
RL B CB 10
Rotate Register B left through the C FLAG: the high byte of the count times 2.
547C
INC BC 03
INCrement Register Pair BC by 1: the size of the old table, its count byte and two bytes for each pair.
547D
GOSUB to 56F7H to give the Register Pair BC bytes at Register Pair HL back to free memory, if they are the lowest block below the top (HMEM$).
5480
LD DE,579CH 11 9C 57
Point Register Pair DE to 579CH, the destination block's text, which OPEN@ makes the filter file's control block.
5483
LD HL,5800H 21 00 58
Point Register Pair HL to 5800H, the filter file's sector buffer.
5486
GOSUB to 4424H, OPEN@, to open the filter file at Register Pair DE, with the logical record length in Register B.
5489
If the NZ FLAG is set (it could not be opened), JUMP to 5719H to post the error in Register A.
548C
LD DE,(4411H) ED 5B 11 44
Load Register Pair DE with HMEM$ from 4411H: the table is built downwards from the top of memory.
5490
LD HL,55AFH 21 AF 55
Point Register Pair HL to 55AFH, the count of the pairs read.
5493
GOSUB to 5549H to read a code from the file into Register C; Register A returns the character after it, or the NZ FLAG at the end of the file.
5496
If the NZ FLAG is set (the end of the file), JUMP to 54B5H to end the table.
5498
CP 3DH FE 3D
Compare Register A, the character after the first code, against 3DH, the equal sign.
549A
If the NZ FLAG is set (no equal sign), JUMP to 5714H to post error 2DH, Invalid data provided.
549D
LD B,C 41
Load Register B with Register C, the code to translate.
549E
GOSUB to 5549H to read the new code into Register C; Register A returns the character after it.
54A1
If the NZ FLAG is set (the end of the file), JUMP to 54B5H: a pair without its new code is not kept.
54A3
CP 20H FE 20
Compare Register A, the character after the pair, against 20H: the C FLAG for a control code, the end of a line.
54A5
If the C FLAG is set (the end of a line), JUMP to 54ACH to keep the pair.
54A7
CP 2CH FE 2C
Compare Register A against 2CH, the comma between two pairs on a line.
54A9
If the NZ FLAG is set (neither), JUMP to 5714H to post error 2DH, Invalid data provided.
54AC
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the next free byte of the table, Register Pair DE = 55AFH.
54AD
LD (HL),C 71
Store Register C, the new code, at Register Pair HL.
54AE
DEC HL 2B
DECrement Register Pair HL by 1, down the table.
54AF
LD (HL),B 70
Store Register B, the code to translate, at Register Pair HL, under its new code.
54B0
DEC HL 2B
DECrement Register Pair HL by 1, to the next free byte.
54B1
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the next free byte, Register Pair HL = 55AFH.
54B2
INC (HL) 34
INCrement the count of pairs at Register Pair HL (55AFH): the Z FLAG when it wraps to 00H.
54B3
If the NZ FLAG is set (fewer than 256 pairs), JUMP back to 5493H for the next pair.
54B5
INC (HL) 34
INCrement the count at Register Pair HL (55AFH) by 1, the first half of a test against 00H.
54B6
DEC (HL) 35
DECrement the count at Register Pair HL back to its value: the Z FLAG when no pair was read.
54B7
If the Z FLAG is set (an empty table), JUMP to 54C6H: the device keeps no table.
54B9
LDD ED A8
Copy the count from Register Pair HL (55AFH) to the byte below the pairs at Register Pair DE (LDD), DECrementing both and Register Pair BC.
54BB
LD (4411H),DE ED 53 11 44
Store Register Pair DE, the byte below the table, to 4411H, HMEM$: the table is protected.
54BF
INC DE 13
INCrement Register Pair DE by 1: the table's address, its count byte.
54C0
LD (IY+02H),E FD 73 02
Store Register E, the low byte of the table's address, to +02H of the entry at Index Register IY+02H.
54C3
LD (IY+03H),D FD 72 03
Store Register D, the high byte of the table's address, to +03H of the entry at Index Register IY+03H.
54C6
LD A,(577AH) 3A 7A 57
Load Register A with the flag byte of the source block at 577AH, the device.
54C9
LD E,A 5F
Load Register E with Register A, the device's flag byte, for 569FH.
54CA
GOSUB to 569FH to point Index Register IX to the device's DCB and Index Register IY to its entry in the DCB table.
54CD
RES 6,(IX+00H) DD CB 00 B6
Reset bit 6 of the DCB's type byte at Index Register IX+00H, the filter bit.
54D1
LD DE,0000H 11 00 00
Load Register Pair DE with the NO and OFF value, the operand at 54D2H-54D3H (0000H in the file) that EVAL@ stored.
54D4
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
54D5
DEC E 1D
DECrement Register E by 1 back to its value: the NZ FLAG when NO or OFF was given.
54D6
If the NZ FLAG is set (NO or OFF), JUMP to 54E5H with the filter off.
54D8
LD A,(IY+02H) FD 7E 02
Load Register A with the low byte of the table's address from +02H of the entry at Index Register IY+02H.
54DB
AND (IY+03H) FD A6 03
AND Register A with the high byte at Index Register IY+03H: FFH only when the address is FFFFH.
54DE
INC A 3C
INCrement Register A by 1: the Z FLAG when the device has no table.
54DF
If the Z FLAG is set (no table), JUMP to 54E5H with the filter off.
54E1
SET 6,(IX+00H) DD CB 00 F6
Set bit 6 of the DCB's type byte at Index Register IX+00H: the filter is on.
54E5
LD DE,0000H 11 00 00
Load Register Pair DE with the MAP value, the operand at 54E6H-54E7H (0000H in the file) that EVAL@ stored.
54E8
INC E 1C
INCrement Register E by 1, the first half of a test of Register E against 00H.
54E9
DEC E 1D
DECrement Register E by 1 back to its value: the Z FLAG when MAP was not given.
54EA
RET Z C8
If the Z FLAG is set (no MAP), RETurn: FILTER is done.
54EBH - MAP
Lists the device's table, five pairs to a line, each as old=new: a printable character in single quotation marks, any other code (below 20H, or 80H and above) as two hexadecimal digits and H. The pairs are listed from the first read, at the top of the table, down. The SPACE BAR pauses at the end of a line and BREAK ends the list (55FCH).
54EB
LD L,(IY+02H) FD 6E 02
Load Register L with the low byte of the table's address from +02H of the entry at Index Register IY+02H.
54EE
LD H,(IY+03H) FD 66 03
Load Register H with the high byte of the table's address at Index Register IY+03H.
54F1
LD A,H 7C
Load Register A with Register H, the high byte of the address.
54F2
AND L A5
AND Register A with Register L, the low byte: FFH only when the address is FFFFH.
54F3
INC A 3C
INCrement Register A by 1: the Z FLAG when the device has no table.
54F4
RET Z C8
If the Z FLAG is set (no table), RETurn: there is nothing to list.
54F5
LD C,(HL) 4E
Load Register C with the count of pairs from the table's first byte at Register Pair HL.
54F6
LD B,00H 06 00
Load Register B with 00H, the high byte of the count.
54F8
ADD HL,BC 09
ADD Register Pair BC (the count) to Register Pair HL.
54F9
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL again: the top byte of the table, the new code of the first pair read.
54FA
LD B,05H 06 05
Load Register B with 05H, the pairs on a line.
54FC
LD A,02H 3E 02
Load Register A with 02H, the spaces that start a line.
54FE
GOSUB to 560DH to show Register A (02H) spaces.
5501
PUSH BC C5
Save Register Pair BC (Register B the pairs left on the line, Register C the pairs left) to the top of the stack.
5502
LD C,(HL) 4E
Load Register C with the new code of the pair at Register Pair HL.
5503
DEC HL 2B
DECrement Register Pair HL by 1, to the pair's code to translate.
5504
LD A,(HL) 7E
Load Register A with the code to translate at Register Pair HL.
5505
DEC HL 2B
DECrement Register Pair HL by 1, to the next pair's new code.
5506
GOSUB to 5530H to show the code in Register A, quoted or in hexadecimal.
5509
LD A,3DH 3E 3D
Load Register A with 3DH, the equal sign between the two codes.
550B
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (3DH).
550E
LD A,C 79
Load Register A with Register C, the new code.
550F
GOSUB to 5530H to show the code in Register A, quoted or in hexadecimal.
5512
POP BC C1
Restore Register Pair BC (the counts) from the top of the stack.
5513
DEC C 0D
DECrement Register C by 1, the pairs left in the table.
5514
If the Z FLAG is set (the last pair), JUMP to 552BH to end the line.
5516
DEC B 05
DECrement Register B by 1, the pairs left on the line.
5517
If the Z FLAG is set (the line is full), JUMP to 5520H to start a new line.
5519
LD A,04H 3E 04
Load Register A with 04H, the spaces between two pairs.
551B
GOSUB to 560DH to show Register A (04H) spaces.
551E
JUMP back to 5501H for the next pair on the same line.
5520
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends a full line.
5522
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (0DH).
5525
GOSUB to 55FCH to scan the keyboard: the SPACE BAR pauses, BREAK gives the Z FLAG.
5528
If the NZ FLAG is set (not BREAK), JUMP back to 54FAH for the next line.
552A
RET C9
RETurn to the caller: BREAK ends the list of the table.
552B
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the last line.
552D
JUMP to 0033H, the ROM's display routine, to show the character in Register A (0DH); its RETurn ends FILTER.
5530H - Show a Code
A code of 20H-7FH is shown as the character in single quotation marks; any other in hexadecimal, two digits and H (55B5H).
5530
CP 20H FE 20
Compare Register A, the code, against 20H: the C FLAG for a control code.
5532
If the C FLAG is set (a control code), JUMP to 55B5H to show it in hexadecimal.
5535
CP 80H FE 80
Compare Register A against 80H: the NC FLAG for a code of 80H or more.
5537
If the NC FLAG is set (80H or more), JUMP to 55B5H to show it in hexadecimal.
553A
PUSH AF F5
Save Register Pair AF, the code, to the top of the stack.
553B
LD A,27H 3E 27
Load Register A with 27H, the single quotation mark before the character.
553D
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (27H).
5540
POP AF F1
Restore Register Pair AF, the code, from the top of the stack.
5541
GOSUB to 0033H, the ROM's display routine, to show the character in Register A.
5544
LD A,27H 3E 27
Load Register A with 27H, the single quotation mark after the character.
5546
JUMP to 0033H, the ROM's display routine, to show the character in Register A (27H); its RETurn goes to the caller.
5549H - Reading the Filter File
5549H reads one code into Register C: two hexadecimal digits, or a character between double or single quotation marks; it returns the Z FLAG with Register A = the next character, or the NZ FLAG at the end of the file (1CH). Spaces, control codes and comments (from a period to the end of its line) are passed over before a code, and spaces after a hexadecimal code or a closing single quotation mark (5592H); the byte after a closing double quotation mark is taken as it is. 559CH gets the next byte of the file without passing over anything, so a quoted space or period is a code. Any error other than the end of the file is posted.
5549
GOSUB to 559CH to get the next byte of the file into Register A: the NZ FLAG at the end of the file.
554C
RET NZ C0
If the NZ FLAG is set (the end of the file), RETurn with it.
554D
CP 21H FE 21
Compare Register A against 21H: the C FLAG for a space or a control code, such as the 0DH that ends a line.
554F
If the C FLAG is set (a space or a control code), JUMP back to 5549H for the next byte.
5551
CP 2EH FE 2E
Compare Register A against 2EH, the period that starts a comment.
5553
If the NZ FLAG is set (not a comment), JUMP to 555FH to read a code.
5555
A comment: GOSUB to 559CH to get the next byte of the file into Register A.
5558
RET NZ C0
If the NZ FLAG is set (the end of the file), RETurn with it.
5559
CP 20H FE 20
Compare Register A against 20H: the NC FLAG for a character of the comment.
555B
If the NC FLAG is set (still the comment), JUMP back to 5555H for the next byte.
555D
JUMP back to 5549H: the control code that ends the comment is passed over.
555F
CP 22H FE 22
Compare Register A against 22H, the double quotation mark.
5561
If the Z FLAG is set (a quoted character), JUMP to 5580H.
5563
CP 27H FE 27
Compare Register A against 27H, the single quotation mark.
5565
If the Z FLAG is set (a quoted character), JUMP to 5580H.
5567
GOSUB to 55E8H to turn the character in Register A into a hexadecimal digit: the C FLAG when it is not one.
556A
If the C FLAG is set (not a hexadecimal digit), JUMP to 5714H to post error 2DH, Invalid data provided.
556D
RLCA 07
Rotate Register A left (RLCA), the first of four: the digit moves to bits 4-7.
556E
RLCA 07
Rotate Register A left (RLCA), the second time.
556F
RLCA 07
Rotate Register A left (RLCA), the third time.
5570
RLCA 07
Rotate Register A left (RLCA), the fourth time: the high digit is in bits 4-7.
5571
LD C,A 4F
Load Register C with Register A, the high digit of the code.
5572
GOSUB to 559CH to get the second digit into Register A: the NZ FLAG at the end of the file.
5575
RET NZ C0
If the NZ FLAG is set (the end of the file), RETurn with it.
5576
GOSUB to 55E8H to turn the character in Register A into a hexadecimal digit: the C FLAG when it is not one.
5579
If the C FLAG is set (not a hexadecimal digit), JUMP to 5714H to post error 2DH, Invalid data provided.
557C
OR C B1
OR Register A (the low digit) with Register C (the high digit): the code.
557D
LD C,A 4F
Load Register C with Register A, the code read.
557E
JUMP to 5592H to pass over spaces and get the character after the code into Register A.
5580
A quoted character: GOSUB to 559CH to get it into Register A, whatever it is (a space or a period too).
5583
RET NZ C0
If the NZ FLAG is set (the end of the file), RETurn with it.
5584
LD C,A 4F
Load Register C with Register A, the character, the code read.
5585
GOSUB to 559CH to get the closing quotation mark into Register A.
5588
RET NZ C0
If the NZ FLAG is set (the end of the file), RETurn with it.
5589
CP 22H FE 22
Compare Register A against 22H, the double quotation mark.
558B
If the Z FLAG is set (the closing mark), JUMP to 559CH to get the very next byte, without passing over spaces.
558D
CP 27H FE 27
Compare Register A against 27H, the single quotation mark.
558F
If the NZ FLAG is set (no closing mark), JUMP to 5714H to post error 2DH, Invalid data provided.
5592
GOSUB to 559CH to get the next byte of the file into Register A: the NZ FLAG at the end of the file.
5595
RET NZ C0
If the NZ FLAG is set (the end of the file), RETurn with it.
5596
CP 20H FE 20
Compare Register A against 20H, a space, which is passed over after a code.
5598
If the Z FLAG is set (a space), JUMP back to 5592H for the next byte.
559A
CP A BF
Compare Register A against itself to set the Z FLAG: a character was read.
559B
RET C9
RETurn with the Z FLAG and the character after the code in Register A.
559C
PUSH DE D5
Save Register Pair DE (the table's next free byte) to the top of the stack.
559D
LD DE,579CH 11 9C 57
Point Register Pair DE to 579CH, the filter file's control block.
55A0
GOSUB to 0013H, the ROM's input routine, to read the next byte of the file at Register Pair DE into Register A: the NZ FLAG on an error.
55A3
POP DE D1
Restore Register Pair DE (the table's next free byte) from the top of the stack.
55A4
If the NZ FLAG is set (an error or the end of the file), JUMP to 55A8H.
55A6
CP A BF
Compare Register A against itself to set the Z FLAG: a byte was read.
55A7
RET C9
RETurn with the Z FLAG and the byte in Register A.
55A8
CP 1CH FE 1C
Compare Register A, the error code, against 1CH, Attempted to read past eof: the end of the filter file.
55AA
If the NZ FLAG is set (another error), JUMP to 5719H to post the error in Register A.
55AD
OR A B7
OR Register A (1CH) with itself to set the NZ FLAG: the end of the file.
55AE
RET C9
RETurn with the NZ FLAG: the end of the file.
55AFH - The Count of Pairs
Data: the number of pairs read from the filter file, cleared by 542AH, counted up by 54B2H and copied below the table by 54B9H as its first byte.
55AF
DEFB 00H 00
The count of the pairs of the filter table being built (55AFH), at most 255.
55B0H - Hexadecimal Output
55B0H shows Register Pair HL as four hexadecimal digits and H; 55B5H shows Register A as two digits and H; 55BDH shows Register A as two digits; 55C6H shows the low four bits of Register A as one digit.
55B0
LD A,H 7C
Load Register A with Register H, the high byte of the word.
55B1
GOSUB to 55BDH to show Register A (Register H) as two hexadecimal digits.
55B4
LD A,L 7D
Load Register A with Register L, the low byte of the word.
55B5
GOSUB to 55BDH to show Register A as two hexadecimal digits; 5530H enters here for a code.
55B8
LD A,48H 3E 48
Load Register A with 48H, the letter H after a hexadecimal number.
55BA
JUMP to 0033H, the ROM's display routine, to show the character in Register A (48H); its RETurn goes to the caller.
55BD
PUSH AF F5
Save Register Pair AF, the byte, to the top of the stack, for its low digit.
55BE
RRA 1F
Rotate Register A right through the C FLAG (RRA), the first of four, to bring the high digit down.
55BF
RRA 1F
Rotate Register A right through the C FLAG (RRA), the second time.
55C0
RRA 1F
Rotate Register A right through the C FLAG (RRA), the third time.
55C1
RRA 1F
Rotate Register A right through the C FLAG (RRA), the fourth time: the high digit is in bits 0-3.
55C2
GOSUB to 55C6H to show the high digit, bits 0-3 of Register A.
55C5
POP AF F1
Restore Register Pair AF, the byte, from the top of the stack, and fall into 55C6H for its low digit.
55C6
AND 0FH E6 0F
AND Register A with 0FH, to keep the digit in bits 0-3.
55C8
ADD A,90H C6 90
ADD 90H to Register A, the first step of the digit conversion: 90H-99H for 0-9, 9AH-9FH for A-F.
55CA
DAA 27
Decimal Adjust Register A (DAA): 90H-99H stay with the C FLAG clear, 9AH-9FH become 00H-05H with the C FLAG set.
55CB
ADC A,40H CE 40
ADD 40H and the C FLAG to Register A (ADC): D0H-D9H for 0-9, 41H-46H for A-F.
55CD
DAA 27
Decimal Adjust Register A (DAA): D0H-D9H become 30H-39H, the digits 0-9; 41H-46H stay, the letters A-F.
55CE
JUMP to 0033H, the ROM's display routine, to show the digit in Register A; its RETurn goes to the caller.
55D1H - Two Decimal Digits
Shows Register A (0-99) as two decimal digits, the device number of the list. Register Pair DE is kept.
55D1
PUSH DE D5
Save Register Pair DE to the top of the stack.
55D2
LD E,30H 1E 30
Load Register E with 30H, the ASCII digit 0, the count of the tens.
55D4
SUB 0AH D6 0A
SUBtract 0AH (ten) from Register A: the C FLAG when it goes below zero.
55D6
If the C FLAG is set (no more tens), JUMP to 55DBH.
55D8
INC E 1C
INCrement Register E by 1, the next digit of the tens.
55D9
JUMP back to 55D4H to subtract the next ten from Register A.
55DB
ADD A,3AH C6 3A
ADD 3AH to Register A, the remainder less ten: the ASCII digit of the units.
55DD
PUSH AF F5
Save Register Pair AF, the units digit, to the top of the stack.
55DE
LD A,E 7B
Load Register A with Register E, the tens digit.
55DF
GOSUB to 0033H, the ROM's display routine, to show the tens digit in Register A.
55E2
POP AF F1
Restore Register Pair AF, the units digit, from the top of the stack.
55E3
GOSUB to 0033H, the ROM's display routine, to show the units digit in Register A.
55E6
POP DE D1
Restore Register Pair DE from the top of the stack.
55E7
RET C9
RETurn to the caller with the two digits shown.
55E8H - A Hexadecimal Digit
Turns the character in Register A (0-9, A-F or a-f) into its value 00H-0FH with the NC FLAG; the C FLAG for any other character.
55E8
SUB 30H D6 30
SUBtract 30H, the ASCII digit 0, from Register A: the C FLAG for a character below 0.
55EA
RET C D8
If the C FLAG is set (below 0), RETurn with it: not a digit.
55EB
CP 0AH FE 0A
Compare Register A against 0AH: the C FLAG for 0-9.
55ED
If the C FLAG is set (0-9), JUMP to 55FAH, which turns it into the NC FLAG with Register A the value.
55EF
ADD A,30H C6 30
ADD 30H to Register A, which gives the character back again.
55F1
AND 5FH E6 5F
AND Register A with 5FH, which makes a lower case letter upper case.
55F3
SUB 37H D6 37
SUBtract 37H from Register A: A-F become 0AH-0FH.
55F5
CP 0AH FE 0A
Compare Register A against 0AH: the C FLAG for a character between 9 and A.
55F7
RET C D8
If the C FLAG is set (below A), RETurn with it: not a digit.
55F8
CP 10H FE 10
Compare Register A against 10H: the C FLAG for A-F, the NC FLAG beyond F.
55FA
CCF 3F
Complement the C FLAG (CCF): the NC FLAG for a digit, the C FLAG beyond F.
55FB
RET C9
RETurn with Register A the digit's value and the NC FLAG, or the C FLAG for no digit.
55FCH - 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).
55FC
LD A,(4297H) 3A 97 42
Load Register A with SFLAG1$ from 4297H, whose bit 5 is set while a DO file runs.
55FF
AND 20H E6 20
AND Register A with 20H, bit 5: the NZ FLAG while a DO file runs.
5601
RET NZ C0
If the NZ FLAG is set (a DO file runs), RETurn with the NZ FLAG: the keyboard is not read.
5602
GOSUB to 002BH, the ROM's keyboard scan, which returns the key pressed in Register A, or 00H.
5605
CP 20H FE 20
Compare Register A against 20H, the SPACE BAR.
5607
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.
560A
CP 01H FE 01
Compare Register A against 01H, the BREAK key: the Z FLAG for BREAK.
560C
RET C9
RETurn to the caller with the Z FLAG when the key was BREAK.
560DH - Spaces
Shows Register A spaces (Register A 1 or more).
560D
PUSH AF F5
Save Register Pair AF, the count of spaces, to the top of the stack.
560E
LD A,20H 3E 20
Load Register A with 20H, a space, the character to show.
5610
GOSUB to 0033H, the ROM's display routine, to show the space in Register A (20H).
5613
POP AF F1
Restore Register Pair AF, the count, from the top of the stack.
5614
DEC A 3D
DECrement Register A by 1, the count of the spaces left.
5615
If the NZ FLAG is set (spaces are left), JUMP back to 560DH.
5617
RET C9
RETurn to the caller with Register A spaces shown.
5618H - Reset a Device
The device or drive named by Register E (bits 0-2 the number, bit 3 a drive) is put back as it was before FORCE, JOIN or NIL: with nothing of these set (bits 3-5 of the type byte) nothing is done. A FORCE or JOIN to a file closes the file and gives its 288 byte block back when it is the lowest block below HMEM$; a FORCEd or JOINed device gets its saved driver back; the saved type from the entry's +08H is restored in every case. A filter (bit 6) is left as it is, since the saved type was taken from the type byte. The registers are kept by SYS0/SYS's wrapper (4485H).
5618
GOSUB to 4485H, SYS0/SYS's wrapper, which saves the registers, runs the code after this CALL as a subroutine and restores them when it returns.
561B
GOSUB to 569FH to point Index Register IX to the DCB of the device in Register E and Index Register IY to its entry.
561E
LD A,(IX+00H) DD 7E 00
Load Register A with the DCB's type byte at Index Register IX+00H.
5621
AND 38H E6 38
AND Register A with 38H, bits 3, 4 and 5: NIL, FORCE and JOIN.
5623
RET Z C8
If the Z FLAG is set (none of them), RETurn: the device is as it should be.
5624
LD E,(IX+01H) DD 5E 01
Load Register E with the low byte of DCB+01H at Index Register IX+01H: a FORCEd device's target.
5627
LD D,(IX+02H) DD 56 02
Load Register D with the high byte of DCB+02H at Index Register IX+02H.
562A
BIT 4,A CB 67
Test bit 4 of Register A, the FORCE bit of the type byte.
562C
If the NZ FLAG is set (FORCE), JUMP to 5638H with the target in Register Pair DE.
562E
LD E,(IY+04H) FD 5E 04
Load Register E with the low byte of the linked control block from +04H of the entry at Index Register IY+04H.
5631
LD D,(IY+05H) FD 56 05
Load Register D with the high byte of the linked control block at Index Register IY+05H.
5634
BIT 5,A CB 6F
Test bit 5 of Register A, the JOIN bit of the type byte.
5636
If the Z FLAG is set (NIL only), JUMP to 5654H to restore the saved type.
5638
LD A,(DE) 1A
Load Register A with the type byte of the target at Register Pair DE.
5639
CP 80H FE 80
Compare Register A against 80H, the type of an open file control block.
563B
If the NZ FLAG is set (a device), JUMP to 5648H to restore the driver.
563D
A file: GOSUB to 4428H, CLOSE@, to close the file at Register Pair DE.
5640
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the file control block, the last 32 bytes of its block.
5641
DEC H 25
DECrement Register H by 1: Register Pair HL = the start of the block, 256 bytes below, the file's buffer.
5642
LD BC,0120H 01 20 01
Load Register Pair BC with 0120H, the 288 bytes of the block (52F2H).
5645
GOSUB to 56F7H to give the Register Pair BC bytes at Register Pair HL back to free memory if they are the lowest block below the top (HMEM$).
5648
LD L,(IY+06H) FD 6E 06
Load Register L with the low byte of the saved driver from +06H of the entry at Index Register IY+06H.
564B
LD H,(IY+07H) FD 66 07
Load Register H with the high byte of the saved driver at Index Register IY+07H.
564E
LD (IX+01H),L DD 75 01
Store Register L, the low byte of the driver, to DCB+01H at Index Register IX+01H.
5651
LD (IX+02H),H DD 74 02
Store Register H, the high byte of the driver, to DCB+02H at Index Register IX+02H.
5654
LD A,(IY+08H) FD 7E 08
Load Register A with the type byte saved at +08H of the entry at Index Register IY+08H.
5657
LD (IX+00H),A DD 77 00
Store Register A, the saved type, to the DCB's type byte at Index Register IX+00H.
565A
RET C9
RETurn to the caller with the device reset as it was.
565BH - Find a DCB
Looks up the DCB address in Register Pair HL among the six entries of the DCB table: the Z FLAG with Index Register IY at the entry, the NZ FLAG when it is not there. Register Pairs BC and DE are kept.
565B
PUSH BC C5
Save Register Pair BC to the top of the stack.
565C
PUSH DE D5
Save Register Pair DE to the top of the stack.
565D
LD IY,44A6H FD 21 A6 44
Point Index Register IY to 44A6H, the first entry of the DCB table.
5661
LD B,06H 06 06
Load Register B with 06H, the six entries of the DCB table.
5663
LD DE,000BH 11 0B 00
Load Register Pair DE with 000BH, the length of an entry.
5666
LD A,(IY+00H) FD 7E 00
Load Register A with the low byte of the entry's DCB address at Index Register IY+00H.
5669
CP L BD
Compare Register A against Register L, the low byte of the address looked for.
566A
If the NZ FLAG is set (it differs), JUMP to 5672H for the next entry.
566C
LD A,(IY+01H) FD 7E 01
Load Register A with the high byte of the entry's DCB address at Index Register IY+01H.
566F
CP H BC
Compare Register A against Register H, the high byte of the address looked for.
5670
If the Z FLAG is set (the entry is found), JUMP to 5676H with the Z FLAG.
5672
ADD IY,DE FD 19
ADD Register Pair DE (000BH) to Index Register IY: the next entry.
5674
DECrement Register B and, if it is not zero, JUMP back to 5666H (DJNZ).
5676
POP DE D1
Restore Register Pair DE from the top of the stack.
5677
POP BC C1
Restore Register Pair BC from the top of the stack.
5678
RET C9
RETurn with the Z FLAG for a DCB of the table, the NZ FLAG from the last compare when there is none.
5679H - A DCB of Its Own
Points Index Register IX to the DCB or drive control table of the device or drive in Register E and Index Register IY to its entry. When the driver address at its +01H is FFFFH (the NIL block 43CBH, which @RS, @U1, @U2 and drives 4-7 share), 20 bytes are taken below HMEM$, made a NIL block (08H, then 00H) and put into the entry, so that it can be changed without changing the others.
5679
GOSUB to 569FH to point Index Register IX to the DCB or drive control table in Register E and Index Register IY to its entry.
567C
LD A,(IX+01H) DD 7E 01
Load Register A with the low byte of the driver address at Index Register IX+01H.
567F
AND (IX+02H) DD A6 02
AND Register A with the high byte at Index Register IX+02H: FFH only for FFFFH.
5682
INC A 3C
INCrement Register A by 1: the Z FLAG when the driver address is FFFFH, the shared NIL block.
5683
RET NZ C0
If the NZ FLAG is set (a block of its own), RETurn.
5684
LD BC,0014H 01 14 00
Load Register Pair BC with 0014H, the 20 bytes of the new block, the size of a drive control table.
5687
GOSUB to 56ECH to take Register Pair BC bytes below HMEM$: Register Pair HL returns the first byte of the block.
568A
LD (IY+00H),L FD 75 00
Store Register L, the low byte of the new block, to the entry at Index Register IY+00H.
568D
LD (IY+01H),H FD 74 01
Store Register H, the high byte of the new block, to the entry at Index Register IY+01H.
5690
PUSH HL E5
Save Register Pair HL, the new block, to the top of the stack.
5691
POP IX DD E1
Restore Index Register IX with the new block from the top of the stack.
5693
LD (HL),08H 36 08
Store 08H, the NIL type, to the first byte of the block at Register Pair HL.
5695
CPI ED A1
Compare Register A against the byte at Register Pair HL and INCrement Register Pair HL, DECrement Register Pair BC (CPI): only the counting is used.
5697
LD (HL),00H 36 00
Store 00H to the byte of the block at Register Pair HL.
5699
CPI ED A1
INCrement Register Pair HL and DECrement Register Pair BC by CPI (the compare with Register A is not used): the P/V FLAG while Register Pair BC is not 0.
569B
If the PE FLAG is set (bytes are left), JUMP back to 5697H for the next one.
569E
RET C9
RETurn with Index Register IX at the new block and Index Register IY at the entry.
569FH - Find the Entry
Register E holds a device or drive as EVAL@'s flag byte gives it: bits 0-2 the number, bit 3 a drive. Index Register IY returns at its entry (in the DCB table, 11 bytes an entry, or DCTTBL, 4 bytes an entry) and Index Register IX at the DCB or drive control table the entry names. Register Pairs DE and HL are kept.
569F
PUSH DE D5
Save Register Pair DE to the top of the stack.
56A0
PUSH HL E5
Save Register Pair HL to the top of the stack.
56A1
LD A,E 7B
Load Register A with Register E, the flag byte.
56A2
LD E,0BH 1E 0B
Load Register E with 0BH, the length of an entry of the DCB table.
56A4
LD HL,44A6H 21 A6 44
Point Register Pair HL to 44A6H, the DCB table.
56A7
BIT 3,A CB 5F
Test bit 3 of Register A, the drive bit of the flag byte.
56A9
If the Z FLAG is set (a device), JUMP to 56B0H.
56AB
LD E,04H 1E 04
Load Register E with 04H, the length of an entry of DCTTBL.
56AD
LD HL,44E8H 21 E8 44
Point Register Pair HL to 44E8H, DCTTBL, the table of the drive control tables.
56B0
AND 07H E6 07
AND Register A with 07H, bits 0-2: the device or drive number.
56B2
GOSUB to 4491H, SYS0/SYS's 8 bit multiply: Register A = Register A times Register E, the offset of the entry.
56B5
LD E,A 5F
Load Register E with Register A, the offset of the entry.
56B6
LD D,00H 16 00
Load Register D with 00H, the high byte of the offset.
56B8
ADD HL,DE 19
ADD Register Pair DE (the offset) to Register Pair HL: the entry.
56B9
PUSH HL E5
Save Register Pair HL, the entry, to the top of the stack.
56BA
POP IY FD E1
Restore Index Register IY with the entry from the top of the stack.
56BC
LD E,(IY+00H) FD 5E 00
Load Register E with the low byte of the block's address from the entry at Index Register IY+00H.
56BF
LD D,(IY+01H) FD 56 01
Load Register D with the high byte of the block's address at Index Register IY+01H.
56C2
PUSH DE D5
Save Register Pair DE, the DCB or drive control table, to the top of the stack.
56C3
POP IX DD E1
Restore Index Register IX with the DCB or drive control table from the top of the stack.
56C5
POP HL E1
Restore Register Pair HL from the top of the stack.
56C6
POP DE D1
Restore Register Pair DE from the top of the stack.
56C7
RET C9
RETurn with Index Register IY at the entry and Index Register IX at its block.
56C8H - A Device's Name
Shows @, the two characters of the name at +09H of the DCB table entry at Index Register IY, and a space (56D9H).
56C8
LD A,40H 3E 40
Load Register A with 40H, the at sign before a device's name.
56CA
GOSUB to 0033H, the ROM's display routine, to show the character in Register A (40H).
56CD
LD A,(IY+09H) FD 7E 09
Load Register A with the first character of the name at Index Register IY+09H.
56D0
GOSUB to 0033H, the ROM's display routine, to show the character in Register A.
56D3
LD A,(IY+0AH) FD 7E 0A
Load Register A with the second character of the name at Index Register IY+0AH.
56D6
GOSUB to 0033H, the ROM's display routine, to show the character in Register A.
56D9
LD A,20H 3E 20
Load Register A with 20H, a space; the list also comes here for a space alone.
56DB
JUMP to 0033H, the ROM's display routine, to show the space in Register A (20H); its RETurn goes to the caller.
56DEH - A File's Specification
Has SYS3/SYS's routine 6 (request 26H) put the specification back into the copy of a file control block at Register Pair DE, then shows it by DSPLY@. Nothing is shown when the routine returns the NZ FLAG.
56DE
GOSUB to 56E9H to request SYS3/SYS's routine 6 for the file control block at Register Pair DE.
56E1
RET NZ C0
If the NZ FLAG is set (no specification), RETurn.
56E2
PUSH HL E5
Save Register Pair HL to the top of the stack.
56E3
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the specification.
56E4
GOSUB to 4467H, DSPLY@, to show the specification at Register Pair HL.
56E7
POP HL E1
Restore Register Pair HL from the top of the stack.
56E8
RET C9
RETurn to the caller with the specification shown.
56E9
LD A,26H 3E 26
Load Register A with 26H, the request code for SYS3/SYS's routine 6, the specification put back without closing the file.
56EB
RST 28H EF
RESTART to 28H, the overlay request handler; it returns to the caller of 56E9H, not to 56ECH.
56ECH - Memory below HMEM$
56ECH takes Register Pair BC bytes below the top of memory: HMEM$ goes down by Register Pair BC and Register Pair HL returns the first byte of the block. 56F7H gives Register Pair BC bytes at Register Pair HL back when they start just above HMEM$, the lowest block; any other block stays taken.
56EC
LD HL,(4411H) 2A 11 44
Load Register Pair HL with HMEM$ from 4411H, the top of free memory.
56EF
OR A B7
OR Register A with itself, to clear the C FLAG for the subtraction.
56F0
SBC HL,BC ED 42
SUBtract Register Pair BC (the size) from Register Pair HL with the C FLAG: the new top.
56F2
LD (4411H),HL 22 11 44
Store Register Pair HL, the new top, to 4411H, HMEM$.
56F5
INC HL 23
INCrement Register Pair HL by 1: the first byte of the block.
56F6
RET C9
RETurn to the caller with Register Pair HL at the new block.
56F7
PUSH HL E5
Save Register Pair HL, the block, to the top of the stack.
56F8
PUSH BC C5
Save Register Pair BC, its size, to the top of the stack.
56F9
LD BC,(4411H) ED 4B 11 44
Load Register Pair BC with HMEM$ from 4411H, the top of free memory.
56FD
SCF 37
Set the C FLAG (SCF), for the subtraction of HMEM$ plus 1.
56FE
SBC HL,BC ED 42
SUBtract Register Pair BC (HMEM$) and the C FLAG from Register Pair HL: the Z FLAG when the block starts at HMEM$ plus 1.
5700
If the NZ FLAG is set (another block is lower), JUMP to 5708H: the memory stays taken.
5702
POP HL E1
Restore Register Pair HL with the size from the top of the stack.
5703
PUSH HL E5
Save Register Pair HL, the size, to the top of the stack again.
5704
ADD HL,BC 09
ADD Register Pair BC (HMEM$) to Register Pair HL (the size): the new top.
5705
LD (4411H),HL 22 11 44
Store Register Pair HL, the new top, to 4411H, HMEM$.
5708
POP BC C1
Restore Register Pair BC from the top of the stack.
5709
POP HL E1
Restore Register Pair HL from the top of the stack.
570A
RET C9
RETurn to the caller with Register Pairs BC and HL as they were.
570BH - The Error Exits
Five entries, each loading its error code into Register A: 570BH 2BH Illegal devicespec, 570EH 2CH Illegal filespec, 5711H 2FH I/o field not found, 5714H 2DH Invalid data provided, 5717H 29H Device not available. Each LD A,n after the first is the operand of an LD BC,nn entered from the entry above it, so only one load counts. 5719H posts the error in Register A by ERROR@ with bit 6 set (no frame), and ERROR@ ends with ABORT@.
570B
LD A,2BH 3E 2B
Load Register A with 2BH, the error code Illegal devicespec.
570D
LD BC,2C3EH 01 3E 2C
570EH enters inside this LD BC,2C3EH: its bytes 3EH 2CH read as LD A,2CH, the error code Illegal filespec; from 570BH it only loads Register Pair BC.
5710
LD BC,2F3EH 01 3E 2F
5711H enters inside this LD BC,2F3EH: its bytes 3EH 2FH read as LD A,2FH, the error code I/o field not found; from above it only loads Register Pair BC.
5713
LD BC,2D3EH 01 3E 2D
5714H enters inside this LD BC,2D3EH: its bytes 3EH 2DH read as LD A,2DH, the error code Invalid data provided; from above it only loads Register Pair BC.
5716
LD BC,293EH 01 3E 29
5717H enters inside this LD BC,293EH: its bytes 3EH 29H read as LD A,29H, the error code Device not available; from above it only loads Register Pair BC.
5719
OR 40H F6 40
OR Register A, the error code, with 40H, bit 6, so that ERROR@ shows the message without its frame.
571B
JUMP to 4409H, ERROR@, to show the message of the error in Register A and end through ABORT@.
571EH - The Texts
Data: the three words of the device list, each ended by 03H for DSPLY@.
571E-5722
DEFM "FORCE" 46 4F 52 43 45
The word shown for a FORCEd device (5288H), before the device or file it goes to.
5723
DEFB 03H 03
The byte that ends the text FORCE for DSPLY@.
5724-5728
DEFM " JOIN" 20 4A 4F 49 4E
The word shown after a JOINed device's driver (52BFH), with a space before it.
5729
DEFB 03H 03
The byte that ends the text JOIN for DSPLY@ (4467H) at 52C2H.
572A-572E
DEFM "NIL " 4E 49 4C 20 20
The word shown for a NIL device (529CH), with two spaces after it.
572F
DEFB 03H 03
The byte that ends the text NIL for DSPLY@ (4467H) at 529FH.
5730H - The Evaluation Blocks
Data: the blocks that Index Register IX points to for EVAL@: the flags EVAL@ sets (bit 0 a source, bit 1 a destination, bit 2 a wildmask, bit 3 parameters), the addresses of the source, destination and wildmask blocks, and of the parameter table. FORCE and JOIN use 5730H, RESET 5739H (one block for every field) and FILTER 5743H; the empty table at 5742H serves FORCE, JOIN and RESET. A parameter entry is the name (6 characters), the address its value is stored to and a type byte (20H a logical value, so the name alone sets it).
5730
DEFB 00H 00
The flags of FORCE's and JOIN's block (5216H), set by EVAL@.
5731-5732
DEFW 577AH 7A 57
The address of the source block, 577AH: the flag byte, then the device to route.
5733-5734
DEFW 579BH 9B 57
The address of the destination block, 579BH: the flag byte, then the device or file it goes to.
5735-5736
DEFW 579BH 9B 57
The address of the wildmask block: 579BH again, the destination block.
5737-5738
DEFW 5742H 42 57
The address of the parameter table at 5742H, which is empty.
5739
DEFB 00H 00
The flags of RESET's block (5375H), set by EVAL@.
573A-573B
DEFW 577AH 7A 57
The address of the source block, 577AH: the flag byte, then the device to reset.
573C-573D
DEFW 577AH 7A 57
The address of the destination block: 577AH again, so a second field takes the place of the first.
573E-573F
DEFW 577AH 7A 57
The address of the wildmask block: 577AH again.
5740-5741
DEFW 5742H 42 57
The address of the parameter table at 5742H, which is empty.
5742
DEFB 00H 00
The empty parameter table of FORCE, JOIN and RESET: a 00H in place of the first name.
5743
DEFB 00H 00
The flags of FILTER's block (5430H), set by EVAL@.
5744-5745
DEFW 577AH 7A 57
The address of the source block, 577AH: the flag byte, then the device to filter.
5746-5747
DEFW 579BH 9B 57
The address of the destination block, 579BH: the flag byte, then the filter file.
5748-5749
DEFW 579BH 9B 57
The address of the wildmask block: 579BH again, the destination block.
574A-574B
DEFW 574CH 4C 57
The address of the parameter table at 574CH, FILTER's five parameters.
574C-5751
DEFM "OFF " 4F 46 46 20 20 20
The name of OFF: load the table without switching the filter on, or switch a loaded filter off.
5752-5753
DEFW 54D2H D2 54
OFF's value goes to 54D2H-54D3H, the operand of LD DE,0000H at 54D1H.
5754
DEFB 20H 20
The type byte of OFF: 20H, bit 5, a logical value, so the name alone sets it.
5755-575A
DEFM "NO " 4E 4F 20 20 20 20
The name of NO, the same as OFF: the value goes to the same place.
575B-575C
DEFW 54D2H D2 54
NO's value goes to 54D2H-54D3H, the operand of LD DE,0000H at 54D1H, as OFF's.
575D
DEFB 20H 20
The type byte of NO: 20H, bit 5, a logical value, so the name alone sets it.
575E-5763
DEFM "ON " 4F 4E 20 20 20 20
The name of ON: switch the filter on, which FILTER does anyway.
5764-5765
DEFW 5800H 00 58
ON's value goes to 5800H, the filter file's buffer, where nothing reads it: ON is accepted and has no effect.
5766
DEFB 20H 20
The type byte of ON: 20H, bit 5, a logical value, so the name alone sets it.
5767-576C
DEFM "YES " 59 45 53 20 20 20
The name of YES, the same as ON: accepted and without effect.
576D-576E
DEFW 5800H 00 58
YES's value goes to 5800H, the filter file's buffer, where nothing reads it, as ON's.
576F
DEFB 20H 20
The type byte of YES: 20H, bit 5, a logical value, so the name alone sets it.
5770-5775
DEFM "MAP " 4D 41 50 20 20 20
The name of MAP: list the device's filter table.
5776-5777
DEFW 54E6H E6 54
MAP's value goes to 54E6H-54E7H, the operand of LD DE,0000H at 54E5H.
5778
DEFB 20H 20
The type byte of MAP: 20H, bit 5, a logical value, so the name alone sets it.
5779
DEFB 00H 00
The end of FILTER's parameter table: a 00H in place of the next name, the last byte of the file.
577AH - The Work Area
Not in the file: SYS11/SYS uses the memory after its last byte (5779H) for the two blocks of EVAL@ (or of SYS7/SYS's routine 6 for ASSIGN) and the filter file's buffer.
577A
DEFS 1
The flag byte of the source block (52FBH): bit 7 a device or a drive, bit 6 a name, bit 3 a drive, bits 0-2 the number.
577B-579A
DEFS 32
The source's text; in the device list also a copy of a file control block for its specification (52E0H).
579B
DEFS 1
The flag byte of the destination block (5309H).
579C-57BB
DEFS 32
The destination's text: a device, a file to FORCE or JOIN to (moved below HMEM$, 532EH), a driver program (5410H) or the filter file's control block (5480H).
5800-58FF
DEFS 256
The filter file's sector buffer (5483H), where EVAL@ also stores the values of ON and YES.