TRS-80 DOS - NEWDOS/80 v2.0 for the Model I - SYS17/SYS Disassembled

Page Customization

SYS17/SYS - SYSTEM Command:

SYS17/SYS implements the SYSTEM command for NEWDOS/80 v2.0. It handles two subcommands:

  1. SYSTEM,3 (entered as "SYSTEM,3" or invoked via SVC) - The System Parameter Display/Set function. This allows users to view and modify DOS configuration parameters using two-letter codes (AA through ZZ range). Parameters control various DOS behaviors including:
    • Drive configuration settings
    • Timing and delay values
    • Boolean flags (Y/N options)
    • Numeric values (8-bit and 16-bit)
  2. SYSTEM,S (the SYSGEN function) - Copies system files to another disk, but only if enabled via system flags. This routine verifies the destination disk has proper BOOT/SYS and DIR/SYS files before proceeding with the system transfer.

The two-letter parameter codes are decoded using a base-26 calculation (first letter × 26 + second letter), then looked up in a parameter descriptor table at 4F24H. The descriptor encodes whether the parameter is boolean or numeric, its storage location offset, and whether it's an 8-bit or 16-bit value.When called without parameters, SYSTEM,3 displays all defined parameters with their current values. When called with assignments (e.g., AA=Y or BC=15), it modifies the specified parameters.

NOTE 1: This disassembly is on the UNPATCHED/AS SHIPPED version of SYS17/SYS.

NOTE 2: The NEWDOS/80 Manuals states that this SYS file handles WRDIRP. It does not.

Variables:

AddressBytesPurpose
43A0H-43AFH168-bit system parameter storage area
43D0H-43EFH3216-bit system parameter storage area (word values)
43F0H-43FFH16Boolean flag storage (bit 0 = Y/N for each parameter)
4F08H-4F0FH8Decimal conversion constants table (55536, 6553, 655, 99)
4F10H-4F15H6Numeric display buffer ("00000H" template)
4F16H-4F1BH6FCB template for file operations (drive spec at 4F16H)
4F1CH1Stored drive number from Register B on entry
4F1DH-4F1FH3Reserved/padding (FFH, 00H, 00H)
4F20H1Display column counter (initialized to 02H)
4F21H-4F23H3Reserved (00H, FFH, FFH)
4F24H-4F6CH72Parameter descriptor lookup table (one byte per valid two-letter code)
500FH-5012H4String constant "BOOT" for SYSGEN verification
5013H-5019H7String constant "DIR " for SYSGEN verification
501AH-501DH4String constant " SYS" for SYSGEN verification
501EH-502AH13FCB template for SYSGEN file operations
5024H1Target drive number for SYSGEN operation
5028H-5029H2Pointer storage for SYSGEN sector iteration
509FH-51E7H329Reserved/unused space (NOP padding to sector boundary)

Major Routines:

AddressPurpose
4D00-4D09Entry point and command dispatch
4D0A-4DC0Main SYSTEM "3" command processing (system parameter display/set)
4DC0-4E20Display loop for system parameters
4E21-4E29Initialize display buffer
4E2A-4EA1Numeric parameter handling
4EA2-4EDCDecimal/hex number parsing
4EDE-4F07Decimal number output
4F08-4F23Data tables (divisors, buffers)
4F24-4F6CParameter definition table
4F6D-5009"S" command handler (SYSTEM BOOT verification)
500F-502BString constants and FCB data
502C-509EAdditional code (appears to be part of another overlay or system routine)
509F-51E7NOP padding

Disasembly:

4D00H - SYSTEM Command Entry Point

Entry point for the SYSTEM command. Checks for 'S' (SYSGEN) or '3' (parameter display/set) subcommands. If neither matches, returns error code 2AH.

4D00
CP 53H FE 53
Compare Register A against S (53H). If A equals 53H, the Z FLAG is set; otherwise the NZ FLAG is set.
4D02
If the Z FLAG (Zero) has been set (meaning the command is S for SYSGEN), JUMP to 4F6DH to handle the SYSGEN operation.
4D05
CP 33H FE 33
Compare Register A against 3 (33H). If A equals 33H, the Z FLAG is set; otherwise the NZ FLAG is set.
4D07
LD A,2AH 3E 2A
Load Register A with error code 2AH (General error) in preparation for a possible error return.
4D09
RET NZ C0
If the NZ FLAG (Not Zero) has been set (meaning the command was neither S nor 3), RETURN with error code 2AH in Register A.
4D0A
NOP 00
No operation (placeholder byte).
4D0B
NOP 00
No operation (placeholder byte).

Execution reaches here only if the command is '3' (SYSTEM,3). Register B contains the current drive number passed by the DOS command parser.

4D0C
LD A,B 78
Load Register A with the value from Register B (the current drive number).
4D0D
LD (4F1CH),A 32 1C 4F
Store the drive number into memory location 4F1CH for later use.
4D10
GOSUB to 4E21H to initialize the display counter (sets 4F20H to 02H) and point DE to the FCB template at 4F16H.
4D13
GOSUB to SYS0 routine at 4436H to perform DOS validation/setup.
4D16
RET NZ C0
If the NZ FLAG (Not Zero) has been set (indicating an error from the DOS call), RETURN with the error code.
4D17
GOSUB to SYS0 routine at 4C7AH to parse the next token from the command line. Returns Z if end of line, C if error, NZ if token found.
4D1A
RET C D8
If the CARRY FLAG has been set (indicating a parsing error), RETURN with error.
4D1B
If the Z FLAG (Zero) has been set (meaning no parameters were provided), JUMP to 4DC0H to display all current parameter settings.

A parameter code was found. HL points to the first character. Now parse the two-letter parameter code.

4D1E
LD A,(HL) 7E
Load Register A with the first character of the parameter code from the buffer pointed to by HL.
4D1F
SUB 41H D6 41
Subtract 41H (ASCII A) from Register A, converting the letter to a value 0-25.
4D21
CP 09H FE 09
Compare Register A against 09H. Valid first letters are A-I (0-8). If A < 9, the CARRY FLAG is set.
4D23
If the CARRY FLAG has been set (first letter is valid A-I), JUMP to 4D2AH to continue parsing.
4D25
LD A,34H 3E 34
Load Register A with error code 34H (Parse error) - invalid parameter code.
4D27
JUMP to 4E81H to process the error and return to DOS.

First letter is valid (A-I). Now multiply by 26 to calculate the base index for the two-letter code.

4D2A
LD C,A 4F
Load Register C with the first letter value (0-8) from Register A.
4D2B
LD B,19H 06 19
Load Register B with 19H (25 decimal) as a loop counter for the multiplication.

