5200H - The Routine Table
Data: SYS16/SYS's table of routines 2-4, one word each, used by SYS0/SYS's overlay request handler (its 49C9H-49DCH) for the request codes F2H-F4H. CMNDI@ takes the codes of the library commands from SYS1/SYS's table: CONFIG F3H (51C4H), SYSTEM F4H (51DDH). No file of the diskette requests F2H.
5200-5201
DEFW 5206H 06 52
Routine 2: 5206H, XOR A and RET, which SYS0/SYS's record locator requests when it loads SYS16/SYS back (its 4D55H-4D62H).
5202-5203
DEFW 5208H 08 52
Routine 3: 5208H, CONFIG (F3H): show the drive control tables, or change one drive's.
5204-5205
DEFW 5500H 00 55
Routine 4: 5500H, SYSTEM (F4H): show the memory pointers, set the system's options, or save the system's state as a configuration file.
5206H - Routine 2
Nothing to do when SYS0/SYS's record locator brings SYS16/SYS back.
5206
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.
5207
RET C9
RETurn to SYS0/SYS's overlay request handler (49DDH) with Register A = 00H.
5208H - CONFIG
Routine 3, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. The parameters (table 549CH) go into the operands of the change routine 536CH: the numbers SIDES, SIZE, STEP, PDRIVE, HOFFST and TSIZE start with the low byte FFH and COFFST as FFFFH (not given), the switches WPROT, MDELAY, HLOAD and SKIP as 53H (not given). EVAL@ takes the field with the block at 5493H. With a field the drive is changed (536CH); without one the eight drives of DCTTBL are listed, each as $nn :name and its description (527FH).
5208
LD A,FFH 3E FF
Load Register A with FFH, the mark of a number that was not given.
520A
LD (53D8H),A 32 D8 53
Store Register A (FFH) into 53D8H, the low byte of the operand of LD DE,0000H at 53D7H, the value of COFFST.
520D
LD (53D9H),A 32 D9 53
Store Register A (FFH) into 53D9H, the high byte of the operand of LD DE,0000H at 53D7H: COFFST = FFFFH.
5210
LD (53BBH),A 32 BB 53
Store Register A (FFH) into 53BBH, the operand of LD DE,0000H at 53BAH, the value of PDRIVE.
5213
LD (53E6H),A 32 E6 53
Store Register A (FFH) into 53E6H, the operand of LD DE,0000H at 53E5H, the value of HOFFST.
5216
LD (53F0H),A 32 F0 53
Store Register A (FFH) into 53F0H, the operand of LD DE,0000H at 53EFH, the value of TSIZE.
5219
LD (53B1H),A 32 B1 53
Store Register A (FFH) into 53B1H, the operand of LD DE,0000H at 53B0H, the value of STEP.
521C
LD (538AH),A 32 8A 53
Store Register A (FFH) into 538AH, the operand of LD DE,0000H at 5389H, the value of SIDES.
521F
LD (5397H),A 32 97 53
Store Register A (FFH) into 5397H, the operand of LD DE,0000H at 5396H, the value of SIZE.
5222
LD A,53H 3E 53
Load Register A with 53H, the mark of a switch that was not given.
5224
LD (53C5H),A 32 C5 53
Store Register A (53H) into 53C5H, the operand of LD DE,0000H at 53C4H, the value of WPROT.
5227
LD (53FAH),A 32 FA 53
Store Register A (53H) into 53FAH, the operand of LD DE,0000H at 53F9H, the value of MDELAY.
522A
LD (540DH),A 32 0D 54
Store Register A (53H) into 540DH, the operand of LD DE,0000H at 540CH, the value of HLOAD.
522D
LD (5420H),A 32 20 54
Store Register A (53H) into 5420H, the operand of LD DE,0000H at 541FH, the value of SKIP.
5230
LD IX,5493H DD 21 93 54
Point Index Register IX to 5493H, CONFIG's evaluation block: the field block 58C0H and the parameter table 549CH.
5234
GOSUB to 4479H, EVAL@, to take the fields and parameters from the command line at Register Pair HL: the NZ FLAG on an error.
5237
If the NZ FLAG is set (EVAL@ failed), JUMP to 58BBH to post the error in Register A.
523A
LD A,(IX+00H) DD 7E 00
Load Register A with the flags of the evaluation block at Index Register IX+00H: bits 0-2 the fields given.
523D
AND 07H E6 07
AND Register A with 07H, bits 0-2: the Z FLAG when no field was given.
523F
If the NZ FLAG is set (a field), JUMP to 536CH to change that drive.
5242H - The List of the Drives
Without a field CONFIG shows the eight entries of DCTTBL, drives 0-7, one line each: $, the drive number in two digits, a space, a colon, the two characters of the drive's name, a space, and the description of its drive control table (527FH).
5242
LD IY,43ABH FD 21 AB 43
Point Index Register IY to 43ABH, DCTTBL, the table of the eight drives (4 bytes each).
5246
LD C,00H 0E 00
Load Register C with 00H, drive 0, the first drive of the list.
5248
LD A,24H 3E 24
Load Register A with 24H, the character $ that starts the line of a drive.
524A
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
524D
LD E,C 59
Load Register E with Register C, the drive number, the number to show.
524E
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the drive number.
5250
LD B,03H 06 03
Load Register B with 03H, so that 583BH leaves out at most three of the five digits: two digits are shown.
5252
GOSUB to 583BH to show the number in Register Pair DE in decimal, Register B leading zeros at most left out.
5255
LD A,20H 3E 20
Load Register A with 20H, the space after the drive number.
5257
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
525A
LD A,3AH 3E 3A
Load Register A with 3AH, the colon that starts a drive's name.
525C
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
525F
LD A,(IY+02H) FD 7E 02
Load Register A with the first character of the drive's name, DCTTBL +02H at Index Register IY+02H.
5262
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
5265
LD A,(IY+03H) FD 7E 03
Load Register A with the second character of the drive's name, DCTTBL +03H at Index Register IY+03H.
5268
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
526B
LD A,20H 3E 20
Load Register A with 20H, the space before the description of the drive.
526D
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
5270
GOSUB to 527FH to show the description of the drive control table of the entry at Index Register IY.
5273
LD DE,0004H 11 04 00
Load Register Pair DE with 0004H, the length of an entry of DCTTBL.
5276
ADD IY,DE FD 19
ADD Register Pair DE to Index Register IY, to the entry of the next drive.
5278
LD A,07H 3E 07
Load Register A with 07H, the last drive number.
527A
INC C 0C
INCrement Register C by 1, to the next drive number.
527B
CP C B9
Compare Register A against Register C: the NC FLAG while the drive number is 7 or less.
527C
If the NC FLAG is set (drives left), JUMP back to 5248H for the line of the next drive.
527E
RET C9
RETurn to the overlay request handler: CONFIG has listed the drives.
527FH - The Description of a Drive
Index Register IX is the drive control table of the DCTTBL entry at Index Register IY; the routine runs under 4525H, which keeps the registers. A drive with the NIL bit (bit 3 of DCT+00H) is NIL. Otherwise a rigid drive (bit 5 of DCT+03H) is Hard,Fix or Hard,Rem (bit 1, removable), a floppy drive Floppy,Sden or Floppy,Dden (bit 7 of DCT+0BH); then ,Size=5 or 8 (bit 7 of DCT+03H), ,Sides= (DCT+0CH), ,Step= (DCT+04H), ,PD= (DCT+0AH). A rigid drive goes on with ,CO= (DCT+06H-07H), ,HO= (DCT+05H), ,TS= (DCT+0DH) and ,WP (bit 6); a floppy drive with ,WP (bit 6), ,MD (bit 4), ,HL (bit 3) and ,Skip (bit 2) of DCT+03H. A carriage return ends the line.
527F
GOSUB to 4525H, which runs the rest of this routine with the registers saved and puts them back when it RETurns.
5282
LD E,(IY+00H) FD 5E 00
Load Register E with the low byte of the drive control table's address, DCTTBL +00H at Index Register IY+00H.
5285
LD D,(IY+01H) FD 56 01
Load Register D with the high byte of the address, DCTTBL +01H at Index Register IY+01H.
5288
PUSH DE D5
Save Register Pair DE, the address of the drive control table, to the top of the stack.
5289
POP IX DD E1
Restore Index Register IX from the top of the stack: Index Register IX = the drive control table.
528B
BIT 3,(IX+00H) DD CB 00 5E
Test bit 3 of DCT+00H at Index Register IX+00H, the NIL bit: set for a drive that is not used.
528F
If the Z FLAG is set (not NIL), JUMP to 5298H for the description of the drive.
5291
LD HL,5431H 21 31 54
Point Register Pair HL to 5431H, the text NIL with its carriage return.
5294
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
5297
RET C9
RETurn to the caller through 4525H: the line of a NIL drive is done.
5298
BIT 5,(IX+03H) DD CB 03 6E
Test bit 5 of DCT+03H at Index Register IX+03H: set for a rigid drive.
529C
If the Z FLAG is set (a floppy drive), JUMP to 52B5H.
529E
LD HL,5435H 21 35 54
Point Register Pair HL to 5435H, the text Hard.
52A1
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52A4
BIT 1,(IX+03H) DD CB 03 4E
Test bit 1 of DCT+03H at Index Register IX+03H: set for a removable rigid drive.
52A8
LD HL,543AH 21 3A 54
Point Register Pair HL to 543AH, the text ,Fix (LD does not change the flags).
52AB
If the Z FLAG is set (fixed), JUMP to 52B0H to show ,Fix.
52AD
LD HL,543FH 21 3F 54
Point Register Pair HL to 543FH, the text ,Rem, for a removable rigid drive.
52B0
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52B3
JUMP to 52CAH for the size of the drive, which floppy and rigid drives share.
52B5
LD HL,5444H 21 44 54
Point Register Pair HL to 5444H, the text Floppy.
52B8
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52BB
BIT 7,(IX+0BH) DD CB 0B 7E
Test bit 7 of DCT+0BH at Index Register IX+0BH: set for double density.
52BF
LD HL,544BH 21 4B 54
Point Register Pair HL to 544BH, the text ,Sden (LD does not change the flags).
52C2
If the Z FLAG is set (single density), JUMP to 52C7H to show ,Sden.
52C4
LD HL,5451H 21 51 54
Point Register Pair HL to 5451H, the text ,Dden, for double density.
52C7
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52CA
LD HL,5457H 21 57 54
Point Register Pair HL to 5457H, the text ,Size=.
52CD
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52D0
BIT 7,(IX+03H) DD CB 03 7E
Test bit 7 of DCT+03H at Index Register IX+03H: set for an 8 inch drive.
52D4
LD A,35H 3E 35
Load Register A with 35H, the digit 5 of a 5 inch drive (LD does not change the flags).
52D6
If the Z FLAG is set (5 inch), JUMP to 52DAH to show the 5.
52D8
LD A,38H 3E 38
Load Register A with 38H, the digit 8 of an 8 inch drive.
52DA
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
52DD
LD HL,545EH 21 5E 54
Point Register Pair HL to 545EH, the text ,Sides=.
52E0
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52E3
LD E,(IX+0CH) DD 5E 0C
Load Register E with the number of surfaces, DCT+0CH at Index Register IX+0CH.
52E6
GOSUB to 5837H to show the number in Register E in decimal.
52E9
LD HL,5466H 21 66 54
Point Register Pair HL to 5466H, the text ,Step=.
52EC
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52EF
LD E,(IX+04H) DD 5E 04
Load Register E with the step rate code, DCT+04H at Index Register IX+04H.
52F2
GOSUB to 5837H to show the number in Register E in decimal.
52F5
LD HL,546DH 21 6D 54
Point Register Pair HL to 546DH, the text ,PD=.
52F8
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
52FB
LD E,(IX+0AH) DD 5E 0A
Load Register E with the physical drive, DCT+0AH at Index Register IX+0AH.
52FE
GOSUB to 5837H to show the number in Register E in decimal.
5301
BIT 5,(IX+03H) DD CB 03 6E
Test bit 5 of DCT+03H at Index Register IX+03H: set for a rigid drive.
5305
If the NZ FLAG is set (rigid), JUMP to 5335H for the values of a rigid drive.
5307
LD HL,5472H 21 72 54
Point Register Pair HL to 5472H, the text ,WP.
530A
BIT 6,(IX+03H) DD CB 03 76
Test bit 6 of DCT+03H at Index Register IX+03H, the software write protect.
530E
If the NZ FLAG is set (write protected), GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
5311
LD HL,5476H 21 76 54
Point Register Pair HL to 5476H, the text ,MD.
5314
BIT 4,(IX+03H) DD CB 03 66
Test bit 4 of DCT+03H at Index Register IX+03H, the delay after the motor is turned on.
5318
If the NZ FLAG is set (motor delay), GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
531B
LD HL,547AH 21 7A 54
Point Register Pair HL to 547AH, the text ,HL.
531E
BIT 3,(IX+03H) DD CB 03 5E
Test bit 3 of DCT+03H at Index Register IX+03H, the delay after the head is loaded.
5322
If the NZ FLAG is set (head load delay), GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
5325
LD HL,547EH 21 7E 54
Point Register Pair HL to 547EH, the text ,Skip.
5328
BIT 2,(IX+03H) DD CB 03 56
Test bit 2 of DCT+03H at Index Register IX+03H, the double step.
532C
If the NZ FLAG is set (double step), GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
532F
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the line.
5331
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
5334
RET C9
RETurn to the caller through 4525H: the line of a floppy drive is done.
5335
LD HL,5484H 21 84 54
Point Register Pair HL to 5484H, the text ,CO=.
5338
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
533B
LD E,(IX+06H) DD 5E 06
Load Register E with the low byte of the cylinder offset, DCT+06H at Index Register IX+06H.
533E
LD D,(IX+07H) DD 56 07
Load Register D with the high byte of the cylinder offset, DCT+07H at Index Register IX+07H.
5341
GOSUB to 5839H to show the number in Register Pair DE in decimal.
5344
LD HL,5489H 21 89 54
Point Register Pair HL to 5489H, the text ,HO=.
5347
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
534A
LD E,(IX+05H) DD 5E 05
Load Register E with the head offset, DCT+05H at Index Register IX+05H.
534D
GOSUB to 5837H to show the number in Register E in decimal.
5350
LD HL,548EH 21 8E 54
Point Register Pair HL to 548EH, the text ,TS=.
5353
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
5356
LD E,(IX+0DH) DD 5E 0D
Load Register E with the sectors per track, DCT+0DH at Index Register IX+0DH.
5359
GOSUB to 5837H to show the number in Register E in decimal.
535C
LD HL,5472H 21 72 54
Point Register Pair HL to 5472H, the text ,WP.
535F
BIT 6,(IX+03H) DD CB 03 76
Test bit 6 of DCT+03H at Index Register IX+03H, the software write protect.
5363
If the NZ FLAG is set (write protected), GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
5366
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the line.
5368
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
536B
RET C9
RETurn to the caller through 4525H: the line of a rigid drive is done.
536CH - Change a Drive
The field must be a drive (else error 2BH) whose drive control table is not NIL (else error 29H). Bit 0 of DCT+03H is set, so the diskette is logged again at its next use. Each parameter given changes the table: SIDES the surfaces (DCT+0CH; 0 is error 2DH), SIZE 5 or 8 (bit 7 of DCT+03H; any other is 2DH), STEP the step rate code (DCT+04H), PDRIVE the physical drive (DCT+0AH), WPROT bit 6 of DCT+03H, COFFST the cylinder offset (DCT+06H-07H), HOFFST the head offset (DCT+05H), TSIZE the sectors per track (DCT+0DH), MDELAY bit 4, HLOAD bit 3 and SKIP bit 2 of DCT+03H. Only the low byte of a number is used and nothing else is checked.
536C
LD A,(58C0H) 3A C0 58
Load Register A with the flag byte of the field block at 58C0H.
536F
PUSH AF F5
Save Register Pair AF, the flag byte, to the top of the stack.
5370
AND C8H E6 C8
AND Register A with C8H, bits 7, 6 and 3: device, name and drive.
5372
CP 88H FE 88
Compare Register A against 88H: a drive without a name.
5374
If the NZ FLAG is set (not a drive), JUMP to 58B3H to post error 2BH, Illegal devicespec.
5377
POP AF F1
Restore Register Pair AF, the flag byte, from the top of the stack.
5378
AND 07H E6 07
AND Register A with 07H, bits 0-2: the drive number.
537A
LD C,A 4F
Load Register C with Register A, the drive number for LOCDCT%.
537B
GOSUB to 448BH, LOCDCT%, to point Index Register IY to the drive control table of the drive in Register C.
537E
BIT 3,(IY+00H) FD CB 00 5E
Test bit 3 of DCT+00H at Index Register IY+00H, the NIL bit: set for a drive that is not used.
5382
If the NZ FLAG is set (NIL), JUMP to 58B9H to post error 29H, Device not available.
5385
SET 0,(IY+03H) FD CB 03 C6
Set bit 0 of DCT+03H at Index Register IY+03H, so that the diskette is logged again at its next use.
5389
LD DE,0000H 11 00 00
Load Register Pair DE with the value of SIDES, the operand 538AH-538BH (0000H in the file): FFH in Register E when it is not given.
538C
INC E 1C
INCrement Register E by 1: the Z FLAG when SIDES was not given (FFH).
538D
If the Z FLAG is set (no SIDES), JUMP to 5396H for SIZE.
538F
DEC E 1D
DECrement Register E by 1, back to the value of SIDES: the Z FLAG for 0.
5390
If the Z FLAG is set (no surfaces), JUMP to 58B0H to post error 2DH, Invalid data provided.
5393
LD (IY+0CH),E FD 73 0C
Store Register E, the number of surfaces, into DCT+0CH at Index Register IY+0CH.
5396
LD DE,0000H 11 00 00
Load Register Pair DE with the value of SIZE, the operand 5397H-5398H (0000H in the file): FFH in Register E when it is not given.
5399
LD A,E 7B
Load Register A with Register E, the low byte of SIZE.
539A
INC A 3C
INCrement Register A by 1: the Z FLAG when SIZE was not given (FFH), else the size plus 1.
539B
If the Z FLAG is set (no SIZE), JUMP to 53B0H for STEP.
539D
CP 06H FE 06
Compare Register A against 06H, a size of 5 plus 1: a 5 inch drive.
539F
If the Z FLAG is set (SIZE=5), JUMP to 53ACH to clear the 8 inch bit.
53A1
CP 09H FE 09
Compare Register A against 09H, a size of 8 plus 1: an 8 inch drive.
53A3
If the NZ FLAG is set (neither 5 nor 8), JUMP to 58B0H to post error 2DH, Invalid data provided.
53A6
SET 7,(IY+03H) FD CB 03 FE
Set bit 7 of DCT+03H at Index Register IY+03H: an 8 inch drive.
53AA
JUMP to 53B0H for STEP, with the 8 inch bit of DCT+03H set.
53AC
RES 7,(IY+03H) FD CB 03 BE
Reset bit 7 of DCT+03H at Index Register IY+03H: a 5 inch drive.
53B0
LD DE,0000H 11 00 00
Load Register Pair DE with the value of STEP, the operand 53B1H-53B2H (0000H in the file): FFH in Register E when it is not given.
53B3
INC E 1C
INCrement Register E by 1: the Z FLAG when STEP was not given (FFH).
53B4
If the Z FLAG is set (no STEP), JUMP to 53BAH for PDRIVE.
53B6
DEC E 1D
DECrement Register E by 1, back to the value of STEP.
53B7
LD (IY+04H),E FD 73 04
Store Register E, the step rate code, into DCT+04H at Index Register IY+04H.
53BA
LD DE,0000H 11 00 00
Load Register Pair DE with the value of PDRIVE, the operand 53BBH-53BCH (0000H in the file): FFH in Register E when it is not given.
53BD
INC E 1C
INCrement Register E by 1: the Z FLAG when PDRIVE was not given (FFH).
53BE
If the Z FLAG is set (no PDRIVE), JUMP to 53C4H for WPROT.
53C0
DEC E 1D
DECrement Register E by 1, back to the value of PDRIVE.
53C1
LD (IY+0AH),E FD 73 0A
Store Register E, the physical drive, into DCT+0AH at Index Register IY+0AH.
53C4
LD DE,0000H 11 00 00
Load Register Pair DE with the value of WPROT, the operand 53C5H-53C6H (0000H in the file): 53H in Register E when it is not given.
53C7
LD A,E 7B
Load Register A with Register E, the low byte of WPROT.
53C8
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
53CA
If the Z FLAG is set (no WPROT), JUMP to 53D7H for COFFST.
53CC
OR A B7
OR Register A with itself: the Z FLAG for WPROT=N (00H).
53CD
RES 6,(IY+03H) FD CB 03 B6
Reset bit 6 of DCT+03H at Index Register IY+03H, the software write protect (RES does not change the flags).
53D1
If the Z FLAG is set (WPROT=N), JUMP to 53D7H with the bit cleared.
53D3
SET 6,(IY+03H) FD CB 03 F6
Set bit 6 of DCT+03H at Index Register IY+03H: the drive is write protected by the software.
53D7
LD DE,0000H 11 00 00
Load Register Pair DE with the value of COFFST, the operand 53D8H-53D9H (0000H in the file): FFFFH when it is not given.
53DA
LD A,D 7A
Load Register A with Register D, the high byte of COFFST.
53DB
AND E A3
AND Register A with Register E, the low byte: Register A = FFH only when COFFST is FFFFH.
53DC
INC A 3C
INCrement Register A by 1: the Z FLAG when COFFST was not given.
53DD
If the Z FLAG is set (no COFFST), JUMP to 53E5H for HOFFST.
53DF
LD (IY+06H),E FD 73 06
Store Register E, the low byte of the cylinder offset, into DCT+06H at Index Register IY+06H.
53E2
LD (IY+07H),D FD 72 07
Store Register D, the high byte of the cylinder offset, into DCT+07H at Index Register IY+07H.
53E5
LD DE,0000H 11 00 00
Load Register Pair DE with the value of HOFFST, the operand 53E6H-53E7H (0000H in the file): FFH in Register E when it is not given.
53E8
INC E 1C
INCrement Register E by 1: the Z FLAG when HOFFST was not given (FFH).
53E9
If the Z FLAG is set (no HOFFST), JUMP to 53EFH for TSIZE.
53EB
DEC E 1D
DECrement Register E by 1, back to the value of HOFFST.
53EC
LD (IY+05H),E FD 73 05
Store Register E, the head offset, into DCT+05H at Index Register IY+05H.
53EF
LD DE,0000H 11 00 00
Load Register Pair DE with the value of TSIZE, the operand 53F0H-53F1H (0000H in the file): FFH in Register E when it is not given.
53F2
INC E 1C
INCrement Register E by 1: the Z FLAG when TSIZE was not given (FFH).
53F3
If the Z FLAG is set (no TSIZE), JUMP to 53F9H for MDELAY.
53F5
DEC E 1D
DECrement Register E by 1, back to the value of TSIZE.
53F6
LD (IY+0DH),E FD 73 0D
Store Register E, the sectors per track, into DCT+0DH at Index Register IY+0DH.
53F9
LD DE,0000H 11 00 00
Load Register Pair DE with the value of MDELAY, the operand 53FAH-53FBH (0000H in the file): 53H in Register E when it is not given.
53FC
LD A,E 7B
Load Register A with Register E, the low byte of MDELAY.
53FD
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
53FF
If the Z FLAG is set (no MDELAY), JUMP to 540CH for HLOAD.
5401
OR A B7
OR Register A with itself: the Z FLAG for MDELAY=N (00H).
5402
RES 4,(IY+03H) FD CB 03 A6
Reset bit 4 of DCT+03H at Index Register IY+03H, the motor delay (RES does not change the flags).
5406
If the Z FLAG is set (MDELAY=N), JUMP to 540CH with the bit cleared.
5408
SET 4,(IY+03H) FD CB 03 E6
Set bit 4 of DCT+03H at Index Register IY+03H: a delay after the motor is turned on.
540C
LD DE,0000H 11 00 00
Load Register Pair DE with the value of HLOAD, the operand 540DH-540EH (0000H in the file): 53H in Register E when it is not given.
540F
LD A,E 7B
Load Register A with Register E, the low byte of HLOAD.
5410
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
5412
If the Z FLAG is set (no HLOAD), JUMP to 541FH for SKIP.
5414
OR A B7
OR Register A with itself: the Z FLAG for HLOAD=N (00H).
5415
RES 3,(IY+03H) FD CB 03 9E
Reset bit 3 of DCT+03H at Index Register IY+03H, the head load delay (RES does not change the flags).
5419
If the Z FLAG is set (HLOAD=N), JUMP to 541FH with the bit cleared.
541B
SET 3,(IY+03H) FD CB 03 DE
Set bit 3 of DCT+03H at Index Register IY+03H: a delay after the head is loaded.
541F
LD DE,0000H 11 00 00
Load Register Pair DE with the value of SKIP, the operand 5420H-5421H (0000H in the file): 53H in Register E when it is not given.
5422
LD A,E 7B
Load Register A with Register E, the low byte of SKIP.
5423
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
5425
RET Z C8
If the Z FLAG is set (no SKIP), RETurn to the overlay request handler: CONFIG is done.
5426
OR A B7
OR Register A with itself: the Z FLAG for SKIP=N (00H).
5427
RES 2,(IY+03H) FD CB 03 96
Reset bit 2 of DCT+03H at Index Register IY+03H, the double step (RES does not change the flags).
542B
RET Z C8
If the Z FLAG is set (SKIP=N), RETurn to the overlay request handler with the bit cleared.
542C
SET 2,(IY+03H) FD CB 03 D6
Set bit 2 of DCT+03H at Index Register IY+03H: the drive steps twice for each cylinder.
5430
RET C9
RETurn to the overlay request handler: CONFIG is done.
5431H - CONFIG's Texts
Data: the words of the description of a drive (527FH), each ended by 03H for DSPLY@ (NIL by a carriage return, which ends the line).
5431-5433
DEFM "NIL" 4E 49 4C
The description of a drive with the NIL bit set (5291H).
5434
DEFB 0DH 0D
The carriage return that ends the text NIL and the line of the drive.
5435-5438
DEFM "Hard" 48 61 72 64
The first word for a rigid drive (529EH), when bit 5 of DCT+03H is set.
5439
DEFB 03H 03
The byte that ends the text Hard for DSPLY@, which shows the text up to it.
543A-543D
DEFM ",Fix" 2C 46 69 78
The word for a rigid drive that is not removable (52A8H).
543E
DEFB 03H 03
The byte that ends the text ,Fix for DSPLY@, which shows the text up to it.
543F-5442
DEFM ",Rem" 2C 52 65 6D
The word for a removable rigid drive (52ADH).
5443
DEFB 03H 03
The byte that ends the text ,Rem for DSPLY@, which shows the text up to it.
5444-5449
DEFM "Floppy" 46 6C 6F 70 70 79
The first word for a floppy drive (52B5H), when bit 5 of DCT+03H is clear.
544A
DEFB 03H 03
The byte that ends the text Floppy for DSPLY@, which shows the text up to it.
544B-544F
DEFM ",Sden" 2C 53 64 65 6E
The word for a floppy drive in single density (52BFH).
5450
DEFB 03H 03
The byte that ends the text ,Sden for DSPLY@, which shows the text up to it.
5451-5455
DEFM ",Dden" 2C 44 64 65 6E
The word for a floppy drive in double density (52C4H).
5456
DEFB 03H 03
The byte that ends the text ,Dden for DSPLY@, which shows the text up to it.
5457-545C
DEFM ",Size=" 2C 53 69 7A 65 3D
The word before the size of the drive, 5 or 8 (52CAH).
545D
DEFB 03H 03
The byte that ends the text ,Size= for DSPLY@, which shows the text up to it.
545E-5464
DEFM ",Sides=" 2C 53 69 64 65 73 3D
The word before the number of surfaces (52DDH).
5465
DEFB 03H 03
The byte that ends the text ,Sides= for DSPLY@, which shows the text up to it.
5466-546B
DEFM ",Step=" 2C 53 74 65 70 3D
The word before the step rate code of the drive (52E9H).
546C
DEFB 03H 03
The byte that ends the text ,Step= for DSPLY@, which shows the text up to it.
546D-5470
DEFM ",PD=" 2C 50 44 3D
The word before the physical drive number of the drive (52F5H).
5471
DEFB 03H 03
The byte that ends the text ,PD= for DSPLY@, which shows the text up to it.
5472-5474
DEFM ",WP" 2C 57 50
The word for a drive write protected by the software (5307H, 535CH).
5475
DEFB 03H 03
The byte that ends the text ,WP for DSPLY@, which shows the text up to it.
5476-5478
DEFM ",MD" 2C 4D 44
The word for a floppy drive with the motor delay (5311H).
5479
DEFB 03H 03
The byte that ends the text ,MD for DSPLY@, which shows the text up to it.
547A-547C
DEFM ",HL" 2C 48 4C
The word for a floppy drive with the head load delay (531BH).
547D
DEFB 03H 03
The byte that ends the text ,HL for DSPLY@, which shows the text up to it.
547E-5482
DEFM ",Skip" 2C 53 6B 69 70
The word for a floppy drive that steps twice for each cylinder (5325H).
5483
DEFB 03H 03
The byte that ends the text ,Skip for DSPLY@, which shows the text up to it.
5484-5487
DEFM ",CO=" 2C 43 4F 3D
The word before the cylinder offset of a rigid drive (5335H).
5488
DEFB 03H 03
The byte that ends the text ,CO= for DSPLY@, which shows the text up to it.
5489-548C
DEFM ",HO=" 2C 48 4F 3D
The word before the head offset of a rigid drive (5344H).
548D
DEFB 03H 03
The byte that ends the text ,HO= for DSPLY@, which shows the text up to it.
548E-5491
DEFM ",TS=" 2C 54 53 3D
The word before the sectors per track of a rigid drive (5350H).
5492
DEFB 03H 03
The byte that ends the text ,TS= for DSPLY@, which shows the text up to it.
5493H - CONFIG's Evaluation Block
Data: the block that Index Register IX points to for EVAL@ (5230H): EVAL@'s flags, the three field blocks, all 58C0H, and the parameter table. Each entry is the name (6 characters), the address its value is stored to (the operands of 536CH) and a type byte (20H a switch, 40H a number). EVAL@ takes the first entry whose name starts with what is typed, so S picks SIDES, the first name that starts with S, and not STEP as the manual says.
5493
DEFB 00H 00
The flags of CONFIG's evaluation block, set by EVAL@: bits 0-2 the fields, bit 3 the parameters.
5494-5495
DEFW 58C0H C0 58
The address of the source block, 58C0H: the flag byte, then the drive.
5496-5497
DEFW 58C0H C0 58
The address of the destination block: 58C0H again, so any field goes to the one block.
5498-5499
DEFW 58C0H C0 58
The address of the wildmask block: 58C0H again, so any field goes to the one block.
549A-549B
DEFW 549CH 9C 54
The address of CONFIG's parameter table at 549CH.
549C-54A1
DEFM "SIDES " 53 49 44 45 53 20
The name SIDES: the number of surfaces of the drive, DCT+0CH.
54A2-54A3
DEFW 538AH 8A 53
SIDES's value goes to 538AH-538BH, the operand of LD DE,0000H at 5389H.
54A4
DEFB 40H 40
The type byte of SIDES: 40H, bit 6, a number, the count of surfaces.
54A5-54AA
DEFM "SIZE " 53 49 5A 45 20 20
The name SIZE: 5 or 8, the size of the drive, bit 7 of DCT+03H.
54AB-54AC
DEFW 5397H 97 53
SIZE's value goes to 5397H-5398H, the operand of LD DE,0000H at 5396H.
54AD
DEFB 40H 40
The type byte of SIZE: 40H, bit 6, a number, 5 or 8.
54AE-54B3
DEFM "STEP " 53 54 45 50 20 20
The name STEP: the step rate code of the drive, DCT+04H.
54B4-54B5
DEFW 53B1H B1 53
STEP's value goes to 53B1H-53B2H, the operand of LD DE,0000H at 53B0H.
54B6
DEFB 40H 40
The type byte of STEP: 40H, bit 6, a number, the step rate code.
54B7-54BC
DEFM "PDRIVE" 50 44 52 49 56 45
The name PDRIVE: the physical drive the drive name uses, DCT+0AH.
54BD-54BE
DEFW 53BBH BB 53
PDRIVE's value goes to 53BBH-53BCH, the operand of LD DE,0000H at 53BAH.
54BF
DEFB 40H 40
The type byte of PDRIVE: 40H, bit 6, a number, the physical drive.
54C0-54C5
DEFM "COFFST" 43 4F 46 46 53 54
The name COFFST: the cylinder offset of a rigid drive, DCT+06H-07H.
54C6-54C7
DEFW 53D8H D8 53
COFFST's value goes to 53D8H-53D9H, the operand of LD DE,0000H at 53D7H.
54C8
DEFB 40H 40
The type byte of COFFST: 40H, bit 6, a number, the cylinder offset.
54C9-54CE
DEFM "HOFFST" 48 4F 46 46 53 54
The name HOFFST: the head offset of a rigid drive, DCT+05H.
54CF-54D0
DEFW 53E6H E6 53
HOFFST's value goes to 53E6H-53E7H, the operand of LD DE,0000H at 53E5H.
54D1
DEFB 40H 40
The type byte of HOFFST: 40H, bit 6, a number, the head offset.
54D2-54D7
DEFM "TSIZE " 54 53 49 5A 45 20
The name TSIZE: the sectors per track of the drive, DCT+0DH.
54D8-54D9
DEFW 53F0H F0 53
TSIZE's value goes to 53F0H-53F1H, the operand of LD DE,0000H at 53EFH.
54DA
DEFB 40H 40
The type byte of TSIZE: 40H, bit 6, a number, the sectors per track.
54DB-54E0
DEFM "WPROT " 57 50 52 4F 54 20
The name WPROT: the software write protect, bit 6 of DCT+03H.
54E1-54E2
DEFW 53C5H C5 53
WPROT's value goes to 53C5H-53C6H, the operand of LD DE,0000H at 53C4H.
54E3
DEFB 20H 20
The type byte of WPROT: 20H, bit 5, a switch, so the name alone sets it.
54E4-54E9
DEFM "MDELAY" 4D 44 45 4C 41 59
The name MDELAY: the delay after the motor is turned on, bit 4 of DCT+03H.
54EA-54EB
DEFW 53FAH FA 53
MDELAY's value goes to 53FAH-53FBH, the operand of LD DE,0000H at 53F9H.
54EC
DEFB 20H 20
The type byte of MDELAY: 20H, bit 5, a switch, so the name alone sets it.
54ED-54F2
DEFM "HLOAD " 48 4C 4F 41 44 20
The name HLOAD: the delay after the head is loaded, bit 3 of DCT+03H.
54F3-54F4
DEFW 540DH 0D 54
HLOAD's value goes to 540DH-540EH, the operand of LD DE,0000H at 540CH.
54F5
DEFB 20H 20
The type byte of HLOAD: 20H, bit 5, a switch, so the name alone sets it.
54F6-54FB
DEFM "SKIP " 53 4B 49 50 20 20
The name SKIP: the double step, bit 2 of DCT+03H.
54FC-54FD
DEFW 5420H 20 54
SKIP's value goes to 5420H-5421H, the operand of LD DE,0000H at 541FH.
54FE
DEFB 20H 20
The type byte of SKIP: 20H, bit 5, a switch, so the name alone sets it.
54FF
DEFB 00H 00
The end of CONFIG's parameter table: a 00H in place of the next name.
5500H - SYSTEM
Routine 4, entered from CMNDI@ through the overlay request handler with Register Pair HL at the rest of the command line. The switches TIME, DATE, LOGO, BLINK and CAPS start as 53H (not given), SAVE, the low bytes of CURSOR and HIGH$ and the write flag 564BH as 00H, the high bytes of STEP, PORT and MODE as FFH (table 57D3H). EVAL@ takes the field and the parameters with the block at 57CAH. Without a field and without parameters the memory pointers LOW$, HIGH$ and TOP$ are shown in hexadecimal (5539H). Otherwise the options are set (5563H), and a field names the configuration file to write (565FH).
5500
LD A,53H 3E 53
Load Register A with 53H, the mark of a switch that was not given.
5502
LD (55D1H),A 32 D1 55
Store Register A (53H) into 55D1H, the operand of LD DE,0000H at 55D0H, the value of TIME.
5505
LD (55C2H),A 32 C2 55
Store Register A (53H) into 55C2H, the operand of LD DE,0000H at 55C1H, the value of DATE.
5508
LD (55B3H),A 32 B3 55
Store Register A (53H) into 55B3H, the operand of LD DE,0000H at 55B2H, the value of LOGO.
550B
LD (55FEH),A 32 FE 55
Store Register A (53H) into 55FEH, the operand of LD DE,0000H at 55FDH, the value of BLINK.
550E
LD (560AH),A 32 0A 56
Store Register A (53H) into 560AH, the operand of LD DE,0000H at 5609H, the value of CAPS.
5511
XOR A AF
Set Register A to 00H by XORing it with itself, the value of SAVE, CURSOR and HIGH$ not given.
5512
LD (5632H),A 32 32 56
Store Register A (00H) into 5632H, the operand of LD DE,0000H at 5631H, the value of SAVE.
5515
LD (564BH),A 32 4B 56
Store Register A (00H) into 564BH, the operand of LD A,00H at 564AH, the flag that the boot sector is to be written.
5518
LD (5615H),A 32 15 56
Store Register A (00H) into 5615H, the low byte of the operand of LD DE,FFFFH at 5614H, the value of CURSOR.
551B
LD (561FH),A 32 1F 56
Store Register A (00H) into 561FH, the low byte of the operand of LD DE,0000H at 561EH, the value of HIGH$.
551E
DEC A 3D
DECrement Register A by 1: FFH, the high byte that marks STEP, PORT and MODE as not given.
551F
LD (55E1H),A 32 E1 55
Store Register A (FFH) into 55E1H, the high byte of the operand of LD DE,0000H at 55DFH, the value of STEP.
5522
LD (55EBH),A 32 EB 55
Store Register A (FFH) into 55EBH, the high byte of the operand of LD DE,0000H at 55E9H, the value of PORT.
5525
LD (55F5H),A 32 F5 55
Store Register A (FFH) into 55F5H, the high byte of the operand of LD DE,0000H at 55F3H, the value of MODE.
5528
LD IX,57CAH DD 21 CA 57
Point Index Register IX to 57CAH, SYSTEM's evaluation block: the field block 58C0H and the parameter table 57D3H.
552C
GOSUB to 4479H, EVAL@, to take the fields and parameters from the command line at Register Pair HL: the NZ FLAG on an error.
552F
If the NZ FLAG is set (EVAL@ failed), JUMP to 58BBH to post the error in Register A.
5532
LD A,(IX+00H) DD 7E 00
Load Register A with the flags of the evaluation block at Index Register IX+00H: bits 0-2 the fields, bit 3 the parameters.
5535
AND 0FH E6 0F
AND Register A with 0FH, bits 0-3: the Z FLAG when neither a field nor a parameter was given.
5537
If the NZ FLAG is set (something given), JUMP to 5563H to set the options.
5539
LD HL,57B2H 21 B2 57
Point Register Pair HL to 57B2H, the text LOW$=.
553C
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
553F
LD HL,(4047H) 2A 47 40
Load Register Pair HL with LOW$, the bottom of free memory, from 4047H-4048H.
5542
GOSUB to 588FH to show Register Pair HL as four hexadecimal digits and an H.
5545
LD HL,57B8H 21 B8 57
Point Register Pair HL to 57B8H, the text ,HIGH$=.
5548
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
554B
LD HL,(4049H) 2A 49 40
Load Register Pair HL with HIGH$, the top of memory for programs, from 4049H-404AH.
554E
GOSUB to 588FH to show Register Pair HL as four hexadecimal digits and an H.
5551
LD HL,57C0H 21 C0 57
Point Register Pair HL to 57C0H, the text ,TOP$=.
5554
GOSUB to 4467H, DSPLY@, to show the text at Register Pair HL.
5557
LD HL,(4358H) 2A 58 43
Load Register Pair HL with TOP$, the top of the memory, from 4358H-4359H.
555A
GOSUB to 588FH to show Register Pair HL as four hexadecimal digits and an H.
555D
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the line.
555F
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
5562
RET C9
RETurn to the overlay request handler: SYSTEM has shown the memory pointers.
5563H - Setting the Options
When DATE, TIME, LOGO, STEP, PORT, MODE or SAVE is given, sector 2 of cylinder 0 of drive 0, the boot sector with the system's options, is read into 4200H and the flag 564BH is set so that it is written back (564AH). DATE, TIME and LOGO set or clear bits 2, 3 and 1 of its +10H, the boot flags; STEP, PORT and MODE go to its +16H, +17H and +18H. BLINK (the complement of its value) goes to 401CH, CAPS to 4019H, CURSOR (not 0) to 4023H, and HIGH$ (0100H or more) to HIGH$ at 4049H, which must stay above 5BFFH (error 2DH). These four take effect at once; SAVE copies the first three into the boot sector's +13H-+15H. HIGH$ is never saved.
5563
LD A,(55C2H) 3A C2 55
Load Register A with the value of DATE from 55C2H: 53H when it is not given.
5566
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
5568
If the NZ FLAG is set (DATE given), JUMP to 5590H to read the boot sector.
556A
LD A,(55D1H) 3A D1 55
Load Register A with the value of TIME from 55D1H: 53H when it is not given.
556D
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
556F
If the NZ FLAG is set (TIME given), JUMP to 5590H to read the boot sector.
5571
LD A,(55B3H) 3A B3 55
Load Register A with the value of LOGO from 55B3H: 53H when it is not given.
5574
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
5576
If the NZ FLAG is set (LOGO given), JUMP to 5590H to read the boot sector.
5578
LD A,(55E1H) 3A E1 55
Load Register A with the high byte of STEP's value from 55E1H: FFH when it is not given.
557B
INC A 3C
INCrement Register A by 1: the NZ FLAG when STEP was given.
557C
If the NZ FLAG is set (STEP given), JUMP to 5590H to read the boot sector.
557E
LD A,(55EBH) 3A EB 55
Load Register A with the high byte of PORT's value from 55EBH: FFH when it is not given.
5581
INC A 3C
INCrement Register A by 1: the NZ FLAG when PORT was given.
5582
If the NZ FLAG is set (PORT given), JUMP to 5590H to read the boot sector.
5584
LD A,(55F5H) 3A F5 55
Load Register A with the high byte of MODE's value from 55F5H: FFH when it is not given.
5587
INC A 3C
INCrement Register A by 1: the NZ FLAG when MODE was given.
5588
If the NZ FLAG is set (MODE given), JUMP to 5590H to read the boot sector.
558A
LD A,(5632H) 3A 32 56
Load Register A with the value of SAVE from 5632H: 00H when it is not given.
558D
OR A B7
OR Register A with itself: the NZ FLAG when SAVE was given.
558E
If the Z FLAG is set (no option of the boot sector), JUMP to 55E9H, past the boot sector's options, for BLINK, CAPS, CURSOR and HIGH$.
5590
LD A,FFH 3E FF
Load Register A with FFH, the mark that the boot sector is to be written back.
5592
LD (564BH),A 32 4B 56
Store Register A (FFH) into 564BH, the operand of LD A,00H at 564AH.
5595
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H: Register D cylinder 0, Register E sector 2, the boot sector with the options.
5598
LD HL,4200H 21 00 42
Point Register Pair HL to 4200H, the buffer for the boot sector.
559B
LD C,00H 0E 00
Load Register C with 00H, drive 0, the system drive.
559D
GOSUB to 448BH, LOCDCT%, to point Index Register IY to the drive control table of drive 0 in Register C.
55A0
RES 7,(IY+0BH) FD CB 0B BE
Reset bit 7 of DCT+0BH at Index Register IY+0BH, the double density bit, so that cylinder 0 is read in single density.
55A4
SET 0,(IY+03H) FD CB 03 C6
Set bit 0 of DCT+03H at Index Register IY+03H, so that the diskette is logged again at its next use.
55A8
LD A,03H 3E 03
Load Register A with 03H, the DISKIO% function DREAD, which reads a sector into the buffer.
55AA
GOSUB to 4485H, DISKIO%, function 3 DREAD, to read sector Register E of cylinder Register D of drive Register C to 4200H.
55AD
If the NZ FLAG is set (the read failed), JUMP to 58BBH to post the error in Register A.
55B0
LD L,10H 2E 10
Load Register L with 10H: Register Pair HL = 4210H, the boot flags of the boot sector.
55B2
LD DE,0000H 11 00 00
Load Register Pair DE with the value of LOGO, the operand 55B3H-55B4H (0000H in the file): 53H in Register E when it is not given.
55B5
LD A,E 7B
Load Register A with Register E, the low byte of LOGO.
55B6
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
55B8
If the Z FLAG is set (no LOGO), JUMP to 55C1H for DATE.
55BA
OR A B7
OR Register A with itself: the Z FLAG for LOGO=N (00H).
55BB
RES 1,(HL) CB 8E
Reset bit 1 of the boot flags at Register Pair HL, the logo (RES does not change the flags).
55BD
If the Z FLAG is set (LOGO=N), JUMP to 55C1H with the bit cleared.
55BF
SET 1,(HL) CB CE
Set bit 1 of the boot flags at Register Pair HL: the logo is shown at boot.
55C1
LD DE,0000H 11 00 00
Load Register Pair DE with the value of DATE, the operand 55C2H-55C3H (0000H in the file): 53H in Register E when it is not given.
55C4
LD A,E 7B
Load Register A with Register E, the low byte of DATE.
55C5
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
55C7
If the Z FLAG is set (no DATE), JUMP to 55D0H for TIME.
55C9
OR A B7
OR Register A with itself: the Z FLAG for DATE=N (00H).
55CA
RES 2,(HL) CB 96
Reset bit 2 of the boot flags at Register Pair HL, the date prompt (RES does not change the flags).
55CC
If the Z FLAG is set (DATE=N), JUMP to 55D0H with the bit cleared.
55CE
SET 2,(HL) CB D6
Set bit 2 of the boot flags at Register Pair HL: the date is asked for at boot.
55D0
LD DE,0000H 11 00 00
Load Register Pair DE with the value of TIME, the operand 55D1H-55D2H (0000H in the file): 53H in Register E when it is not given.
55D3
LD A,E 7B
Load Register A with Register E, the low byte of TIME.
55D4
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
55D6
If the Z FLAG is set (no TIME), JUMP to 55DFH for STEP.
55D8
OR A B7
OR Register A with itself: the Z FLAG for TIME=N (00H).
55D9
RES 3,(HL) CB 9E
Reset bit 3 of the boot flags at Register Pair HL, the time prompt (RES does not change the flags).
55DB
If the Z FLAG is set (TIME=N), JUMP to 55DFH with the bit cleared.
55DD
SET 3,(HL) CB DE
Set bit 3 of the boot flags at Register Pair HL: the time is asked for at boot.
55DF
LD DE,0000H 11 00 00
Load Register Pair DE with the value of STEP, the operand 55E0H-55E1H (0000H in the file): FFH in Register D when it is not given.
55E2
INC D 14
INCrement Register D by 1: the Z FLAG when STEP was not given.
55E3
If the Z FLAG is set (no STEP), JUMP to 55E9H for PORT.
55E5
LD A,E 7B
Load Register A with Register E, the low byte of STEP, the default step rate.
55E6
LD (4216H),A 32 16 42
Store Register A, the default step rate, into 4216H, +16H of the boot sector.
55E9
LD DE,0000H 11 00 00
Load Register Pair DE with the value of PORT, the operand 55EAH-55EBH (0000H in the file): FFH in Register D when it is not given.
55EC
INC D 14
INCrement Register D by 1: the Z FLAG when PORT was not given.
55ED
If the Z FLAG is set (no PORT), JUMP to 55F3H for MODE.
55EF
LD A,E 7B
Load Register A with Register E, the low byte of PORT, the port to output to at boot.
55F0
LD (4217H),A 32 17 42
Store Register A, the port, into 4217H, +17H of the boot sector.
55F3
LD DE,0000H 11 00 00
Load Register Pair DE with the value of MODE, the operand 55F4H-55F5H (0000H in the file): FFH in Register D when it is not given.
55F6
INC D 14
INCrement Register D by 1: the Z FLAG when MODE was not given.
55F7
If the Z FLAG is set (no MODE), JUMP to 55FDH for BLINK.
55F9
LD A,E 7B
Load Register A with Register E, the low byte of MODE, the value to output at boot.
55FA
LD (4218H),A 32 18 42
Store Register A, the value for the port, into 4218H, +18H of the boot sector.
55FD
LD DE,0000H 11 00 00
Load Register Pair DE with the value of BLINK, the operand 55FEH-55FFH (0000H in the file): 53H in Register E when it is not given.
5600
LD A,E 7B
Load Register A with Register E, the low byte of BLINK.
5601
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
5603
If the Z FLAG is set (no BLINK), JUMP to 5609H for CAPS.
5605
CPL 2F
Complement Register A: BLINK=Y (FFH) gives 00H, BLINK=N (00H) gives FFH.
5606
LD (401CH),A 32 1C 40
Store Register A, the complement of BLINK, into 401CH, the cursor blink switch.
5609
LD DE,0000H 11 00 00
Load Register Pair DE with the value of CAPS, the operand 560AH-560BH (0000H in the file): 53H in Register E when it is not given.
560C
LD A,E 7B
Load Register A with Register E, the low byte of CAPS.
560D
CP 53H FE 53
Compare Register A against 53H, the mark of a switch that was not given.
560F
If the Z FLAG is set (no CAPS), JUMP to 5614H for CURSOR.
5611
LD (4019H),A 32 19 40
Store Register A, the value of CAPS, into 4019H, the caps switch of the keyboard.
5614
LD DE,FFFFH 11 FF FF
Load Register Pair DE with the value of CURSOR, the operand 5615H-5616H (FFFFH in the file): 00H in Register E when it is not given.
5617
LD A,E 7B
Load Register A with Register E, the low byte of CURSOR, the cursor character.
5618
OR A B7
OR Register A with itself: the Z FLAG for 00H, CURSOR not given (or given as 0).
5619
If the Z FLAG is set (no CURSOR), JUMP to 561EH for HIGH$.
561B
LD (4023H),A 32 23 40
Store Register A, the cursor character, into 4023H.
561E
LD DE,0000H 11 00 00
Load Register Pair DE with the value of HIGH$, the operand 561FH-5620H (0000H in the file): 00H in Register E when it is not given.
5621
LD A,D 7A
Load Register A with Register D, the high byte of HIGH$.
5622
OR A B7
OR Register A with itself, which also clears the C FLAG: the Z FLAG when HIGH$ is below 0100H.
5623
If the Z FLAG is set (no HIGH$), JUMP to 5631H for SAVE.
5625
LD HL,5BFFH 21 FF 5B
Load Register Pair HL with 5BFFH, the highest address HIGH$ may not be.
5628
SBC HL,DE ED 52
Subtract Register Pair DE (HIGH$) from Register Pair HL (5BFFH): the NC FLAG when HIGH$ is 5BFFH or below.
562A
If the NC FLAG is set (HIGH$ too low), JUMP to 58B0H to post error 2DH, Invalid data provided.
562D
LD (4049H),DE ED 53 49 40
Store Register Pair DE, the new top of memory, into HIGH$ at 4049H-404AH (it is not checked against TOP$).
5631
LD DE,0000H 11 00 00
Load Register Pair DE with the value of SAVE, the operand 5632H-5633H (0000H in the file): 00H in Register E when it is not given.
5634
INC E 1C
INCrement Register E by 1, so that the DEC E below tests the low byte of SAVE.
5635
DEC E 1D
DECrement Register E by 1: the Z FLAG when SAVE is not given, or N.
5636
If the Z FLAG is set (no SAVE), JUMP to 564AH to write the boot sector if needed.
5638
LD A,(401CH) 3A 1C 40
Load Register A with the cursor blink switch from 401CH.
563B
LD (4213H),A 32 13 42
Store Register A, the cursor blink switch, into 4213H, +13H of the boot sector.
563E
LD A,(4023H) 3A 23 40
Load Register A with the cursor character from 4023H.
5641
LD (4214H),A 32 14 42
Store Register A, the cursor character, into 4214H, +14H of the boot sector.
5644
LD A,(4019H) 3A 19 40
Load Register A with the caps switch from 4019H.
5647
LD (4215H),A 32 15 42
Store Register A, the caps switch, into 4215H, +15H of the boot sector.
564A
LD A,00H 3E 00
Load Register A with the write flag, 00H as assembled, FFH when the boot sector was read (5592H).
564C
OR A B7
OR Register A with itself: the Z FLAG when the boot sector is not to be written.
564D
If the Z FLAG is set (nothing to write), JUMP to 565FH for the field.
564F
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H: Register D cylinder 0, Register E sector 2, the boot sector.
5652
LD HL,4200H 21 00 42
Point Register Pair HL to 4200H, the boot sector with its changed options.
5655
LD C,00H 0E 00
Load Register C with 00H, drive 0, the system drive.
5657
LD A,05H 3E 05
Load Register A with 05H, the DISKIO% function DWRITE, which writes the buffer to a sector.
5659
GOSUB to 4485H, DISKIO%, function 5 DWRITE, to write 4200H to sector Register E of cylinder Register D of drive Register C.
565C
If the NZ FLAG is set (the write failed), JUMP to 58BBH to post the error in Register A.
565FH - The Configuration File
With a field SYSTEM writes a configuration file: the field must have a name (else error 2CH), which gets the default extension CFG, and INIT@ opens it with the buffer 5900H. The image is built from 5A00H: the 140 bytes of the loader (5726H, which runs at 5200H), then the system areas listed at 5790H, then the memory from HIGH$ + 1 to TOP$ (the drivers and filters above HIGH$). The image is written as a load module whose blocks load at their image address less 0800H (5A00H becomes 5200H), up to 254 bytes each, and a transfer record to 5200H ends it; CLOSE@ closes the file. Run as a program, the file restores the system's state as it was when it was saved.
565F
LD A,(IX+00H) DD 7E 00
Load Register A with the flags of the evaluation block at Index Register IX+00H: bits 0-2 the fields given.
5662
AND 07H E6 07
AND Register A with 07H, bits 0-2: the Z FLAG when no field was given.
5664
RET Z C8
If the Z FLAG is set (no field), RETurn to the overlay request handler: SYSTEM is done.
5665
LD A,(58C0H) 3A C0 58
Load Register A with the flag byte of the field block at 58C0H.
5668
BIT 6,A CB 77
Test bit 6 of Register A, the flag byte: set when the field has a name.
566A
If the Z FLAG is set (no name), JUMP to 58B6H to post error 2CH, Illegal filespec.
566D
LD HL,57C7H 21 C7 57
Point Register Pair HL to 57C7H, the default extension CFG.
5670
LD DE,58C1H 11 C1 58
Point Register Pair DE to 58C1H, the file control block of the field.
5673
GOSUB to 4473H, FEXT@, to add the extension at Register Pair HL to the specification at Register Pair DE when it has none.
5676
LD B,00H 06 00
Load Register B with 00H, the record length 256 for INIT@.
5678
LD HL,5900H 21 00 59
Point Register Pair HL to 5900H, the buffer of the file's sectors.
567B
GOSUB to 4420H, INIT@, to open the file at Register Pair DE with the buffer at Register Pair HL and the record length in Register B, creating it when needed: the NZ FLAG on an error.
567E
If the NZ FLAG is set (INIT@ failed), JUMP to 58BBH to post the error in Register A.
5681
LD HL,5726H 21 26 57
Point Register Pair HL to 5726H, the loader of the configuration file.
5684
LD BC,008CH 01 8C 00
Load Register Pair BC with 008CH, the 140 bytes of the loader.
5687
LD DE,5A00H 11 00 5A
Point Register Pair DE to 5A00H, the start of the image of the file.
568A
LDIR ED B0
Copy the loader from Register Pair HL to Register Pair DE (5A00H) by LDIR. Register Pair BC counts down.
568C
LD IX,5790H DD 21 90 57
Point Index Register IX to 5790H, the table of the system areas to save: an address and a length each.
5690
LD L,(IX+00H) DD 6E 00
Load Register L with the low byte of the area's address at Index Register IX+00H.
5693
LD H,(IX+01H) DD 66 01
Load Register H with the high byte of the area's address at Index Register IX+01H.
5696
INC H 24
INCrement Register H by 1, so that the DEC H below tests the high byte of the address.
5697
DEC H 25
DECrement Register H by 1: the Z FLAG when the high byte is 00H, the end of the table.
5698
If the Z FLAG is set (the end of the table), JUMP to 56ABH for the high memory.
569A
LD C,(IX+02H) DD 4E 02
Load Register C with the low byte of the area's length at Index Register IX+02H.
569D
LD B,(IX+03H) DD 46 03
Load Register B with the high byte of the area's length at Index Register IX+03H.
56A0
LDIR ED B0
Copy the area from Register Pair HL to the image at Register Pair DE by LDIR. Register Pair BC counts down.
56A2
EX DE,HL EB
EXchange Register Pair DE and Register Pair HL, to keep the image's next address in Register Pair HL.
56A3
LD DE,0004H 11 04 00
Load Register Pair DE with 0004H, the length of an entry of the table.
56A6
ADD IX,DE DD 19
ADD Register Pair DE to Index Register IX, to the next entry of the table.
56A8
EX DE,HL EB
EXchange Register Pair DE and Register Pair HL: Register Pair DE = the image's next address again.
56A9
JUMP back to 5690H for the next area of the table.
56AB
PUSH DE D5
Save Register Pair DE, the image's next address, to the top of the stack.
56AC
LD HL,(4358H) 2A 58 43
Load Register Pair HL with TOP$, the top of the memory, from 4358H-4359H.
56AF
LD DE,(4049H) ED 5B 49 40
Load Register Pair DE with HIGH$, the top of memory for programs, from 4049H-404AH.
56B3
SBC HL,DE ED 52
Subtract Register Pair DE (HIGH$) from Register Pair HL (TOP$): the bytes above HIGH$, the Z FLAG when there are none.
56B5
LD B,H 44
Load Register B with Register H, the high byte of the count.
56B6
LD C,L 4D
Load Register C with Register L: Register Pair BC = the bytes above HIGH$.
56B7
EX DE,HL EB
EXchange Register Pair DE and Register Pair HL: Register Pair HL = HIGH$.
56B8
INC HL 23
INCrement Register Pair HL by 1, to the first byte above HIGH$ (INC does not change the flags).
56B9
POP DE D1
Restore Register Pair DE, the image's next address, from the top of the stack.
56BA
If the Z FLAG is set (nothing above HIGH$), JUMP to 56BEH.
56BC
LDIR ED B0
Copy the memory above HIGH$ from Register Pair HL to the image at Register Pair DE by LDIR. Register Pair BC counts down.
56BE
LD HL,5A00H 21 00 5A
Point Register Pair HL to 5A00H, the start of the image to write.
56C1
PUSH HL E5
Save Register Pair HL, the next byte of the image to write, to the top of the stack.
56C2
PUSH DE D5
Save Register Pair DE, the end of the image, to the top of the stack.
56C3
EX DE,HL EB
EXchange Register Pair DE and Register Pair HL: Register Pair HL = the end, Register Pair DE = the next byte.
56C4
OR A B7
OR Register A with itself to clear the C FLAG for the SBC below.
56C5
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: the bytes of the image still to write, the Z FLAG when none are left.
56C7
POP DE D1
Restore Register Pair DE, the end of the image, from the top of the stack.
56C8
If the Z FLAG is set (the image is written), JUMP to 56FBH for the transfer record.
56CA
LD B,FEH 06 FE
Load Register B with FEH, the 254 bytes of a full load block.
56CC
INC H 24
INCrement Register H by 1, so that the DEC H below tests the high byte of the count.
56CD
DEC H 25
DECrement Register H by 1: the NZ FLAG when 256 bytes or more are left.
56CE
If the NZ FLAG is set (256 or more), JUMP to 56D6H with a full block.
56D0
LD A,L 7D
Load Register A with Register L, the low byte of the count, the bytes left.
56D1
CP FFH FE FF
Compare Register A against FFH: the NC FLAG when 255 bytes are left.
56D3
If the NC FLAG is set (255 left), JUMP to 56D6H with a full block.
56D5
LD B,L 45
Load Register B with Register L, the bytes left, for the last block.
56D6
POP HL E1
Restore Register Pair HL, the next byte of the image, from the top of the stack.
56D7
LD A,01H 3E 01
Load Register A with 01H, the record type of a load block.
56D9
GOSUB to 571AH to write the byte in Register A to the configuration file.
56DC
LD A,B 78
Load Register A with Register B, the bytes of the block.
56DD
ADD A,02H C6 02
ADD 02H, the two bytes of the address, to Register A: the length byte of the block.
56DF
GOSUB to 571AH to write the length byte in Register A to the configuration file.
56E2
PUSH BC C5
Save Register Pair BC, the bytes of the block, to the top of the stack.
56E3
PUSH HL E5
Save Register Pair HL, the next byte of the image, to the top of the stack.
56E4
LD BC,F800H 01 00 F8
Load Register Pair BC with F800H, which takes 0800H off an address.
56E7
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: the load address of the block, its image address less 0800H.
56E8
LD A,L 7D
Load Register A with Register L, the low byte of the load address.
56E9
GOSUB to 571AH to write the byte in Register A to the configuration file.
56EC
LD A,H 7C
Load Register A with Register H, the high byte of the load address.
56ED
GOSUB to 571AH to write the byte in Register A to the configuration file.
56F0
POP HL E1
Restore Register Pair HL, the next byte of the image, from the top of the stack.
56F1
POP BC C1
Restore Register Pair BC, the bytes of the block, from the top of the stack.
56F2
LD A,(HL) 7E
Load Register A with the byte of the image at Register Pair HL.
56F3
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the image.
56F4
GOSUB to 571AH to write the byte in Register A to the configuration file.
56F7
DECrement Register B and LOOP back to 56F2H until the bytes of the block are written.
56F9
JUMP back to 56C1H for the next block of the image.
56FB
POP HL E1
Restore Register Pair HL from the top of the stack, the address left there at 56C1H.
56FC
LD A,02H 3E 02
Load Register A with 02H, the record type of the transfer record.
56FE
GOSUB to 571AH to write the byte in Register A to the configuration file.
5701
LD A,02H 3E 02
Load Register A with 02H, the length byte of the transfer record.
5703
GOSUB to 571AH to write the byte in Register A to the configuration file.
5706
LD A,00H 3E 00
Load Register A with 00H, the low byte of the transfer address 5200H.
5708
GOSUB to 571AH to write the byte in Register A to the configuration file.
570B
LD A,52H 3E 52
Load Register A with 52H, the high byte of the transfer address 5200H, the loader.
570D
GOSUB to 571AH to write the byte in Register A to the configuration file.
5710
LD DE,58C1H 11 C1 58
Point Register Pair DE to 58C1H, the file control block of the configuration file.
5713
GOSUB to 4428H, CLOSE@, to close the file at Register Pair DE: the NZ FLAG on an error.
5716
If the NZ FLAG is set (CLOSE@ failed), JUMP to 58BBH to post the error in Register A.
5719
RET C9
RETurn to the overlay request handler: SYSTEM has written the configuration file.
571AH - Write a Byte
Puts the byte in Register A to the configuration file at 58C1H through the ROM's 001BH; an error is posted.
571A
PUSH DE D5
Save Register Pair DE to the top of the stack, to keep it over the write.
571B
LD DE,58C1H 11 C1 58
Point Register Pair DE to 58C1H, the file control block of the configuration file.
571E
GOSUB to 001BH, the ROM's routine that puts the byte in Register A to the file at Register Pair DE: the NZ FLAG on an error.
5721
POP DE D1
Restore Register Pair DE from the top of the stack.
5722
If the NZ FLAG is set (the write failed), JUMP to 58BBH to post the error in Register A.
5725
RET C9
RETurn to the caller: the byte is written to the configuration file.
5726H - The Loader of a Configuration File
Code that SYSTEM copies to 5A00H (5681H) and writes to the file to load at 5200H, so it runs at 5200H, 0526H lower than here; its absolute addresses are those it has there (526AH the table, 528CH the saved data). With the interrupts off it keeps the cursor position (4020H) and the resident overlay bytes (430AH), copies each saved area back to its place, then the memory above HIGH$ (HIGH$ is already restored), sets bit 0 of DCT+03H of every drive with a driver so that each diskette is logged again, resets the RS-232 interface (port E8H) and sends it the baud rate (4305H) and control (4306H) bytes, puts back 430AH and the cursor position, and RETurns with the interrupts on.
5726
DI F3
Disable the interrupts while the system areas are copied back.
5727
LD HL,(4020H) 2A 20 40
Load Register Pair HL with the cursor position from 4020H-4021H, which the saved areas must not change.
572A
PUSH HL E5
Save Register Pair HL, the cursor position, to the top of the stack.
572B
LD HL,(430AH) 2A 0A 43
Load Register Pair HL with the resident overlay bytes from 430AH-430BH, which describe the overlays now in memory.
572E
PUSH HL E5
Save Register Pair HL, the resident overlay bytes, to the top of the stack.
572F
LD IX,526AH DD 21 6A 52
Point Index Register IX to 526AH, where the table of the saved areas is when the loader runs at 5200H.
5733
LD HL,528CH 21 8C 52
Point Register Pair HL to 528CH, where the saved data starts when the loader runs at 5200H.
5736
LD E,(IX+00H) DD 5E 00
Load Register E with the low byte of the area's address at Index Register IX+00H.
5739
LD D,(IX+01H) DD 56 01
Load Register D with the high byte of the area's address at Index Register IX+01H.
573C
INC D 14
INCrement Register D by 1, so that the DEC D below tests the high byte of the address.
573D
DEC D 15
DECrement Register D by 1: the Z FLAG when the high byte is 00H, the end of the table.
573E
If the Z FLAG is set (the end of the table), JUMP to 574FH for the high memory.
5740
LD C,(IX+02H) DD 4E 02
Load Register C with the low byte of the area's length at Index Register IX+02H.
5743
LD B,(IX+03H) DD 46 03
Load Register B with the high byte of the area's length at Index Register IX+03H.
5746
LDIR ED B0
Copy the saved area from Register Pair HL back to its place at Register Pair DE by LDIR. Register Pair BC counts down.
5748
LD DE,0004H 11 04 00
Load Register Pair DE with 0004H, the length of an entry of the table.
574B
ADD IX,DE DD 19
ADD Register Pair DE to Index Register IX, to the next entry of the table.
574D
JUMP back to 5736H to copy the next area of the table back to its place.
574F
PUSH HL E5
Save Register Pair HL, the saved high memory, to the top of the stack.
5750
LD DE,(4049H) ED 5B 49 40
Load Register Pair DE with HIGH$ from 4049H-404AH, as the saved areas have just put it back.
5754
LD HL,(4358H) 2A 58 43
Load Register Pair HL with TOP$, the top of the memory, from 4358H-4359H.
5757
SBC HL,DE ED 52
Subtract Register Pair DE (HIGH$) from Register Pair HL (TOP$): the bytes above HIGH$, the Z FLAG when there are none.
5759
LD C,L 4D
Load Register C with Register L, the low byte of the count.
575A
LD B,H 44
Load Register B with Register H: Register Pair BC = the bytes above HIGH$.
575B
INC DE 13
INCrement Register Pair DE by 1, to the first byte above HIGH$ (INC does not change the flags).
575C
POP HL E1
Restore Register Pair HL, the saved high memory, from the top of the stack.
575D
If the Z FLAG is set (nothing above HIGH$), JUMP to 5761H.
575F
LDIR ED B0
Copy the saved high memory from Register Pair HL back above HIGH$ at Register Pair DE by LDIR. Register Pair BC counts down.
5761
LD C,00H 0E 00
Load Register C with 00H, drive 0, the first drive.
5763
GOSUB to 448BH, LOCDCT%, to point Index Register IY to the drive control table of the drive in Register C.
5766
LD A,(IY+01H) FD 7E 01
Load Register A with the low byte of the driver address, DCT+01H at Index Register IY+01H.
5769
AND (IY+02H) FD A6 02
AND Register A with the high byte, DCT+02H at Index Register IY+02H: Register A = FFH only when the address is FFFFH.
576C
INC A 3C
INCrement Register A by 1: the Z FLAG for a drive without a driver (FFFFH).
576D
If the Z FLAG is set (no driver), JUMP to 5773H for the next drive.
576F
SET 0,(IY+03H) FD CB 03 C6
Set bit 0 of DCT+03H at Index Register IY+03H, so that the diskette is logged again at its next use.
5773
LD A,07H 3E 07
Load Register A with 07H, the last drive number.
5775
INC C 0C
INCrement Register C by 1, to the next drive number.
5776
CP C B9
Compare Register A against Register C: the NC FLAG while the drive number is 7 or less.
5777
If the NC FLAG is set (drives left), JUMP back to 5763H for the next drive.
5779
XOR A AF
Set Register A to 00H by XORing it with itself, the byte that resets the RS-232 interface.
577A
OUT (E8H),A D3 E8
Send Register A (00H) to port E8H, which resets the RS-232 interface.
577C
LD A,(4305H) 3A 05 43
Load Register A with the RS-232 baud rate byte from 4305H, as the saved areas put it back.
577F
OUT (E9H),A D3 E9
Send Register A, the baud rate byte, to port E9H of the RS-232 interface.
5781
LD A,(4306H) 3A 06 43
Load Register A with the RS-232 control byte from 4306H.
5784
OUT (EAH),A D3 EA
Send Register A, the control byte, to port EAH of the RS-232 interface.
5786
POP HL E1
Restore Register Pair HL, the resident overlay bytes, from the top of the stack.
5787
LD (430AH),HL 22 0A 43
Store Register Pair HL back into 430AH-430BH: the overlays now in memory, not those of the saved state.
578A
POP HL E1
Restore Register Pair HL, the cursor position, from the top of the stack.
578B
LD (4020H),HL 22 20 40
Store Register Pair HL back into 4020H-4021H, the cursor position.
578E
EI FB
Enable the interrupts again: the system areas are back.
578F
RET C9
RETurn to the caller of the configuration file (DOSPLUS) with the saved state in force.
5790H - The System Areas
Data: the table of the system areas a configuration file saves (568CH) and its loader restores (572FH, at 526AH there): the address and the length of each, ended by an address whose high byte is 00H.
5790-5791
DEFW 400CH 0C 40
Area 1: from 400CH, the restart vectors and the device control blocks of the ROM's devices.
5792-5793
DEFW 0034H 34 00
The length of area 1: 52 bytes, 400CH-403FH, saved and restored as it is.
5794-5795
DEFW 4047H 47 40
Area 2: from 4047H, LOW$, HIGH$ and the system words that follow.
5796-5797
DEFW 0016H 16 00
The length of area 2: 22 bytes, 4047H-405CH, saved and restored as it is.
5798-5799
DEFW 4300H 00 43
Area 3: from 4300H, the system variables of SYS0/SYS.
579A-579B
DEFW 0015H 15 00
The length of area 3: 21 bytes, 4300H-4314H, saved and restored as it is.
579C-579D
DEFW 4358H 58 43
Area 4: from 4358H, TOP$, the device control blocks and DCTTBL.
579E-579F
DEFW 0076H 76 00
The length of area 4: 118 bytes, 4358H-43CDH, saved and restored as it is.
57A0-57A1
DEFW 4400H 00 44
Area 5: from 4400H, the system entry points of SYS0/SYS.
57A2-57A3
DEFW 0067H 67 00
The length of area 5: 103 bytes, 4400H-4466H, saved and restored as it is.
57A4-57A5
DEFW 4467H 67 44
Area 6: from 4467H, more of the system entry points.
57A6-57A7
DEFW 0027H 27 00
The length of area 6: 39 bytes, 4467H-448DH, saved and restored as it is.
57A8-57A9
DEFW 448EH 8E 44
Area 7: from 448EH, the drive control tables.
57AA-57AB
DEFW 0050H 50 00
The length of area 7: 80 bytes, 448EH-44DDH, saved and restored as it is.
57AC-57AD
DEFW 45ECH EC 45
Area 8: from 45ECH, a part of SYS0/SYS's code and data.
57AE-57AF
DEFW 000CH 0C 00
The length of area 8: 12 bytes, 45ECH-45F7H, saved and restored as it is.
57B0-57B1
DEFW 0000H 00 00
The end of the table: an address whose high byte is 00H.
57B2H - SYSTEM's Texts
Data: the three words of the display of the memory pointers (5539H-555AH), each ended by 03H for DSPLY@, and the default extension of a configuration file.
57B2-57B6
DEFM "LOW$=" 4C 4F 57 24 3D
The word before LOW$, the bottom of free memory (5539H).
57B7
DEFB 03H 03
The byte that ends the text LOW$= for DSPLY@.
57B8-57BE
DEFM ",HIGH$=" 2C 48 49 47 48 24 3D
The word before HIGH$, the top of memory for programs (5545H).
57BF
DEFB 03H 03
The byte that ends the text ,HIGH$= for DSPLY@.
57C0-57C5
DEFM ",TOP$=" 2C 54 4F 50 24 3D
The word before TOP$, the top of the memory (5551H).
57C6
DEFB 03H 03
The byte that ends the text ,TOP$= for DSPLY@.
57C7-57C9
DEFM "CFG" 43 46 47
The default extension of a configuration file, added by FEXT@ (566DH).
57CAH - SYSTEM's Evaluation Block
Data: the block that Index Register IX points to for EVAL@ (5528H): EVAL@'s flags, the three field blocks, all 58C0H, and the parameter table. Each entry is the name (6 characters), the address its value is stored to (the operands of 5563H-5636H) and a type byte (20H a switch, 40H a number). The manual's HIGH is the name HIGH$, which a name of four characters matches.
57CA
DEFB 00H 00
The flags of SYSTEM's evaluation block, set by EVAL@: bits 0-2 the fields, bit 3 the parameters.
57CB-57CC
DEFW 58C0H C0 58
The address of the source block, 58C0H: the flag byte, then the file control block.
57CD-57CE
DEFW 58C0H C0 58
The address of the destination block: 58C0H again, so any field goes to the one block.
57CF-57D0
DEFW 58C0H C0 58
The address of the wildmask block: 58C0H again, so any field goes to the one block.
57D1-57D2
DEFW 57D3H D3 57
The address of SYSTEM's parameter table at 57D3H.
57D3-57D8
DEFM "TIME " 54 49 4D 45 20 20
The name TIME: the time prompt at boot, bit 3 of the boot flags (T).
57D9-57DA
DEFW 55D1H D1 55
TIME's value goes to 55D1H-55D2H, the operand of LD DE,0000H at 55D0H.
57DB
DEFB 20H 20
The type byte of TIME: 20H, bit 5, a switch, so the name alone sets it.
57DC-57E1
DEFM "DATE " 44 41 54 45 20 20
The name DATE: the date prompt at boot, bit 2 of the boot flags (D).
57E2-57E3
DEFW 55C2H C2 55
DATE's value goes to 55C2H-55C3H, the operand of LD DE,0000H at 55C1H.
57E4
DEFB 20H 20
The type byte of DATE: 20H, bit 5, a switch, so the name alone sets it.
57E5-57EA
DEFM "LOGO " 4C 4F 47 4F 20 20
The name LOGO: the logo at boot, bit 1 of the boot flags (L).
57EB-57EC
DEFW 55B3H B3 55
LOGO's value goes to 55B3H-55B4H, the operand of LD DE,0000H at 55B2H.
57ED
DEFB 20H 20
The type byte of LOGO: 20H, bit 5, a switch, so the name alone sets it.
57EE-57F3
DEFM "BLINK " 42 4C 49 4E 4B 20
The name BLINK: the blinking cursor, the switch at 401CH (B).
57F4-57F5
DEFW 55FEH FE 55
BLINK's value goes to 55FEH-55FFH, the operand of LD DE,0000H at 55FDH.
57F6
DEFB 20H 20
The type byte of BLINK: 20H, bit 5, a switch, so the name alone sets it.
57F7-57FC
DEFM "CAPS " 43 41 50 53 20 20
The name CAPS: upper or lower case from the keyboard, the switch at 4019H (C).
57FD-57FE
DEFW 560AH 0A 56
CAPS's value goes to 560AH-560BH, the operand of LD DE,0000H at 5609H.
57FF
DEFB 20H 20
The type byte of CAPS: 20H, bit 5, a switch, so the name alone sets it.
5800-5805
DEFM "CURSOR" 43 55 52 53 4F 52
The name CURSOR: the cursor character at 4023H (CU).
5806-5807
DEFW 5615H 15 56
CURSOR's value goes to 5615H-5616H, the operand of LD DE,FFFFH at 5614H.
5808
DEFB 40H 40
The type byte of CURSOR: 40H, bit 6, a number, the character.
5809-580E
DEFM "HIGH$ " 48 49 47 48 24 20
The name HIGH$: the top of memory for programs at 4049H (H).
580F-5810
DEFW 561FH 1F 56
HIGH$'s value goes to 561FH-5620H, the operand of LD DE,0000H at 561EH.
5811
DEFB 40H 40
The type byte of HIGH$: 40H, bit 6, a number, the address.
5812-5817
DEFM "STEP " 53 54 45 50 20 20
The name STEP: the system's default step rate, +16H of the boot sector (S).
5818-5819
DEFW 55E0H E0 55
STEP's value goes to 55E0H-55E1H, the operand of LD DE,0000H at 55DFH.
581A
DEFB 40H 40
The type byte of STEP: 40H, bit 6, a number, the step rate code.
581B-5820
DEFM "PORT " 50 4F 52 54 20 20
The name PORT: the port to output to at boot, +17H of the boot sector (P).
5821-5822
DEFW 55EAH EA 55
PORT's value goes to 55EAH-55EBH, the operand of LD DE,0000H at 55E9H.
5823
DEFB 40H 40
The type byte of PORT: 40H, bit 6, a number, the port.
5824-5829
DEFM "MODE " 4D 4F 44 45 20 20
The name MODE: the value to output to PORT at boot, +18H of the boot sector (M).
582A-582B
DEFW 55F4H F4 55
MODE's value goes to 55F4H-55F5H, the operand of LD DE,0000H at 55F3H.
582C
DEFB 40H 40
The type byte of MODE: 40H, bit 6, a number, the value for the port.
582D-5832
DEFM "SAVE " 53 41 56 45 20 20
The name SAVE: keep BLINK, CURSOR and CAPS in the boot sector (SA).
5833-5834
DEFW 5632H 32 56
SAVE's value goes to 5632H-5633H, the operand of LD DE,0000H at 5631H.
5835
DEFB 20H 20
The type byte of SAVE: 20H, bit 5, a switch, so the name alone sets it.
5836
DEFB 00H 00
The end of SYSTEM's parameter table: a 00H in place of the next name.
5837H - A Number in Decimal
5837H shows the number in Register E, 5839H the number in Register Pair DE, each with up to four leading zeros left out; 583BH leaves out up to Register B of them. The routine runs under 4525H, which keeps the registers. The number is turned into six BCD digits at 58C0H-58C2H (the low two in 58C0H) by 16 doublings with DAA, then into six digits at 58C3H-58C8H; the five from 58C4H are shown, less the leading zeros left out.
5837
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the number in Register E.
5839
LD B,04H 06 04
Load Register B with 04H, so that up to four of the five digits are left out when they are leading zeros.
583B
GOSUB to 4525H, which runs the rest of this routine with the registers saved and puts them back when it RETurns.
583E
LD HL,58C0H 21 C0 58
Point Register Pair HL to 58C0H, the three bytes of the number in BCD.
5841
LD (HL),00H 36 00
Store 00H at Register Pair HL, the lowest two BCD digits.
5843
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the BCD number.
5844
LD (HL),00H 36 00
Store 00H at Register Pair HL, the middle two BCD digits.
5846
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the BCD number.
5847
LD (HL),00H 36 00
Store 00H at Register Pair HL, the highest two BCD digits.
5849
PUSH BC C5
Save Register Pair BC, the zeros to leave out in Register B, to the top of the stack.
584A
LD C,10H 0E 10
Load Register C with 10H, the 16 bits of the number in Register Pair DE.
584C
LD B,03H 06 03
Load Register B with 03H, the three bytes of the BCD number.
584E
LD HL,58C0H 21 C0 58
Point Register Pair HL to 58C0H, the lowest byte of the BCD number.
5851
SLA E CB 23
Shift Register E left by one bit: its bit 7 goes to the C FLAG.
5853
RL D CB 12
Rotate Register D left through the C FLAG: the highest bit of Register Pair DE goes to the C FLAG.
5855
LD A,(HL) 7E
Load Register A with the byte of the BCD number at Register Pair HL.
5856
ADC A,A 8F
ADD Register A to itself with the C FLAG: the BCD byte doubled, plus the bit from below.
5857
DAA 27
Decimal Adjust Register A, so that it holds the doubled byte as two BCD digits and the C FLAG carries into the next byte.
5858
LD (HL),A 77
Store Register A, the two BCD digits, back at Register Pair HL.
5859
INC HL 23
INCrement Register Pair HL by 1, to the next byte of the BCD number.
585A
DECrement Register B and LOOP back to 5855H until the three bytes are doubled.
585C
DEC C 0D
DECrement Register C by 1, the count of the bits still to take.
585D
If the NZ FLAG is set (bits left), JUMP back to 584CH for the next bit of the number.
585F
LD DE,58C3H 11 C3 58
Point Register Pair DE to 58C3H, the six digits of the number as characters.
5862
LD HL,58C2H 21 C2 58
Point Register Pair HL to 58C2H, the highest byte of the BCD number.
5865
LD B,03H 06 03
Load Register B with 03H, the three bytes of the BCD number.
5867
LD A,33H 3E 33
Load Register A with 33H, whose low four bits become the high half of the byte at Register Pair HL.
5869
RRD ED 67
Rotate the digits of Register A and the byte at Register Pair HL right (RRD): Register A = 30H plus the low digit, the byte = 30H plus the high digit.
586B
LD C,A 4F
Load Register C with Register A, the low digit as a character.
586C
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the high digit as a character.
586D
DEC HL 2B
DECrement Register Pair HL by 1, to the next lower byte of the BCD number.
586E
LD (DE),A 12
Store Register A, the high digit, at Register Pair DE.
586F
INC DE 13
INCrement Register Pair DE by 1, to the next digit.
5870
LD A,C 79
Load Register A with Register C, the low digit.
5871
LD (DE),A 12
Store Register A, the low digit, at Register Pair DE.
5872
INC DE 13
INCrement Register Pair DE by 1, to the next digit.
5873
DECrement Register B and LOOP back to 5867H until the six digits are made.
5875
POP BC C1
Restore Register Pair BC, the zeros to leave out in Register B, from the top of the stack.
5876
LD HL,58C4H 21 C4 58
Point Register Pair HL to 58C4H, the first of the five digits shown (the sixth, 58C3H, is always 0).
5879
LD C,B 48
Load Register C with Register B, the most zeros to leave out.
587A
LD A,30H 3E 30
Load Register A with 30H, the digit 0, the leading zero to look for.
587C
CP (HL) BE
Compare Register A against the digit at Register Pair HL: the Z FLAG for a leading zero.
587D
If the NZ FLAG is set (not a zero), JUMP to 5882H to show the digits from here.
587F
INC HL 23
INCrement Register Pair HL by 1, past the leading zero.
5880
DECrement Register B and LOOP back to 587CH while more zeros may be left out.
5882
LD A,05H 3E 05
Load Register A with 05H, the five digits from 58C4H to 58C8H.
5884
SUB C 91
SUBtract Register C, the most zeros to leave out, from Register A.
5885
ADD A,B 80
ADD Register B, the zeros that were not left out, to Register A: the digits to show.
5886
LD B,A 47
Load Register B with Register A, the count of the digits to show.
5887
LD A,(HL) 7E
Load Register A with the digit at Register Pair HL.
5888
GOSUB to 0033H, the ROM's routine that shows the character in Register A on the display.
588B
INC HL 23
INCrement Register Pair HL by 1, to the next digit.
588C
DECrement Register B and LOOP back to 5887H until the digits are shown.
588E
RET C9
RETurn to the caller through 4525H, which puts the registers back.
588FH - A Number in Hexadecimal
588FH shows Register Pair HL as four hexadecimal digits and an H; 589CH shows Register A as two digits, 58A5H the low four bits of Register A as one digit (by ADD 90H, DAA, ADC 40H, DAA).
588F
LD A,H 7C
Load Register A with Register H, the high byte of the number.
5890
GOSUB to 589CH to show Register A as two hexadecimal digits.
5893
LD A,L 7D
Load Register A with Register L, the low byte of the number.
5894
GOSUB to 589CH to show Register A as two hexadecimal digits.
5897
LD A,48H 3E 48
Load Register A with 48H, the letter H after a hexadecimal number.
5899
JUMP to 0033H, the ROM's routine that shows the character in Register A, which RETurns to the caller.
589C
PUSH AF F5
Save Register Pair AF, the byte, to the top of the stack.
589D
RRA 1F
Rotate Register A right through the C FLAG, the first of four rotations.
589E
RRA 1F
Rotate Register A right through the C FLAG, the second of four rotations.
589F
RRA 1F
Rotate Register A right through the C FLAG, the third of four rotations.
58A0
RRA 1F
Rotate Register A right through the C FLAG: the high four bits of the byte are now its low four bits.
58A1
GOSUB to 58A5H to show the low four bits of Register A, the high digit of the byte.
58A4
POP AF F1
Restore Register Pair AF, the byte, from the top of the stack, for its low digit.
58A5
AND 0FH E6 0F
AND Register A with 0FH, the low four bits, one hexadecimal digit.
58A7
ADD A,90H C6 90
ADD 90H to Register A: 90H-99H for 0-9, 9AH-9FH for A-F.
58A9
DAA 27
Decimal Adjust Register A: 90H-99H for 0-9, 00H-05H with the C FLAG for A-F.
58AA
ADC A,40H CE 40
ADD 40H and the C FLAG to Register A: D0H-D9H for the digits 0-9, 41H-46H for the letters A-F.
58AC
DAA 27
Decimal Adjust Register A: 30H-39H for the digits 0-9, 41H-46H for the letters A-F.
58AD
JUMP to 0033H, the ROM's routine that shows the character in Register A, which RETurns to the caller.
58B0H - The Error Exits
Four entries, each loading its error code into Register A: 58B0H 2DH Invalid data provided, 58B3H 2BH Illegal devicespec, 58B6H 2CH Illegal filespec, 58B9H 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. 58BBH posts the error in Register A by ERROR@ with bit 6 set (no frame), and ERROR@ ends with ABORT@.
58B0
LD A,2DH 3E 2D
Load Register A with 2DH, the error code Invalid data provided.
58B2
LD BC,2B3EH 01 3E 2B
58B3H enters inside this LD BC,2B3EH: its bytes 3EH 2BH read as LD A,2BH, the error code Illegal devicespec; from above it only loads Register Pair BC.
58B5
LD BC,2C3EH 01 3E 2C
58B6H enters inside this LD BC,2C3EH: its bytes 3EH 2CH read as LD A,2CH, the error code Illegal filespec; from above it only loads Register Pair BC.
58B8
LD BC,293EH 01 3E 29
58B9H 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.
58BB
OR 40H F6 40
OR Register A, the error code, with 40H, bit 6, so that ERROR@ shows the message without its frame.
58BD
JUMP to 4409H, ERROR@, to show the message of the error in Register A and end through ABORT@.
58C0H - The Work Area
Not in the file: SYS16/SYS uses the memory after its last byte (58BFH) for the field block of EVAL@, the digits of a decimal number, the buffer of the configuration file and its image.
58C0-58E0
DEFS 33
The field block of EVAL@: 58C0H the flag byte, 58C1H the file control block of the configuration file. 58C0H-58C8H also hold the BCD number and the digits of 5837H, used only while no file is open.
58E1-58FF
DEFS 31
Not used by SYS16/SYS: the bytes up to the buffer of the configuration file.
5900-59FF
DEFS 256
The buffer of the configuration file's sectors (5678H).
5A00-5AFF
DEFS 256
The start of the image of a configuration file (5687H): the loader, then the saved areas and the memory above HIGH$, as far as they need.