[LOOP START] Multiply the first letter value by 26 using repeated addition (A = A + C, 25 times).

4D2D
ADD A,C 81
Add Register C to Register A. This accumulates the product.
4D2E
Decrement B and if not zero, LOOP BACK to 4D2DH. [LOOP] After 25 iterations, A = original_A × 26.
4D30
LD C,A 4F
Load Register C with the result (first_letter × 26).
4D31
INC HL 23
Increment HL to point to the second character of the parameter code.
4D32
LD A,(HL) 7E
Load Register A with the second character of the parameter code.
4D33
SUB 41H D6 41
Subtract 41H (ASCII A) from Register A, converting the second letter to 0-25.
4D35
CP 1AH FE 1A
Compare Register A against 1AH (26). Valid second letters are A-Z (0-25). If A < 26, the CARRY FLAG is set.
4D37
INC HL 23
Increment HL to point past the second character.
4D38
If the NO CARRY FLAG has been set (second letter is invalid), JUMP to 4D25H to report parse error.
4D3A
ADD A,C 81
Add Register C (first_letter × 26) to Register A (second_letter). Result is the table index.
4D3B
LD E,A 5F
Load Register E with the calculated table index.
4D3C
LD D,00H 16 00
Load Register D with 00H, making DE a 16-bit offset.
4D3E
CP 48H FE 48
Compare Register A against 48H (72 decimal). The lookup table has 72 entries. If A < 72, the CARRY FLAG is set.
4D40
If the NO CARRY FLAG has been set (index out of range), JUMP to 4D25H to report parse error.
4D42
PUSH HL E5
Save HL (pointer to next character in command line) onto the stack.
4D43
LD HL,4F24H 21 24 4F
Point HL to the parameter descriptor lookup table at 4F24H.
4D46
ADD HL,DE 19
Add DE (the table index) to HL, pointing to the descriptor byte for this parameter.
4D47
LD A,(HL) 7E
Load Register A with the parameter descriptor byte from the table.
4D48
CP FEH FE FE
Compare Register A against FEH. Values FEH and FFH indicate undefined parameters.
4D4A
LD B,A 47
Load Register B with the descriptor byte for later use.
4D4B
POP HL E1
Restore HL (pointer to next character in command line) from the stack.

4D4CH - Check for Assignment or Display

After looking up the parameter descriptor, check if this is an assignment (with '=') or just a display request. Branch based on parameter type (boolean vs numeric).

4D4C
If the NO CARRY FLAG has been set (descriptor was FEH or FFH, meaning undefined parameter), JUMP to 4D25H to report parse error.
4D4E
LD A,(HL) 7E
Load Register A with the next character from the command line (should be '=' for assignment).
4D4F
CP 3DH FE 3D
Compare Register A against = (3DH). If A equals 3DH, the Z FLAG is set.
4D51
INC HL 23
Increment HL to point past the '=' character (or to the next character if no '=').
4D52
If the NZ FLAG (Not Zero) has been set (no '=' found), JUMP to 4D7FH to report a syntax error.

An '=' was found, so this is an assignment. Check bit 7 of the descriptor to determine if it's a boolean (0) or numeric (1) parameter.

4D54
BIT 7,B CB 78
Test bit 7 of Register B (the descriptor). If bit 7 is 0, parameter is boolean; if 1, parameter is numeric.
4D56
If the NZ FLAG has been set (bit 7 = 1, numeric parameter), JUMP to 4D82H to handle numeric assignment.

This is a boolean parameter. Extract the storage offset from the descriptor and build the self-modifying code to access the flag table.

4D58
LD A,B 78
Load Register A with the descriptor byte from Register B.
4D59
RRCA 0F
Rotate Register A right through carry. This shifts the bit pattern for extraction.
4D5A
AND 38H E6 38
Mask Register A with 38H to isolate bits 3-5 (the register encoding for RES/SET instructions).
4D5C
OR 86H F6 86
OR with 86H to form the opcode for RES n,(HL) instruction.
4D5E
LD (4D74H),A 32 74 4D
Store the constructed opcode at 4D74H (self-modifying code for the RES instruction below).
4D61
ADD 40H C6 40
Add 40H to Register A to convert RES opcode to SET opcode.
4D63
LD (4D7AH),A 32 7A 4D
Store the constructed opcode at 4D7AH (self-modifying code for the SET instruction below).
4D66
LD A,B 78
Load Register A with the descriptor byte from Register B again.
4D67
AND 0FHAND 00001111 E6 0F
Mask Register A with 0FH to isolate the low nibble (the offset into the flag table).
4D69
LD E,A 5F
Load Register E with the table offset.
4D6A
LD D,00H 16 00
Load Register D with 00H, making DE a 16-bit offset.
4D6C
LD A,(HL) 7E
Load Register A with the value character (should be 'Y' or 'N').
4D6D
INC HL 23
Increment HL to point past the value character.
4D6E
PUSH HL E5
Save HL (pointer to rest of command line) onto the stack.
4D6F
LD HL,43F0H 21 F0 43
Point HL to the boolean flag storage table at 43F0H.
4D72
ADD HL,DE 19
Add DE (the offset) to HL, pointing to the specific flag byte.

The following instruction at 4D73H is self-modified. It will be either RES n,(HL) to clear the flag.

4D73
RES 0,(HL) CB 86
[SELF-MODIFIED] Reset (clear) the appropriate bit in the flag byte. The actual bit number is set by the code at 4D5EH.
4D75
CP 4EH FE 4E
Compare Register A against N (4EH). If the value was 'N', the Z FLAG is set.
4D77
If the Z FLAG (Zero) has been set (value is 'N'), JUMP to 4DA6H - flag is already cleared, continue to next parameter.

The following instruction at 4D79H is self-modified. It will be SET n,(HL) to set the flag if value is 'Y'.

4D79
SET 0,(HL) CB C6
[SELF-MODIFIED] Set the appropriate bit in the flag byte. The actual bit number is set by the code at 4D63H.
4D7B
CP 59H FE 59
Compare Register A against Y (59H). If the value was 'Y', the Z FLAG is set.
4D7D
If the Z FLAG (Zero) has been set (value is 'Y'), JUMP to 4DA6H - flag is set, continue to next parameter.

Value was neither 'Y' nor 'N' - report syntax error.

4D7F
JUMP to 4E7FH to report a syntax error (invalid value for parameter).

4D82H - Numeric Parameter Assignment

Handles assignment of numeric values to parameters. Parses the decimal or hex number and stores it in the appropriate location (8-bit at 43A0H+ or 16-bit at 43D0H+).

4D82
PUSH BC C5
Save BC (B contains the parameter descriptor) onto the stack.
4D83
GOSUB to 4E84H to parse a numeric value from the command line. Returns value in DE.
4D86
POP BC C1
Restore BC (descriptor in B) from the stack.
4D87
LD A,B 78
Load Register A with the descriptor byte from Register B.
4D88
AND 1FHAND 00011111 E6 1F
Mask Register A with 1FH to isolate bits 0-4 (the offset into the parameter storage area).
4D8A
PUSH HL E5
Save HL (pointer to rest of command line) onto the stack.
4D8B
PUSH DE D5
Save DE (the parsed numeric value) onto the stack.
4D8C
LD HL,43A0H 21 A0 43
Point HL to the 8-bit parameter storage area at 43A0H.
4D8F
LD E,A 5F
Load Register E with the offset from Register A.
4D90
LD D,00H 16 00
Load Register D with 00H, making DE a 16-bit offset.
4D92
ADD HL,DE 19
Add DE (the offset) to HL, pointing to the parameter storage location.
4D93
POP DE D1
Restore DE (the parsed numeric value) from the stack.
4D94
BIT 6,B CB 70
Test bit 6 of Register B (the descriptor). If bit 6 is 1, this is a 16-bit parameter.
4D96
If the Z FLAG (Zero) has been set (bit 6 = 0, 8-bit parameter), JUMP to 4DA1H to store single byte.

This is a 16-bit parameter. Adjust HL to point to the 16-bit storage area (43D0H base instead of 43A0H).

4D98
LD A,L 7D
Load Register A with the low byte of HL.
4D99
ADD 30H C6 30
Add 30H to Register A. This adjusts from 43A0H base to 43D0H base for 16-bit storage.
4D9B
LD L,A 6F
Load Register L with the adjusted value.
4D9C
LD (HL),E 73
Store the low byte of the value (E) at the current location.
4D9D
INC HL 23
Increment HL to point to the high byte location.
4D9E
LD (HL),D 72
Store the high byte of the value (D) at the next location.
4D9F
JUMP to 4DA6H to continue processing the command line.

8-bit parameter storage. Value must fit in a single byte.

4DA1
LD (HL),E 73
Store the low byte of the value (E) at the parameter location.
4DA2
LD A,D 7A
Load Register A with the high byte of the value (D).
4DA3
OR A B7
OR Register A with itself to test if the high byte is zero.
4DA4
If the NZ FLAG (Not Zero) has been set (value > 255), JUMP to 4D7FH to report error - value too large for 8-bit parameter.

Parameter successfully stored. Check for more parameters on the command line.

4DA6
POP HL E1
Restore HL (pointer to rest of command line) from the stack.
4DA7
GOSUB to SYS0 routine at 4C7AH to parse the next token from the command line.
4DAA
RET C D8
If the CARRY FLAG has been set (parsing error), RETURN with error.
4DAB
If the NZ FLAG (Not Zero) has been set (more parameters found), JUMP to 4D1EH to process the next parameter.

4DAEH - Validate and Write System Parameters

After all parameters have been processed, validate the drive count parameter (at 43A0H) and write the updated settings to disk.

4DAE
LD HL,43A0H 21 A0 43
Point HL to the first system parameter at 43A0H (the drive count setting).
4DB1
LD A,(HL) 7E
Load Register A with the drive count value.
4DB2
DEC A 3D
Decrement Register A (convert 1-4 range to 0-3 for comparison).
4DB3
CP 04H FE 04
Compare Register A against 04H. Valid drive counts are 1-4 (after DEC, 0-3). If A < 4, the CARRY FLAG is set.
4DB5
If the CARRY FLAG has been set (drive count is valid 1-4), JUMP to 4DB9H to proceed with saving.
4DB7
LD (HL),01H 36 01
Force the drive count to 01H (1 drive) if it was invalid (0 or > 4).
4DB9
GOSUB to 4E21H to reinitialize the display counter and FCB pointer.
4DBC
GOSUB to SYS0 routine at 443CH to write the updated system parameters to disk.
4DBF
RET NZ C0
If the NZ FLAG (Not Zero) has been set (write error), RETURN with error code.

Settings saved successfully. Fall through to display all parameters.

4DC0
LD HL,4F24H 21 24 4F
Point HL to the parameter descriptor lookup table at 4F24H.
4DC3
LD DE,0000H 11 00 00
Load DE with 0000H - this will be used to calculate the two-letter code during display.
4DC6
LD B,0DH 06 0D
Load Register B with 0DH (13 decimal) - process 13 groups of parameters (AA-AZ, BA-BZ, etc. up to the table end).
4DC8
JUMP to 4E13H to enter the parameter display loop.

4DCAH - Display Single Parameter

Displays a single parameter with its two-letter code, current value, and appropriate formatting (Y/N for boolean, decimal number for numeric).

4DCA
LD A,B 78
Load Register A with the parameter descriptor from Register B.
4DCB
GOSUB to 4E6BH to display the character in Register A (the descriptor, which will be used to output spacing).
4DCE
PUSH HL E5
Save HL (pointer into descriptor table) onto the stack.
4DCF
PUSH DE D5
Save DE (the two-letter code index) onto the stack.
4DD0
PUSH BC C5
Save BC (B=loop counter, C=descriptor) onto the stack.
4DD1
EX DE,HL EB
Exchange DE and HL. Now HL contains the two-letter code index.
4DD2
LD A,1AH 3E 1A
Load Register A with 1AH (26 decimal) - the divisor for extracting first letter.
4DD4
GOSUB to SYS0 routine at 4C59H to divide HL by A. Returns quotient in H (first letter), remainder in L (second letter).
4DD7
ADD 41H C6 41
Add 41H (ASCII A) to the remainder to convert to a letter.
4DD9
LD H,A 67
Load Register H with the second letter ASCII code.
4DDA
LD A,L 7D
Load Register A with the first letter value (quotient).
4DDB
ADD 41H C6 41
Add 41H (ASCII A) to convert to a letter.
4DDD
GOSUB to 4E6BH to display the first letter of the parameter code.
4DE0
LD A,H 7C
Load Register A with the second letter from Register H.
4DE1
GOSUB to 4E6BH to display the second letter of the parameter code.
4DE4
LD A,3DH 3E 3D
Load Register A with = (3DH).
4DE6
GOSUB to 4E6BH to display the '=' sign.
4DE9
LD A,(DE) 1A
Load Register A with the descriptor byte from the table (DE still points to it).
4DEA
LD B,A 47
Load Register B with the descriptor for later use.
4DEB
LD D,00H 16 00
Load Register D with 00H (clear high byte for 8-bit operations).
4DED
BIT 7,A CB 7F
Test bit 7 of Register A. If bit 7 is 1, this is a numeric parameter.
4DEF
If the NZ FLAG has been set (bit 7 = 1, numeric parameter), JUMP to 4E2AH to display the numeric value.

This is a boolean parameter. Extract the bit position and display Y or N.

4DF1
RRCA 0F
Rotate Register A right to position the bit index.
4DF2
AND 38H E6 38
Mask to isolate bits 3-5 (the bit position encoding).
4DF4
OR 46H F6 46
OR with 46H to form the opcode for BIT n,(HL) instruction.
4DF6
LD (4E04H),A 32 04 4E
Store the constructed opcode at 4E04H (self-modifying the BIT instruction below).
4DF9
LD A,B 78
Load Register A with the descriptor byte from Register B.
4DFA
AND 0FHAND 00001111 E6 0F
Mask to isolate the low nibble (offset into flag table).
4DFC
LD E,A 5F
Load Register E with the offset.
4DFD
LD HL,43F0H 21 F0 43
Point HL to the boolean flag storage table at 43F0H.
4E00
ADD HL,DE 19
Add DE (the offset) to HL, pointing to the specific flag byte.
4E01
LD A,4EH 3E 4E
Load Register A with N (4EH) as the default display character.

The following instruction at 4E03H is self-modified. It tests the appropriate bit in the flag byte.

4E03
BIT 0,(HL) CB 46
[SELF-MODIFIED] Test the appropriate bit in the flag byte. The actual bit number is set by code at 4DF6H.
4E05
If the Z FLAG (Zero) has been set (bit is 0 = N), JUMP to 4E09H to display 'N'.
4E07
LD A,59H 3E 59
Load Register A with Y (59H) since the bit is set.
4E09
GOSUB to 4E6BH to display 'Y' or 'N'.
4E0C
POP BC C1
Restore BC from the stack.
4E0D
POP DE D1
Restore DE (two-letter code index) from the stack.
4E0E
POP HL E1
Restore HL (pointer into descriptor table) from the stack.
4E0F
LD B,2CH 06 2C
Load Register B with 2CH (44 decimal) - spacing for column alignment.
4E11
INC DE 13
Increment DE to advance the two-letter code index.
4E12
INC HL 23
Increment HL to advance to the next descriptor in the table.

[LOOP] Check if we've reached the end of the descriptor table.

4E13
LD A,(HL) 7E
Load Register A with the next descriptor byte.
4E14
CP FEH FE FE
Compare Register A against FEH. Values < FEH are valid parameters.
4E16
If the CARRY FLAG has been set (valid parameter descriptor), JUMP to 4DCAH to display this parameter.
4E18
If the Z FLAG (Zero) has been set (descriptor is FEH = skip), JUMP to 4E11H to advance to next entry.

Descriptor is FFH = end of table. Print newline and return.

4E1A
LD A,0DH 3E 0D
Load Register A with carriage return (0DH).
4E1C
GOSUB to 4E6BH to display the carriage return.
4E1F
XOR A AF
Set Register A to zero and clear all flags. This indicates success (no error).
4E20
RET C9
RETURN to caller with success (A=0).

4E21H - Initialize Display Counter and FCB Pointer

Initializes the column counter for parameter display formatting and points DE to the FCB template area.

4E21
LD A,02H 3E 02
Load Register A with 02H (initial column count).
4E23
LD (4F20H),A 32 20 4F
Store the column counter at 4F20H.
4E26
LD DE,4F16H 11 16 4F
Point DE to the FCB template area at 4F16H.
4E29
RET C9
RETURN to caller.

4E2AH - Display Numeric Parameter Value

Retrieves and displays a numeric parameter value. Handles both 8-bit and 16-bit values, converting to decimal for display.

4E2A
LD A,B 78
Load Register A with the descriptor byte from Register B.
4E2B
AND 1FHAND 00011111 E6 1F
Mask Register A with 1FH to isolate the storage offset (bits 0-4).
4E2D
LD E,A 5F
Load Register E with the offset.
4E2E
LD HL,43A0H 21 A0 43
Point HL to the 8-bit parameter storage area at 43A0H.
4E31
ADD HL,DE 19
Add DE (the offset) to HL, pointing to the parameter value.
4E32
BIT 6,B CB 70
Test bit 6 of Register B. If bit 6 is 1, this is a 16-bit parameter.
4E34
If the Z FLAG (Zero) has been set (bit 6 = 0, 8-bit parameter), JUMP to 4E41H to load single byte.

16-bit parameter. Adjust pointer to 43D0H base and load word value.

4E36
LD A,L 7D
Load Register A with the low byte of HL.
4E37
ADD 30H C6 30
Add 30H to adjust from 43A0H base to 43D0H base.
4E39
LD L,A 6F
Load Register L with the adjusted value.
4E3A
LD E,(HL) 5E
Load Register E with the low byte of the 16-bit value.
4E3B
INC HL 23
Increment HL to point to the high byte.
4E3C
LD D,(HL) 56
Load Register D with the high byte of the 16-bit value.
4E3D
EX DE,HL EB
Exchange DE and HL. Now HL contains the 16-bit parameter value.
4E3E
JUMP to 4E44H to display the value.

8-bit parameter. Load single byte into HL (with H=0).

4E41
LD L,(HL) 6E
Load Register L with the 8-bit parameter value.
4E42
LD H,00H 26 00
Load Register H with 00H, making HL a 16-bit value with the parameter in the low byte.

HL now contains the parameter value (8-bit or 16-bit). Convert to decimal and display.

4E44
LD DE,4F10H 11 10 4F
Point DE to the numeric display buffer at 4F10H ("00000H").
4E47
LD BC,4F08H 01 08 4F
Point BC to the decimal conversion constants table at 4F08H.
4E4A
PUSH DE D5
Save DE (buffer pointer) onto the stack.

[LOOP START] Convert the value to decimal digits using successive subtraction.

4E4B
LD A,(BC) 0A
Load Register A with the low byte of the current divisor from the constants table.
4E4C
OR A B7
OR Register A with itself to test if we've reached the end of the table (00H).
4E4D
If the Z FLAG (Zero) has been set (end of table), JUMP to 4E66H to finish conversion.
4E4F
PUSH HL E5
Save HL (remaining value) onto the stack.
4E50
LD L,A 6F
Load Register L with the low byte of the divisor.
4E51
INC BC 03
Increment BC to point to the high byte of the divisor.
4E52
LD A,(BC) 0A
Load Register A with the high byte of the divisor.
4E53
LD H,A 67
Load Register H with the high byte. Now HL contains the divisor.
4E54
INC BC 03
Increment BC to point to the next divisor entry.
4E55
EX (SP),HL E3
Exchange HL with top of stack. Now HL=value, stack has divisor.
4E56
EX DE,HL EB
Exchange DE and HL. Now DE=value, HL=buffer pointer.
4E57
EX (SP),HL E3
Exchange HL with top of stack. Now HL=divisor, stack has buffer pointer.
4E58
LD A,2FH 3E 2F
Load Register A with 2FH (one less than ASCII '0'). Will be incremented before first use.

[INNER LOOP] Count how many times divisor fits into value.

4E5A
INC A 3C
Increment Register A (the digit counter).
4E5B
EX DE,HL EB
Exchange DE and HL. Swap value and divisor for subtraction.
4E5C
OR A B7
Clear carry flag for subtraction.
4E5D
SBC HL,DE ED 52
Subtract divisor (DE) from value (HL). Sets carry if value < divisor.
4E5F
If the NO CARRY FLAG has been set (value >= divisor), JUMP to 4E5AH to continue counting.
4E61
ADD HL,DE 19
Add divisor back to get the correct remainder (we subtracted one too many).
4E62
POP DE D1
Restore DE (buffer pointer) from the stack.
4E63
LD (DE),A 12
Store the ASCII digit at the buffer location.
4E64
INC DE 13
Increment DE to point to the next buffer position.
4E65
JUMP to 4E4BH to process the next digit position. [LOOP]

Conversion complete. Display the resulting string.

4E66
POP HL E1
Restore HL (start of buffer at 4F10H) from the stack.
4E67
GOSUB to 4E71H to display the decimal string from the buffer.
4E6A
JUMP to 4E0CH to restore registers and continue with the next parameter.

4E6BH - Display Character

Outputs a single character to the display via RST 28H SVC call. Also handles column counting for display formatting.

4E6B
PUSH HL E5
Save HL onto the stack.
4E6C
LD C,A 4F
Load Register C with the character to display from Register A.
4E6D
RST 28H EF
Call the DOS supervisor. Function code follows.
4E6E
DB 02H 02
SVC function 02H: Display character in C to screen.
4E6F
POP HL E1
Restore HL from the stack.
4E70
RET C9
RETURN to caller.

4E71H - Display Decimal String

Displays a null-terminated decimal string from the buffer, suppressing leading zeros.

4E71
LD B,04H 06 04
Load Register B with 04H - check first 4 digits for leading zero suppression.

[LOOP START] Skip leading zeros in the display buffer.

4E73
LD A,(HL) 7E
Load Register A with the current character from the buffer.
4E74
CP 30H FE 30
Compare Register A against 0 (30H). If not '0', it's a significant digit.
4E76
If the NZ FLAG (Not Zero) has been set (not a leading zero), JUMP to 4E7BH to start displaying.
4E78
INC HL 23
Increment HL to skip this leading zero.
4E79
Decrement B and if not zero, LOOP BACK to 4E73H. [LOOP] Check next digit.

Display the remaining digits (or at least the last digit if all were zeros).

4E7B
LD A,(HL) 7E
Load Register A with the current character.
4E7C
GOSUB to 4E6BH to display this character.
4E7F
INC HL 23
Increment HL to point to the next character.
4E80
RET C9
RETURN to caller (displays only one digit, caller loops as needed).

4E7FH - Syntax Error Return

Sets error code 34H (syntax error) and returns to DOS error handler.

4E7F
LD A,34H 3E 34
Load Register A with error code 34H (syntax/parse error).
4E81
OR A B7
OR Register A with itself to set the NZ flag (indicates error condition).
4E82
RET C9
RETURN to caller with error code in A and NZ flag set.

4E83H - Clear Error and Return

Clears error status and returns successfully.

4E83
XOR A AF
Set Register A to zero and clear all flags. Indicates success.
4E84
RET C9
RETURN to caller with success status.

4E84H - Parse Numeric Value

Parses a decimal or hexadecimal number from the command line. Returns the value in DE. Hexadecimal values are indicated by a trailing 'H'.

4E84
LD DE,0000H 11 00 00
Initialize DE to 0000H - this will accumulate the parsed value.
4E87
LD B,D 42
Load Register B with 00H (from D) - B tracks if we've seen any digits.

[LOOP START] Parse digits from the input string.

4E88
LD A,(HL) 7E
Load Register A with the current character from the input.
4E89
CP 48H FE 48
Compare Register A against H (48H). If 'H', this is a hex number suffix.
4E8B
If the Z FLAG (Zero) has been set (found 'H'), JUMP to 4EA2H to handle hexadecimal conversion.
4E8D
SUB 30H D6 30
Subtract 30H (ASCII '0') from Register A to convert to numeric value.
4E8F
RET C D8
If the CARRY FLAG has been set (character < '0'), RETURN - end of number.
4E90
CP 0AH FE 0A
Compare Register A against 0AH. Valid decimal digits are 0-9.
4E92
RET NC D0
If the NO CARRY FLAG has been set (digit > 9), RETURN - not a decimal digit.
4E93
INC B 04
Increment B to indicate we've seen at least one valid digit.
4E94
INC HL 23
Increment HL to point to the next character.
4E95
PUSH HL E5
Save HL (input pointer) onto the stack.
4E96
LD H,D 62
Load Register H with D (high byte of accumulated value).
4E97
LD L,E 6B
Load Register L with E (low byte of accumulated value). Now HL = DE.
4E98
ADD HL,HL 29
Double HL (×2).
4E99
ADD HL,HL 29
Double HL again (×4).
4E9A
ADD HL,DE 19
Add original value (×5 total).
4E9B
ADD HL,HL 29
Double HL (×10 total). HL now contains previous value × 10.
4E9C
LD E,A 5F
Load Register E with the current digit value.
4E9D
LD D,00H 16 00
Load Register D with 00H. DE now contains the single digit.
4E9F
ADD HL,DE 19
Add the digit to the accumulated value.
4EA0
EX DE,HL EB
Exchange DE and HL. DE now contains the new accumulated value.
4EA1
POP HL E1
Restore HL (input pointer) from the stack.
4EA2
JUMP to 4E88H to process the next character. [LOOP]

4EA2H - Parse Hexadecimal Value

Parses a hexadecimal number from the command line (called when 'H' suffix is detected). Rescans the input to interpret digits as hex.

4EA2
INC HL 23
Increment HL to move past the 'H' suffix.
4EA3
LD A,B 78
Load Register A with B (the digit count).
4EA4
OR A B7
OR Register A with itself to test if any digits were seen.
4EA5
If the Z FLAG (Zero) has been set (no digits before 'H'), JUMP to 4E7FH to report syntax error.
4EA8
PUSH HL E5
Save HL (pointer past the 'H') onto the stack.
4EA9
LD C,B 48
Load Register C with B (the number of hex digits to parse).
4EAA
LD B,00H 06 00
Load Register B with 00H. BC now contains the digit count.
4EAC
LD H,B 60
Load Register H with 00H.
4EAD
LD L,B 68
Load Register L with 00H. HL = 0000H (will accumulate hex value).
4EAE
EX DE,HL EB
Exchange DE and HL. DE = 0000H, HL points back into the digit string.
4EAF
OR A B7
Clear carry flag.
4EB0
SBC HL,BC ED 42
Subtract BC (digit count) from HL to point back to the first hex digit.
4EB2
DEC HL 2B
Decrement HL by one more (adjust for off-by-one).

[LOOP START] Parse each hex digit.

4EB3
LD A,(HL) 7E
Load Register A with the current hex digit character.
4EB4
SUB 30H D6 30
Subtract 30H to convert from ASCII.
4EB6
CP 0AH FE 0A
Compare Register A against 0AH. If < 10, it's a digit 0-9.
4EB8
If the CARRY FLAG has been set (digit 0-9), JUMP to 4EC0H to use it directly.
4EBA
SUB 07H D6 07
Subtract 07H more to convert 'A'-'F' (41H-46H became 11H-16H, now becomes 0AH-0FH).
4EBC
CP 10H FE 10
Compare Register A against 10H. Valid hex digits A-F give values 0AH-0FH.
4EBE
If the NO CARRY FLAG has been set (invalid hex digit), JUMP to 4EDCH to report error.

Valid hex digit in A. Shift it into the accumulated value.

4EC0
EX DE,HL EB
Exchange DE and HL. HL now has accumulated value, DE has string pointer.
4EC1
ADD HL,HL 29
Shift HL left (×2).
4EC2
ADD HL,HL 29
Shift HL left (×4).
4EC3
ADD HL,HL 29
Shift HL left (×8).
4EC4
ADD HL,HL 29
Shift HL left (×16). HL now contains previous value × 16.
4EC5
OR L B5
OR Register A with L to merge the new digit into the low nibble.
4EC6
LD L,A 6F
Load Register L with the merged value.
4EC7
EX DE,HL EB
Exchange DE and HL. DE has new accumulated value, HL has string pointer.
4EC8
INC HL 23
Increment HL to point to the next character.
4EC9
DEC C 0D
Decrement C (digit counter).
4ECA
If the NZ FLAG (Not Zero) has been set (more digits to process), JUMP to 4EB3H. [LOOP]
4ECC
POP HL E1
Restore HL (pointer past the 'H') from the stack.
4ECD
RET C9
RETURN with hex value in DE.

4ECEH - Additional Hex Parsing Support

Additional hex digit validation and error handling for the hex parser.

4ECE
CP 0AH FE 0A
Compare Register A against 0AH to check if it's a valid hex digit.
4ED0
If the CARRY FLAG has been set (valid digit 0-9), JUMP to 4EC0H to process it.
4ED2
CP 11H FE 11
Compare Register A against 11H. Values 11H-16H represent 'A'-'F'.
4ED4
If the CARRY FLAG has been set (value < 11H = invalid), JUMP to 4EDCH to report error.
4ED6
CP 17H FE 17
Compare Register A against 17H. Valid range is 11H-16H (A-F).
4ED8
If the NO CARRY FLAG has been set (value >= 17H = invalid), JUMP to 4EDCH to report error.
4EDA
SUB 07H D6 07
Subtract 07H to convert 11H-16H to 0AH-0FH.
4EDC
JUMP to 4EC0H to add this digit to the accumulated value.

Invalid hex digit detected.

4EDC
POP HL E1
Restore HL from the stack (discard saved pointer).
4EDD
JUMP to 4E7FH to report syntax error.

4EE0H - Unused/Reserved Area

Unused byte area between code and data tables.

4EE0-4F07
DS 28H 00 00 ... (40 bytes)
Reserved/unused area (40 bytes of 00H padding).

4F08H - Decimal Conversion Constants Table

Table of 16-bit divisors used for converting binary values to decimal strings. Values are 10000, 1000, 100, 10, 1.

4F08
DW 2710H 10 27
10000 decimal (2710H) - divisor for ten-thousands digit.
4F0A
DW 03E8H E8 03
1000 decimal (03E8H) - divisor for thousands digit.
4F0C
DW 0064H 64 00
100 decimal (0064H) - divisor for hundreds digit.
4F0E
DW 000AH 0A 00
10 decimal (000AH) - divisor for tens digit.
4F10
DB 00H 00
End of divisor table marker (00H).

4F10H - Numeric Display Buffer

Buffer area for converting numbers to displayable decimal strings.

4F10
DB "00000" 30 30 30 30 30
5-digit display buffer initialized to "00000".
4F15
DB 00H 00
Null terminator for the display string.

4F16H - FCB Template Area

File Control Block template used for file operations.

4F16
DB 00H 00
Drive specifier byte (0 = default drive).
4F17-4F1B
DS 5 00 00 00 00 00
FCB filename area (5 bytes).

4F1CH - Saved Drive Number

Storage for the drive number passed in Register B on entry.

4F1C
DB 00H 00
Saved drive number from entry.
4F1D
DB FFH FF
Reserved byte (FFH).
4F1E-4F1F
DW 0000H 00 00
Reserved word.

4F20H - Display Column Counter

Counter for formatting parameter display output into columns.

4F20
DB 02H 02
Column counter (initialized to 02H).
4F21
DB 00H 00
Reserved byte.
4F22-4F23
DW FFFFH FF FF
Reserved word (FFFFH).

4F24H - Parameter Descriptor Lookup Table

Lookup table mapping two-letter parameter codes to their storage locations and types. Each byte encodes: Bit 7 = numeric(1)/boolean(0), Bit 6 = 16-bit(1)/8-bit(0), Bits 5-3 = bit position for booleans, Bits 4-0 = offset into storage area. Values FEH = skip entry, FFH = end of table.

4F24
DB 80H 80
AA - Numeric 8-bit parameter at offset 00H (43A0H) - Drive count.
4F25
DB 81H 81
AB - Numeric 8-bit parameter at offset 01H (43A1H).
4F26
DB 82H 82
AC - Numeric 8-bit parameter at offset 02H (43A2H).
4F27
DB 83H 83
AD - Numeric 8-bit parameter at offset 03H (43A3H).
4F28
DB 84H 84
AE - Numeric 8-bit parameter at offset 04H (43A4H).
4F29
DB 85H 85
AF - Numeric 8-bit parameter at offset 05H (43A5H).
4F2A
DB 86H 86
AG - Numeric 8-bit parameter at offset 06H (43A6H).
4F2B
DB 87H 87
AH - Numeric 8-bit parameter at offset 07H (43A7H).
4F2C
DB 88H 88
AI - Numeric 8-bit parameter at offset 08H (43A8H).
4F2D
DB 89H 89
AJ - Numeric 8-bit parameter at offset 09H (43A9H).
4F2E
DB 8AH 8A
AK - Numeric 8-bit parameter at offset 0AH (43AAH).
4F2F
DB 8BH 8B
AL - Numeric 8-bit parameter at offset 0BH (43ABH).
4F30
DB 8CH 8C
AM - Numeric 8-bit parameter at offset 0CH (43ACH).
4F31
DB 8DH 8D
AN - Numeric 8-bit parameter at offset 0DH (43ADH).
4F32
DB 8EH 8E
AO - Numeric 8-bit parameter at offset 0EH (43AEH).
4F33
DB 8FH 8F
AP - Numeric 8-bit parameter at offset 0FH (43AFH).
4F34
DB FEH FE
AQ - Skip (undefined parameter).
4F35
DB FEH FE
AR - Skip (undefined parameter).
4F36
DB FEH FE
AS - Skip (undefined parameter).
4F37
DB FEH FE
AT - Skip (undefined parameter).
4F38
DB FEH FE
AU - Skip (undefined parameter).
4F39
DB FEH FE
AV - Skip (undefined parameter).
4F3A
DB FEH FE
AW - Skip (undefined parameter).
4F3B
DB FEH FE
AX - Skip (undefined parameter).
4F3C
DB FEH FE
AY - Skip (undefined parameter).
4F3D
DB FEH FE
AZ - Skip (undefined parameter).
4F3E
DB C0H C0
BA - Numeric 16-bit parameter at offset 00H (43D0H-43D1H).
4F3F
DB C2H C2
BB - Numeric 16-bit parameter at offset 02H (43D2H-43D3H).
4F40
DB C4H C4
BC - Numeric 16-bit parameter at offset 04H (43D4H-43D5H).
4F41
DB C6H C6
BD - Numeric 16-bit parameter at offset 06H (43D6H-43D7H).
4F42
DB C8H C8
BE - Numeric 16-bit parameter at offset 08H (43D8H-43D9H).
4F43
DB CAH CA
BF - Numeric 16-bit parameter at offset 0AH (43DAH-43DBH).
4F44
DB CCH CC
BG - Numeric 16-bit parameter at offset 0CH (43DCH-43DDH).
4F45
DB CEH CE
BH - Numeric 16-bit parameter at offset 0EH (43DEH-43DFH).
4F46
DB FEH FE
BI - Skip (undefined parameter).
4F47
DB FEH FE
BJ - Skip (undefined parameter).
4F48
DB FEH FE
BK - Skip (undefined parameter).
4F49
DB FEH FE
BL - Skip (undefined parameter).
4F4A
DB FEH FE
BM - Skip (undefined parameter).
4F4B
DB FEH FE
BN - Skip (undefined parameter).
4F4C
DB FEH FE
BO - Skip (undefined parameter).
4F4D
DB FEH FE
BP - Skip (undefined parameter).
4F4E
DB FEH FE
BQ - Skip (undefined parameter).
4F4F
DB FEH FE
BR - Skip (undefined parameter).
4F50
DB FEH FE
BS - Skip (undefined parameter).
4F51
DB FEH FE
BT - Skip (undefined parameter).
4F52
DB FEH FE
BU - Skip (undefined parameter).
4F53
DB FEH FE
BV - Skip (undefined parameter).
4F54
DB FEH FE
BW - Skip (undefined parameter).
4F55
DB FEH FE
BX - Skip (undefined parameter).
4F56
DB FEH FE
BY - Skip (undefined parameter).
4F57
DB FEH FE
BZ - Skip (undefined parameter).
4F58
DB 00H 00
CA - Boolean parameter, bit 0 at offset 00H (43F0H bit 0).
4F59
DB 08H 08
CB - Boolean parameter, bit 1 at offset 00H (43F0H bit 1).
4F5A
DB 10H 10
CC - Boolean parameter, bit 2 at offset 00H (43F0H bit 2).
4F5B
DB 18H 18
CD - Boolean parameter, bit 3 at offset 00H (43F0H bit 3).
4F5C
DB 20H 20
CE - Boolean parameter, bit 4 at offset 00H (43F0H bit 4).
4F5D
DB 28H 28
CF - Boolean parameter, bit 5 at offset 00H (43F0H bit 5).
4F5E
DB 30H 30
CG - Boolean parameter, bit 6 at offset 00H (43F0H bit 6).
4F5F
DB 38H 38
CH - Boolean parameter, bit 7 at offset 00H (43F0H bit 7).
4F60
DB 01H 01
CI - Boolean parameter, bit 0 at offset 01H (43F1H bit 0).
4F61
DB 09H 09
CJ - Boolean parameter, bit 1 at offset 01H (43F1H bit 1).
4F62
DB 11H 11
CK - Boolean parameter, bit 2 at offset 01H (43F1H bit 2).
4F63
DB 19H 19
CL - Boolean parameter, bit 3 at offset 01H (43F1H bit 3).
4F64
DB 21H 21
CM - Boolean parameter, bit 4 at offset 01H (43F1H bit 4).
4F65
DB 29H 29
CN - Boolean parameter, bit 5 at offset 01H (43F1H bit 5).
4F66
DB 31H 31
CO - Boolean parameter, bit 6 at offset 01H (43F1H bit 6).
4F67
DB 39H 39
CP - Boolean parameter, bit 7 at offset 01H (43F1H bit 7).
4F68
DB 02H 02
CQ - Boolean parameter, bit 0 at offset 02H (43F2H bit 0).
4F69
DB 0AH 0A
CR - Boolean parameter, bit 1 at offset 02H (43F2H bit 1).
4F6A
DB 12H 12
CS - Boolean parameter, bit 2 at offset 02H (43F2H bit 2).
4F6B
DB 1AH 1A
CT - Boolean parameter, bit 3 at offset 02H (43F2H bit 3).
4F6C
DB FFH FF
End of table marker (FFH).

4F6DH - SYSGEN Command Handler

Handles the SYSTEM,S (SYSGEN) command which copies system files to another disk. Verifies the destination disk has valid BOOT/SYS and DIR/SYS files before proceeding.

4F6D
LD A,(4F1CH) 3A 1C 4F
Load Register A with the saved drive number from 4F1CH.
4F70
LD (5024H),A 32 24 50
Store the drive number in the SYSGEN FCB at 5024H.
4F73
GOSUB to SYS0 routine at 4C7AH to parse the next token (target drive).
4F76
RET C D8
If the CARRY FLAG has been set (parsing error), RETURN with error.
4F77
If the Z FLAG (Zero) has been set (no target drive specified), JUMP to 4E7FH to report syntax error.
4F7A
LD A,(HL) 7E
Load Register A with the target drive letter.
4F7B
SUB 30H D6 30
Subtract 30H (ASCII '0') to convert to drive number.
4F7D
LD (5024H),A 32 24 50
Store the target drive number in the SYSGEN FCB.
4F80
LD HL,500FH 21 0F 50
Point HL to the "BOOT" string constant at 500FH.
4F83
LD DE,501EH 11 1E 50
Point DE to the SYSGEN FCB filename area at 501EH.
4F86
LD BC,0004H 01 04 00
Load BC with 0004H (4 bytes to copy for "BOOT").
4F89
LDIR ED B0
Block copy "BOOT" to the FCB filename area.
4F8B
LD HL,501AH 21 1A 50
Point HL to the " SYS" extension string at 501AH.
4F8E
LD BC,0004H 01 04 00
Load BC with 0004H (4 bytes to copy for "/SYS").
4F91
LDIR ED B0
Block copy "/SYS" extension to complete filename "BOOT/SYS".
4F93
LD DE,501EH 11 1E 50
Point DE back to the FCB at 501EH.
4F96
GOSUB to SYS0 routine at 4424H to open the file and verify it exists.
4F99
RET NZ C0
If the NZ FLAG (Not Zero) has been set (BOOT/SYS not found), RETURN with error.

BOOT/SYS exists on target. Now check for DIR/SYS.

4F9A
LD HL,5013H 21 13 50
Point HL to the "DIR " string constant at 5013H.
4F9D
LD DE,501EH 11 1E 50
Point DE to the FCB filename area.
4FA0
LD BC,0007H 01 07 00
Load BC with 0007H (7 bytes for "DIR ").
4FA3
LDIR ED B0
Block copy "DIR" (padded) to FCB.
4FA5
LD HL,501AH 21 1A 50
Point HL to " SYS" extension.
4FA8
LD BC,0004H 01 04 00
Load BC with 0004H.
4FAB
LDIR ED B0
Block copy extension to complete "DIR/SYS".
4FAD
LD DE,501EH 11 1E 50
Point DE to the FCB.
4FB0
GOSUB to SYS0 to verify DIR/SYS exists.
4FB3
RET NZ C0
If the NZ FLAG (Not Zero) has been set (DIR/SYS not found), RETURN with error.

Both required files exist. Proceed with the system file copy operation.

4FB4
LD HL,4200H 21 00 42
Point HL to 4200H - source address for system data.
4FB7
LD (5028H),HL 22 28 50
Store the source pointer at 5028H.
4FBA
LD B,08H 06 08
Load Register B with 08H - number of sectors to copy.

[LOOP START] Copy system sectors to the target disk.

4FBC
PUSH BC C5
Save BC (sector counter) onto the stack.
4FBD
LD HL,(5028H) 2A 28 50
Load HL with the current source pointer from 5028H.
4FC0
LD DE,0100H 11 00 01
Load DE with 0100H (256 bytes = 1 sector).
4FC3
ADD HL,DE 19
Add 256 to advance to the next sector.
4FC4
LD (5028H),HL 22 28 50
Store the updated pointer.
4FC7
OR A B7
Clear carry flag.
4FC8
SBC HL,DE ED 52
Subtract 256 to get back to the current sector address.
4FCA
EX DE,HL EB
Exchange DE and HL. DE now has the sector buffer address.
4FCB
LD HL,501EH 21 1E 50
Point HL to the SYSGEN FCB.
4FCE
RST 28H EF
Call the DOS supervisor.
4FCF
DB 0FH 0F
SVC function 0FH: Write sector.
4FD0
POP BC C1
Restore BC (sector counter) from the stack.
4FD1
RET NZ C0
If the NZ FLAG (Not Zero) has been set (write error), RETURN with error.
4FD2
LD HL,501EH 21 1E 50
Point HL back to the FCB.
4FD5
INC (HL) 34
Increment the sector number in the FCB for the next write.
4FD6
Decrement B and if not zero, LOOP BACK to 4FBCH to copy the next sector. [LOOP]

All sectors copied successfully.

4FD8
XOR A AF
Set Register A to zero and clear all flags. Indicates success.
4FD9
RET C9
RETURN with success status.

4FDAH - Unused/Reserved

Unused area between SYSGEN code and data constants.

4FDA-500E
DS 35H 00 00 ... (53 bytes)
Reserved/unused area (53 bytes of 00H padding).

500FH - SYSGEN String Constants

String constants used by the SYSGEN routine for building filenames.

500F
DB "BOOT" 42 4F 4F 54
Filename constant "BOOT" for BOOT/SYS verification.
5013
DB "DIR " 44 49 52 20 20 20 20
Filename constant "DIR" (space-padded to 7 chars) for DIR/SYS verification.
501A
DB "/SYS" 2F 53 59 53
Extension constant "/SYS" for system file extensions.

501EH - SYSGEN FCB Template

File Control Block template used during SYSGEN file operations.

501E
DB 00H 00
FCB drive specifier (set dynamically).
501F-5023
DS 5 00 00 00 00 00
FCB filename area (filled during operation).
5024
DB 00H 00
Target drive number storage.
5025-5027
DS 3 00 00 00
FCB extension and flags.
5028
DW 0000H 00 00
Sector buffer pointer for SYSGEN copy loop.
502A
DB 00H 00
Reserved FCB byte.

502BH - Reserved Area

Additional reserved bytes before the NOP padding area.

502B-509E
DS 74H 00 00 ... (116 bytes)
Reserved/unused area (116 bytes).

509FH - NOP Padding to Sector Boundary

NOP instructions padding the module to a sector boundary. This fills the remainder of the allocated space for SYS17.

509F-51E7
DS 149H 00 00 ... (329 bytes)
NOP padding (329 bytes of 00H) to fill to the end of the SYS17/SYS file at 51E7H.