4D00H - SVC DISPATCHER: COMMAND/SERVICE ROUTER
SVC (Supervisor Call) Dispatch Table — Routes incoming service requests by comparing the SVC function code in Register A against known service numbers, then jumping to the appropriate handler. Register C contains a sub-function counter used for extended SVC routing.
When execution reaches 4D00H, Register A contains the SVC function code passed by the calling program via RST 28H. Register C contains a sub-function number or counter. This dispatcher compares A against each known SVC code and branches to the corresponding handler.
4D00
CP 23HFE 23
Compare Register A against 23H (SVC 23H = Filename Scanner). If A equals 23H, Z FLAG is set.
4D02
If Z FLAG set (SVC 23H), JUMP to
4D8AH to clear A and exit.
4D05
CP 43H FE 43
Compare A against 43H (SVC 43H = DOS Command Character).
4D07
If Z FLAG set (SVC 43H), JUMP to
4D7CH.
4D09
CP 63H FE 63
Compare A against 63H (SVC 63H = DOS Command Line Execution).
4D0B
If Z FLAG set (SVC 63H), JUMP to
4E47H to execute a DOS command line.
4D0E
CP 83H FE 83
Compare A against 83H (SVC 83H = Filename Parsing).
4D10
If Z FLAG set (SVC 83H), JUMP to
5154H.
4D13
CP A3H FE A3
Compare A against A3H (SVC A3H = Drive Prefix Insertion).
4D15
If Z FLAG set (SVC A3H), JUMP to
4F41H.
4D18
CP C3H FE C3
Compare A against C3H (SVC C3H = MINI-DOS Entry).
4D1A
If Z FLAG set (SVC C3H), JUMP to
4D5BH to enter MINI-DOS.
No SVC function code matched. Fall through to sub-function dispatch using Register C as countdown counter.
4D1C
DEC C 0D
DECrement C. Tests sub-function 1.
4D1D
Sub-function 1:
POP AF / RET. JUMP to
4D59H.
4D1F
DEC C 0D
DECrement C. Tests sub-function 2.
4D20
Sub-function 2:
Display Command List. JUMP to
50CEH.
4D23
DEC C 0D
DECrement C. Tests sub-function 3.
4D24
Sub-function 3: JUMP to
4D32H (falls through to more tests).
4D27
DEC C 0D
DECrement C. Tests sub-function 4.
4D28
Sub-function 4:
NMI/Break Handler. JUMP to
50F2H.
4D2B
DEC C 0D
DECrement C. Tests sub-function 5.
4D2C
Sub-function 5:
Close/Reset File State. JUMP to
4D80H.
4D2E
DEC C 0D
DECrement C. Tests sub-function 6.
4D2F
Sub-function 6:
NMI Return/Restore. JUMP to
5111H.
4D32
DEC C 0D
DECrement C. Tests sub-function 7.
4D33
Sub-function 7:
Double POP and Exit. JUMP to
4D78H.
4D35
DEC C 0D
DECrement C. Tests sub-function 8.
4D36
Sub-function 8:
Execute Command from HL. JUMP to
4E4BH.
4D39
DEC C 0D
DECrement C. Tests sub-function 9.
4D3A
Sub-function 9:
Display Error Table. JUMP to
4D48H.
4D3C
DEC C 0D
DECrement C (skip sub-function 10).
4D3D
DEC C 0D
DECrement C. Tests sub-function 11.
4D3E
Sub-function 11:
Parse Filename to Buffer. JUMP to
5167H.
4D41
DEC C 0D
DECrement C. Tests sub-function 12.
4D42
Sub-function 12:
Close/Reset File State. JUMP to
4D80H.
No sub-function matched. Return error code 2AH (General Error).
4D44
LD A,2AH3E 2A
Load A with 2AH — error code 2AH (General Error).
4D46
OR A B7
OR A with itself. Sets NZ FLAG to signal error.
4D47
RET C9
RETURN with error code 2AH and NZ FLAG set.
4D48H - SUB-FUNCTION 9: DISPLAY ERROR TABLE
Points HL to the error/status data table at 51DCH, then jumps to the system display routine at 4467H to output the message.
4D48
LD HL,51DCH 21 DC 51
Point Register Pair HL to 51DCH — a data table containing error/status codes: 1CH, 1FH, 03H, 00H.
4D4B
JUMP to 4467H — external system routine that displays error/status messages based on the table pointed to by HL.
4D4EH - SVC SETUP: PUSH RETURN CONTEXT VIA ALTERNATE REGISTERS
Sets up SVC return context by loading alternate register set BC' with SVC dispatch code and DE' with return address, pushing them onto the stack, then executing RST 28H to invoke the SVC handler.
4D4E
EXX D9
Switch to alternate register set (BC', DE', HL' become active).
4D4F
LD BC,E301H01 01 E3 01 01 E3
Load BC' with E301H: B'=E3H (SVC function code), C'=01H (sub-function 1).
4D52
LD DE,4978H11 78 49 11 78 49
Load DE' with 4978H — the BASIC warm-start / command loop re-entry address.
4D55
PUSH BC C5
Push SVC parameters (E301H) onto the stack.
4D56
PUSH DE D5
Push return address (4978H) onto the stack.
4D57
EXX D9
Switch back to main register set.
4D58
RST 28H EF
Execute RST 28H — invoke the SVC dispatcher with the stacked parameters.
4D59H - SUB-FUNCTION 1: POP AND RETURN
Simple SVC exit: pops the saved AF from the stack and returns to the caller.
4D59
POP AF F1
Restore Register Pair AF from the stack.
4D5A
RET C9
RETURN to the caller with restored AF.
4D5BH - SVC C3H HANDLER: ENTER MINI-DOS COMMAND INTERPRETER
Entry point for the MINI-DOS interactive command interpreter. Saves all CPU registers, manages the MINI-DOS stack frame (supporting nested invocations via 42BDH), and enters the command input loop. The system control block at 428AH tracks MINI-DOS state via bit 6.
SVC C3H is called when a program or BASIC wants to enter MINI-DOS mode — the interactive NEWDOS/80 command prompt. The routine saves the complete CPU state, checks for nested entry (bit 6 of 428AH), sets up a dedicated stack for MINI-DOS operations, and enters the command loop.
4D5B
GOSUB to
5142H — the register save subroutine. Saves AF, BC, DE, HL, IX, IY, and the alternate register set onto the stack, preserving the complete CPU state of the caller.
4D5E
LD BC,0000H010000 01 00 00
Load Register Pair BC with 0000H — initialize the saved previous stack pointer to zero (this is first entry into MINI-DOS, no outer frame).
4D61
EX DE,HL EB
Exchange DE and HL. Moves the caller's return context to DE while freeing HL for system control block access.
4D62
LD HL,428AH 21 8A 42
Point Register Pair HL to 428AH — the DOS System Status Byte. Key bits: 7=NMI/Break active, 6=MINI-DOS active, 5=DOS Ready, 4=special mode, 2=random access.
4D65
BIT 6,(HL) CB 76
Test bit 6 of (428AH). Bit 6 = MINI-DOS already active. If set, this is a nested entry.
4D67
SET 6,(HL) CB F6
SET bit 6 of (428AH) to 1, marking MINI-DOS as active.
4D69
If the Z FLAG has been set (bit 6 was 0 — this is a fresh entry, not nested), JUMP to
4D6FH. BC remains 0000H since there is no outer frame to save.
4D6B
LD BC,(42BDH) ED 4B BD 42
Fetch the saved MINI-DOS stack pointer from 42BDH into BC. This preserves the outer MINI-DOS frame's stack pointer for nested invocations.
4D6F
PUSH BC C5
Save the previous stack frame pointer (0000H for first entry, or saved SP for nested) onto the stack.
4D70
LD (42BDH),SP ED 73 BD 42
Store the current Stack Pointer to 42BDH — the
MINI-DOS Stack Frame Pointer. This allows the MINI-DOS exit routine at
4E27H to restore the stack when leaving command mode.
4D74
EX DE,HL EB
Exchange DE and HL. Restores the caller's context to HL.
4D75
JUMP to
4E4CH to enter the command input and execution loop (the command line parser/executor).
4D78H - SUB-FUNCTION 7: DOUBLE POP AND EXIT
Pops two values from the stack (discarding nested return addresses) and falls through to the SVC exit routine.
4D78
POP AF F1
Discard the first stacked value.
4D79
POP AF F1
Discard the second stacked value.
4D7A
JUMP to
4D8BH to enter the SVC exit routine.
4D7CH - SVC 43H HANDLER: DOS COMMAND CHARACTER
Returns the DOS command prompt character. Clears A and sets the Carry flag to indicate the character is available.
4D7C
XOR A AF
Set Register A to ZERO and clear all flags.
4D7D
SCF 37
Set the CARRY FLAG. With A=0 and Carry set, this signals the DOS command character is available.
4D7E
JUMP to
4D8BH to enter the SVC exit routine.
4D80H - SUB-FUNCTION 5/12: CLOSE/RESET FILE STATE FLAGS
Clears file and system status flags in the DOS System Control Block. Clears bits 7 (NMI/Break), 6 (MINI-DOS), and 4 (special mode) of 428AH, and clears bit 5 of 4289H. Falls through to 4D8AH to clear A and enter SVC exit.
4D80
LD HL,428AH 21 8A 42
Point Register Pair HL to 428AH — the DOS System Status Byte.
4D83
LD A,(HL) 7E
Fetch the DOS System Status Byte into Register A.
4D84
AND 2FH E6 2F
Mask Register A with 2FH (binary 00101111). Clears bits 7 (NMI/Break active), 6 (MINI-DOS active), and 4 (special mode) while preserving bits 5, 3, 2, 1, 0.
4D86
LD (HL),A 77
Store the masked value back to (428AH).
4D87
DEC HL 2B
DECrement HL to point to 4289H — auxiliary DOS flags.
4D88
RES 5,(HL) CB AE
RESET bit 5 of (4289H) to 0. Clears an auxiliary state flag.
Execution falls through to 4D8AH to clear A (success) and enter the SVC exit routine.
4D8AH - SVC 23H / COMMON EXIT: CLEAR A AND ENTER SVC EXIT
Sets Register A to zero (success) and falls through to the SVC exit routine at 4D8BH. Also serves as the handler for SVC 23H (Filename Scanner).
4D8A
XOR A AF
Set Register A to ZERO and clear all flags. Z FLAG is set, indicating successful SVC completion.
Execution falls through to 4D8BH — the central SVC exit handler.
4D8BH - SVC EXIT ROUTINE: STATUS PROCESSING AND RETURN DISPATCH
Central SVC exit handler. Disables interrupts, reads the DOS system status flags from 428AH/4289H, and determines whether to: return normally, dispatch to the MINI-DOS command loop, signal an error via RST 28H, or restore the system to the NEWDOS/80 READY prompt. This is the convergence point for all SVC completions in SYS1.
On entry, Register A contains the return status (0=success, non-zero=error code). The flags reflect the status: Z=success, NZ=error, Carry may be set for special returns. The routine loads DOS status into B (from 428AH) and auxiliary flags into C (from 4289H) to make routing decisions.
4D8B
DI F3
Disable Interrupts. Protects the state examination and stack manipulation from being interrupted.
4D8C
LD HL,428BH 21 8B 42
Point Register Pair HL to 428BH — auxiliary status byte.
4D8F
LD (HL),00H 36 00
Clear the auxiliary status byte at (428BH) to zero.
4D91
DEC HL 2B
DECrement HL to point to 428AH — the main DOS System Status Byte.
4D92
LD B,(HL) 46
Fetch the DOS System Status Byte from (428AH) into Register B. Bit meanings: 7=NMI/Break active, 6=MINI-DOS active, 5=DOS Ready, 4=special mode, 2=random access file open.
4D93
DEC HL 2B
DECrement HL to point to 4289H — auxiliary DOS flags.
4D94
LD C,(HL) 4E
Fetch auxiliary DOS flags from (4289H) into Register C. Bit 5 controls certain error routing decisions.
4D95
LD E,0BH 1E 0B
Load Register E with 0BH — default error dispatch sub-function code for RST 28H error handling.
4D97
PUSH AF F5
Save the SVC return status (A and flags) onto the stack for later retrieval.
4D98
BIT 2,B CB 50
Test bit 2 of Register B (DOS status). Bit 2 = Random Access file mode is active. If a random-access file is open, error handling takes a different path.
4D9A
If the NZ FLAG has been set (bit 2 is 1 — Random Access mode active), JUMP to
4DBFH to exit via the RST 28H error dispatch with sub-function E=0BH.
4D9C
POP AF F1
Restore the SVC return status from the stack.
4D9D
PUSH AF F5
Re-save the return status (needed later in the exit path).
4D9E
If the CARRY FLAG has been set (special return condition), JUMP to
4DA2H to check for specific error codes.
4DA0
If the Z FLAG has been set (A=0, success), JUMP to
4DACH for the normal success exit path.
A is non-zero (error) and Carry was not set. Check if it's the soft error 38H ("Illegal while in MINI-DOS").
4DA2
CP 38H FE 38
Compare Register A against 38H — error code for "Illegal while in MINI-DOS" (decimal 56).
4DA4
If the Z FLAG has been set (error is 38H — soft error), JUMP to
4DACH. This error is handled as a normal completion with the MINI-DOS state check.
4DA6
LD E,04H 1E 04
Load Register E with 04H — alternate error dispatch sub-function code.
4DA8
BIT 5,C CB 69
Test bit 5 of Register C (auxiliary flags from 4289H). Bit 5 controls whether the error should be dispatched via RST 28H or handled locally.
4DAA
If the NZ FLAG has been set (bit 5 is 1), JUMP to
4DBFH to dispatch the error via RST 28H with E=04H.
[SUCCESS / NORMAL EXIT PATH] — Either the SVC succeeded (A=0), or the error was 38H, or the auxiliary flags indicate local handling.
4DAC
RES 6,(HL) CB B6
RESET bit 6 of (4289H) to 0. Clears an auxiliary state flag used during SVC processing.
4DAE
BIT 6,B CB 70
Test bit 6 of Register B (DOS System Status from 428AH). Bit 6 = MINI-DOS active.
4DB0
If the NZ FLAG has been set (bit 6 is 1 —
MINI-DOS is active), JUMP to
4E27H to exit to the MINI-DOS command loop, restoring the MINI-DOS stack frame.
4DB2
LD A,(428CH) 3A 8C 42
Fetch system flag byte from 428CH into Register A.
4DB5
BIT 6,A CB 77
Test bit 6 of A — special error handling mode. If set, certain errors require RST 28H dispatch.
4DB7
If the Z FLAG has been set (bit 6 is 0 — normal mode), JUMP to
4DC4H for the NEWDOS/80 READY prompt display and command input.
4DB9
BIT 5,C CB 69
Test bit 5 of Register C (auxiliary flags) again for a secondary check.
4DBB
If the NZ FLAG has been set (bit 5 is 1), JUMP to
4DC4H.
4DBD
LD E,0CH 1E 0C
Load Register E with 0CH — yet another error dispatch sub-function code.
[ERROR EXIT VIA RST 28H] — The error requires signaling through the SVC mechanism. D=EBH (SVC function code for system error dispatch), C=E (error sub-function code).
4DBF
LD D,EBH 16 EB
Load Register D with EBH — the SVC function code for system error dispatch.
4DC1
LD A,D 7A
Load Register A with EBH from D.
4DC2
LD C,E 4B
Load Register C with the error sub-function code from E.
4DC3
RST 28H EF
Execute RST 28H — invoke the SVC dispatcher with A=EBH and C=error sub-function. This routes to the system error handler which will display the error and determine recovery action.
4DC4H - SYSTEM STATE RESTORATION AND NEWDOS/80 READY PROMPT
Checks the NMI/Break flag to determine the exit path. Normal mode: resets the stack to 41E0H, patches the BASIC ENTER key handler at 4478H (self-modifying code: JP or RET), displays "NEWDOS/80 READY", sets up the command input buffer, and calls the ROM line input routine at 0040H. NMI/Break mode: restores the NMI-saved stack, displays "MINI-NEWDOS/80 READY" instead. Both paths end by enabling interrupts, displaying the prompt, setting the DOS Ready flag (bit 5 of 428AH), and entering ROM line input with the SVC context E308H stacked so the entered command routes to sub-function 8 at 4E4BH.
4DC4
BIT 7,B CB 78
Test bit 7 of Register B (DOS System Status Byte from 428AH). Bit 7 = NMI/Break active.
4DC6
If the NZ FLAG has been set (bit 7 is 1 —
NMI/Break is active), JUMP to
4DDCH to skip the normal stack reset and ENTER key patch, using the NMI return path instead.
4DC8
LD SP,41E0H 31 E0 41
Reset the Stack Pointer to 41E0H — the DOS system stack base. This reclaims all stack space for a fresh command input cycle.
4DCB
BIT 5,A CB 6F
Test bit 5 of Register A (from 428CH system flags). This determines whether the BASIC ENTER key handler should be enabled (JP) or disabled (RET).
4DCD
LD HL,4546H 21 46 45
Point Register Pair HL to 4546H — the NEWDOS/80 command intercept routine address. This is the target of the patched JP instruction at 4478H.
4DD0
LD (4479H),HL 22 79 44
Store the intercept address 4546H to 4479H — this is bytes 2-3 of the JP instruction at 4478H (the ENTER key handler jump target).
4DD3
LD A,C3H 3E C3
Load Register A with C3H — the Z80 opcode for JP (unconditional jump). This will enable the command intercept.
4DD5
If the Z FLAG has been set (bit 5 was 0 — normal mode, intercept enabled), JUMP to
4DD9H to store the JP opcode.
4DD7
LD A,C9H 3E C9
Load Register A with C9H — the Z80 opcode for RET (return). This disables the command intercept by replacing the JP with a RET.
4DD9
LD (4478H),A 32 78 44
Store the opcode (C3H=JP or C9H=RET) to memory at 4478H. [SELF-MODIFYING CODE] — This dynamically enables or disables the BASIC ENTER key command intercept, controlling whether typed commands are routed through the NEWDOS/80 command interpreter.
[PROMPT DISPLAY] — Select the appropriate prompt string based on NMI/Break state.
4DDC
LD HL,51CCH 21 CC 51
Point Register Pair HL to 51CCH — the "NEWDOS/80 READY" prompt string (followed by 0DH carriage return).
4DDF
BIT 7,B CB 78
Re-test bit 7 of Register B — NMI/Break active.
4DE1
If the Z FLAG has been set (bit 7 is 0 — no NMI active), JUMP to
4DEAH to display "NEWDOS/80 READY".
4DE3
LD SP,(42BBH) ED 7B BB 42
Load the Stack Pointer from 42BBH — the NMI/Break Saved Stack Pointer. This restores SP to the value saved when the NMI occurred.
4DE7
LD HL,51C7H 21 C7 51
Point Register Pair HL to
51C7H — the
"MINI-" prefix string. Since 51C7H contains "MINI-" followed immediately by 51CCH which contains "NEWDOS/80 READY\r", the display routine will output the complete string
"MINI-NEWDOS/80 READY".
4DEA
EI FB
Enable Interrupts. The critical state examination is complete.
4DEB
LD A,0DH 3E 0D
Load Register A with 0DH (ASCII: CR — Carriage Return).
4DED
GOSUB to ROM routine at 0033H to display a carriage return, moving the cursor to a new line before the prompt.
4DF0
BIT 5,C CB 69
Test bit 5 of Register C (auxiliary flags from 4289H). If 0, the prompt string should be displayed; if 1, it is suppressed.
4DF2
If the Z FLAG has been set (bit 5 is 0 — display prompt), GOSUB to external routine at 4467H to display the string pointed to by HL ("NEWDOS/80 READY" or "MINI-NEWDOS/80 READY").
4DF5
LD HL,428AH 21 8A 42
Point Register Pair HL to the DOS System Status Byte.
4DF8
SET 5,(HL) CB EE
SET bit 5 of (428AH) to 1 — the DOS Ready flag. Indicates the system is ready and waiting for command input.
4DFA
LD A,(HL) 7E
Fetch the updated DOS System Status Byte.
4DFB
AND C0H E6 C0
Mask with C0H (binary 11000000) to isolate bits 7 (NMI) and 6 (MINI-DOS).
4DFD
DEC HL 2B
DECrement HL to point to 4289H.
4DFE
If the NZ FLAG has been set (NMI or MINI-DOS is active), JUMP to
4E02H to skip the video reset — video state should not be disturbed during break mode.
4E00
BIT 5,(HL) CB 6E
Test bit 5 of (4289H) — secondary check for whether video reset should be performed.
4E02
If the NZ FLAG has been set (skip video reset), JUMP to
4E11H to proceed directly to command input setup.
[VIDEO RESET] — Performed only on a clean return to DOS (no NMI, no MINI-DOS, no special flags).
4E04
XOR A AF
Set Register A to ZERO.
4E05
LD (4214H),A 32 14 42
Clear the display state variable at 4214H.
4E08
LD HL,4030H 21 30 40
Load Register Pair HL with 4030H — the display buffer start address.
4E0B
LD (4204H),HL 22 04 42
Store to the display pointer variable at 4204H.
4E0E
GOSUB to ROM routine at 01F8H for video display reset.
[COMMAND INPUT SETUP] — Set up the stack with SVC context (E308H = sub-function 8 "Execute Command from HL") and return address (497BH), then call the ROM line input routine. When the user presses ENTER, the stacked SVC context routes the typed command to sub-function 8 at 4E4BH.
4E11
LD BC,E308H 01 08 E3
Load BC with SVC context: B=E3H (SVC function code), C=08H (sub-function 8 = Execute Command from HL).
4E14
LD DE,497BH 11 7B 49
Load DE with 497BH — the return address after the command completes.
4E17
PUSH BC C5
Push the SVC context (E308H) onto the stack.
4E18
PUSH DE D5
Push the return address (497BH) onto the stack.
4E19
LD HL,(4225H) 2A 25 42
Fetch the command input buffer pointer from 4225H into HL.
4E1C
LD (42C7H),HL 22 C7 42
Save the buffer start address to 42C7H — the previous command line pointer. This is used by the "R" (Repeat) command to re-execute the last command.
4E1F
LD B,4FH 06 4F
Load Register B with 4FH (79 decimal) — the maximum input line length.
4E21
LD HL,4225H 21 25 42
Point Register Pair HL to the command buffer address variable at 4225H.
4E24
JUMP to ROM
Line Input routine at 0040H. Parameters: B=max length (79), HL=buffer address pointer. When the user presses ENTER, ROM returns via the stacked addresses; the SVC context E308H routes the entered command to sub-function 8 at
4E4BH for parsing and execution.
4E27H - MINI-DOS EXIT: RESTORE STACK AND RETURN TO CALLER
Handles exit from a MINI-DOS command or session. Restores the MINI-DOS stack frame from 42BDH, checks auxiliary flags, manages nested MINI-DOS invocations (clearing the MINI-DOS active flag on the outermost exit), restores the previous stack frame pointer, and returns to the caller through the register restoration routine at 5132H.
4E27
POP DE D1
Pop the saved AF (from PUSH AF at 4D97H) into DE for temporary storage. The original A (return status) and flags are preserved in DE.
4E28
LD SP,(42BDH) ED 7B BD 42
Load the Stack Pointer from 42BDH — the
MINI-DOS Stack Frame Pointer. This restores SP to the value saved when MINI-DOS was entered at
4D70H.
4E2C
BIT 5,C CB 69
Test bit 5 of Register C (auxiliary flags from 4289H).
4E2E
If the Z FLAG has been set (bit 5 is 0), JUMP to
4E34H to proceed with normal MINI-DOS exit.
4E30
BIT 4,B CB 60
Test bit 4 of Register B (DOS status) — special mode.
4E32
If the NZ FLAG has been set (bit 4 is 1 — special mode active), JUMP back to
4DDCH to re-enter the prompt display and command input loop.
[RESTORE PREVIOUS MINI-DOS FRAME] — Pop the saved outer stack pointer and check if this is the outermost MINI-DOS session.
4E34
POP BC C1
Pop the saved previous MINI-DOS stack pointer from the stack (pushed at
4D6FH). If 0000H, this is the outermost MINI-DOS session.
4E35
LD A,B 78
Load Register A with the high byte of the saved pointer.
4E36
OR C B1
OR A with C to test if BC is zero. Z FLAG is set if BC = 0000H (outermost session).
4E37
If the NZ FLAG has been set (BC is non-zero — this is a
nested MINI-DOS session), JUMP to
4E3CH to skip clearing the MINI-DOS active flag.
4E39
INC HL 23
INCrement HL to advance from 4289H to 428AH — the DOS System Status Byte.
4E3A
RES 6,(HL) CB B6
RESET bit 6 of (428AH) to 0. Clears the MINI-DOS active flag since the outermost MINI-DOS session is ending.
4E3C
RES 4,(HL) CB A6
RESET bit 4 of the current status byte to 0. Clears the special mode flag.
4E3E
LD (42BDH),BC ED 43 BD 42
Store BC (the outer frame's stack pointer, or 0000H) back to 42BDH, restoring the MINI-DOS Stack Frame Pointer to the previous nesting level.
4E42
PUSH DE D5
Push DE (containing the original return status from the POP at 4E27H) onto the stack.
4E43
POP AF F1
Pop the return status into AF, properly restoring both the A register and flags.
4E44
JUMP to 5132H to restore all saved registers (IY, IX, alternate set, main set) and return to the original caller of SVC C3H.
4E47H - SVC 63H HANDLER: DOS COMMAND LINE EXECUTION ENTRY
Entry point for SVC 63H — executes a DOS command from a command line string. Resets the stack to the DOS base and saves AF before falling through to the command parser.
4E47
LD SP,41E0H 31 E0 41
Reset the Stack Pointer to 41E0H — the DOS system stack base. Ensures a clean stack for command processing.
4E4A
PUSH AF F5
Save Register Pair AF onto the stack (preserves the SVC status across the stack reset).
Execution falls through to 4E4BH.
4E4BH - COMMAND LINE PARSER AND EXECUTOR
Core command line processing routine. Receives input from either the ROM line input (via stacked SVC context E308H sub-function 8) or from SVC 63H. Copies the command line from the source to the working buffer at (4225H) while converting to uppercase via CALL 4548H. Handles the "R" (Repeat) command to re-execute the previous command. Then matches the first word against the command name table at 4F6FH, comparing character-by-character with support for command abbreviations.
4E4B
POP AF F1
Restore Register Pair AF from the stack (saved at 4E4AH or by the ROM input routine).
4E4C
LD BC,402DH 01 2D 40
Load Register Pair BC with 402DH — the command completion return address (outer return after the command finishes).
4E4F
LD DE,4408H 11 08 44
Load Register Pair DE with 4408H — the inner return address (SVC handler return point).
4E52
PUSH BC C5
Push the outer return address (402DH) onto the stack.
4E53
PUSH DE D5
Push the inner return address (4408H) onto the stack.
4E54
EX DE,HL EB
Exchange DE and HL. Moves the command line source pointer from HL to DE, freeing HL for the system status access.
4E55
LD HL,428AH 21 8A 42
Point Register Pair HL to 428AH — the DOS System Status Byte.
4E58
RES 5,(HL) CB AE
RESET bit 5 of (428AH) to 0 — clears the DOS Ready flag. The system is now processing a command, not waiting for input.
4E5A
LD HL,4225H 21 25 42
Point Register Pair HL to the command input buffer at 4225H. This is the working buffer where the command line will be copied and normalized.
4E5D
LD B,50H 06 50
Load Register B with 50H (80 decimal) — maximum command line length. B serves as a countdown to prevent buffer overruns.
4E5F
LD A,(HL) 7E
Fetch the first byte of the command buffer into Register A.
4E60
CP 0DH FE 0D
Compare Register A against 0DH (ASCII: CR — Carriage Return). If the command line starts with CR, it is empty.
4E62
RET Z C8
If the Z FLAG has been set (command line is empty — just a CR), RETURN immediately. The stacked return addresses route back to the DOS READY prompt.
4E63
PUSH HL E5
Save the command buffer start position onto the stack for later use by the "R" command check and command name matching.
[COMMAND LINE COPY AND UPPERCASE CONVERSION LOOP] — Copy characters from the source (DE) to the working buffer (HL), converting each character to uppercase via the external routine at 4548H. Stop at carriage return (0DH) or when the maximum length is reached.
4E64
LD A,(DE) 1A
Fetch the next character from the source command line at (DE) into Register A.
4E65
INC DE 13
INCrement DE to advance the source pointer.
4E66
GOSUB to the external character conversion routine at 4548H. Converts lowercase letters to uppercase.
4E69
CP 0DH FE 0D
Compare Register A against 0DH (CR). Tests for end of input.
4E6B
LD (HL),A 77
Store the (possibly converted) character to the working buffer at (HL).
4E6C
INC HL 23
INCrement HL to advance the destination buffer pointer.
4E6D
If the Z FLAG has been set (character was CR — end of input), JUMP to
4E76H to exit the copy loop and proceed with command processing.
4E6F
DECrement B and loop back to 4E64H if not zero. [LOOP] — Continues copying up to 80 characters.
B reached zero — the command line exceeded the maximum length of 80 characters. Return error 36H.
4E71
POP AF F1
Discard the saved buffer start (from 4E63H PUSH HL).
4E72
LD A,36H 3E 36
Load Register A with 36H — error code 36H ("Command line too long").
4E74
OR A B7
OR A with itself. Sets the NZ FLAG (A is non-zero) to indicate error.
4E75
RET C9
RETURN with error code 36H in A and NZ FLAG set.
[CHECK FOR "R" (REPEAT) COMMAND] — If the "R" command feature is enabled (bit 5 of 428DH), check if the user typed just "R" followed by CR. If so, replace the current command buffer with the previous command.
4E76
LD A,(428DH) 3A 8D 42
Fetch the command processing flags from 428DH into Register A.
4E79
BIT 5,A CB 6F
Test bit 5 of A — enables the "R" (Repeat) command feature.
4E7B
If the Z FLAG has been set (bit 5 is 0 — Repeat feature disabled), JUMP to
4E8CH to skip the "R" check and go directly to command matching.
4E7D
LD HL,(4225H) 2A 25 42
Fetch the command buffer start address from 4225H.
4E80
LD DE,0D52H 11 52 0D
Load DE with 0D52H: D=0DH (CR), E=52H (ASCII 'R'). This is the pattern to match: the letter "R" followed by a carriage return.
4E83
RST 18H DF
Execute RST 18H — a two-byte comparison routine. Compares the two bytes at (HL) against E and D (i.e., checks if the command line is "R" + CR). Returns Z if match.
4E84
If the NZ FLAG has been set (command line is NOT "R
CR"), JUMP to
4E8CH to proceed with normal command matching.
The command is "R" — repeat the previous command. Replace the current buffer pointer with the saved previous command pointer from 42C7H.
4E86
LD HL,(42C7H) 2A C7 42
Fetch the
previous command line pointer from 42C7H into HL. This was saved at
4E1CH during the last command input cycle.
4E89
LD (4225H),HL 22 25 42
Store the previous command pointer to 4225H replacing the current "R" command with the previous command. The command will now be re-parsed and re-executed.
[COMMAND NAME TABLE MATCHING] — Compare the command line against each entry in the command name table at 4F6FH. The table contains command names with bit 7 set on the last character as an end-of-name marker.
4E8C
POP HL E1
Restore Register Pair HL from the stack — the command line start position (saved at 4E63H).
4E8D
LD DE,4F6FH 11 6F 4F
Point Register Pair DE to 4F6FH — the start of the NEWDOS/80 Command Name Table.
4E90
PUSH HL E5
Save the command line start position onto the stack. This is needed to restart the comparison against the next table entry if the current one doesn't match.
4E91
LD A,(DE) 1A
Fetch the current byte from the command name table at (DE) into Register A. Table characters have bit 7 set on the last character of each command name.
4E92
CP (HL) BE
Compare the table character (A) against the command line character at (HL). Note: the comparison includes bit 7, which is set on the last table character but NOT on the command line character. This means the last character of a full-length match will always fail this comparison, and the code handles this via the abbreviation check at 4E9CH.
4E93
INC DE 13
INCrement DE to advance the table pointer.
4E94
INC HL 23
INCrement HL to advance the command line pointer.
4E95
If the Z FLAG has been set (characters match so far), JUMP back to
4E91H to compare the next character pair.
[LOOP] — Continues matching until a mismatch is found or all characters are compared.
Characters did not match. Back up one position and check if the mismatch occurred at the last character of the table entry name (which has bit 7 set). If so, the command line may still be a partial match (abbreviation).
4E97
DEC HL 2B
DECrement HL to back up the command line pointer one position (to the mismatching character).
4E98
DEC DE 1B
DECrement DE to back up the table pointer to the mismatching table character.
4E99
RLCA 07
Rotate Register A Left through Carry. The bit 7 of the table character (which indicates "last character of name") is rotated into the CARRY FLAG. If Carry is set, this was the last character of the table entry name.
4E9A
If the NO CARRY FLAG has been set (bit 7 was 0 — NOT the last character of the name), JUMP to
4EA1H to skip to the next table entry. The mismatch occurred before the end of the name, so this is definitely not a match.
The mismatch occurred at the last character of the table entry. The command line may match if it is a valid abbreviation. Call the abbreviation verification routine.
4E9C
GOSUB to 4C7AH — an external command abbreviation verification routine. This checks whether the command line text constitutes a valid abbreviation of the full command name. Returns with Carry clear if the abbreviation is valid, Carry set if not.
4E9F
If the NO CARRY FLAG has been set (abbreviation is valid —
command matched!), JUMP to
4EBEH to read the command's dispatch data and execute it.
[NO MATCH — SKIP TO NEXT TABLE ENTRY] — The current command name did not match. Skip past the remaining characters of this table entry and its 2 dispatch data bytes to reach the next entry.
4EA1
POP HL E1
Restore Register Pair HL from the stack. This recovers the command line start position (saved at 4E90H) so it can be compared against the next table entry.
4EA2
LD A,(DE) 1A
Fetch the next byte from the command name table into Register A.
4EA3
RLCA 07
Rotate Register A Left through Carry. Tests whether bit 7 is set (last character of the current table entry name).
4EA4
INC DE 13
INCrement DE to advance the table pointer.
4EA5
If the NO CARRY FLAG has been set (bit 7 was 0 — not yet the last character), JUMP back to
4EA2H to continue scanning.
[LOOP] — This loop skips past the remaining name characters until the last character (with bit 7 set) is found.
4EA7
INC DE 13
INCrement DE to skip past the first dispatch data byte after the name.
4EA8
INC DE 13
INCrement DE to skip past the second dispatch data byte. DE now points to either the start of the next table entry or the end-of-table marker (00H).
4EA9
LD A,(DE) 1A
Fetch the byte at the current table position into Register A. If this is 00H, the end of the command table has been reached; otherwise, it is the first character of the next command name.
4EAA
OR A B7
OR Register A with itself. Tests whether A is zero (end of table) or non-zero (more entries to check).
4EAB
If the NZ FLAG has been set (A is non-zero — more table entries exist), JUMP back to
4E90H to try matching against the next command name.
[LOOP]
[END OF TABLE — NO COMMAND MATCHED] — All table entries have been checked and none matched the command line. Set default dispatch values for an unrecognized command, which will attempt to run it as a BASIC program or system command.
4EAD
LD BC,E443H
Load Register Pair BC with E443H. B = E4H, C = 43H. These are the default dispatch values for an unrecognized command: C = 43H (flags: bit 6 set indicating special handling, low bits = 03H), B = E4H (parameter byte).
4EB0
LD D,41H
Load Register D with 41H. This is the default execution parameter for unrecognized commands.
4EB2
LD A,(HL) 7E
Fetch the first character of the unrecognized command from the command line at (HL) into Register A.
4EB3
CP 2AH FE2A
Compare Register A against 2AH (ASCII: * — asterisk). An asterisk prefix indicates a special system command or overlay invocation.
4EB5
If the NZ FLAG has been set (first character is NOT
*), JUMP to
4EC7H to process the command with the default dispatch values.
The command starts with * — this is a system overlay command. Set up the special SVC dispatch for overlay invocation.
4EB7
LD A,EBH
Load Register A with EBH — the SVC function code for system overlay dispatch.
4EB9
LD C,07H
Load Register C with 07H — the sub-function code for overlay invocation.
4EBB
RST 28H EF
Execute RST 28H with A = EBH C = 07H to invoke the system overlay handler. This loads and executes the overlay program specified after the * prefix.
4EBC
POP BC C1
Restore Register Pair BC from the stack (clean up after overlay return).
4EBD
RET C9
RETURN to the command completion handler at the stacked address.
4EBEH - COMMAND DISPATCH: READ TABLE DATA AND EXECUTE
After a command name has been matched in the command table, reads the 2-byte dispatch data following the name, combines it with the first byte of the next table entry, and routes to the appropriate command handler. The dispatch data encodes the command's flags, SVC number, and execution parameters.
At this point, DE points to the first dispatch byte immediately after the matched command name (past the last character with bit 7 set). HL points into the command line past the matched portion. The code reads three bytes from the table: the two dispatch bytes for this entry, plus the first byte of the next entry (or the 00 end-of-table marker) which is loaded into D.
4EBE
POP BC C1
Restore Register Pair BC from the stack. This discards the saved command line start pointer (from 4E90H) since the match has been confirmed and the pointer is no longer needed.
4EBF
LD A,(DE) 1A
Fetch the first dispatch byte from the command table into Register A. This byte contains the command flags.
4EC0
LD C,A 4F
Load Register C with the command flags byte. The flags encode the command's properties:
Bit 7: Extended dispatch flag
Bit 6: Special handling (inhibit if MINI-DOS active with bit 7 of status set)
Bit 5: Requires filename parameter
Bit 4: Requires additional parameter
Bit 3: Swap HL/stack operation
Bits 2-0: SVC sub-function number or parameter count
4EC1
INC DE 13
INCrement DE to advance to the second dispatch byte.
4EC2
LD A,(DE) 1A
Fetch the second dispatch byte from the command table into Register A. This byte is the SVC function parameter (typically an execution address high byte or SVC code).
4EC3
LD B,A 47
Load Register B with the SVC function parameter byte.
4EC4
INC DE 13
INCrement DE to advance past the second dispatch byte. DE now points to the first byte of the next table entry (or the 00 end-of-table marker).
4EC5
LD A,(DE) 1A
Fetch the byte at the current position into Register A. This is either the first character of the next command name or the 00 end-of-table marker.
4EC6
LD D,A 57
Load Register D with this byte. D is used as an additional dispatch parameter for some commands.
Now C = command flags, B = SVC parameter, D = additional parameter. The code checks various flag bits to determine how to dispatch the command.
4EC7
BIT 6,C CB 71
Test bit 6 of Register C (command flags). Bit 6 indicates the command has special access restrictions — it must check whether the current system state allows execution.
4EC9
If the Z FLAG has been set (bit 6 is 0 — no special restrictions), JUMP to
4EDAH to skip the restriction check and proceed with command execution.
4ECB
LD A,(428AH) 3A 8A 42
Fetch the DOS System Status Byte from (428AH) into Register A to check the current system state.
4ECE
RLCA 07
Rotate Register A Left through Carry. Bit 7 of the status byte (NMI/Break active) rotates into the Carry flag.
4ECF
If the NO CARRY FLAG has been set (bit 7 was 0 — no NMI/Break active), JUMP to
4EDAH to proceed normally. The restriction only applies when bit 7 (NMI/Break) is active.
4ED1
AND 80H
Mask Register A with 80H. After RLCA, the original bit 6 (MINI-DOS active) is now in bit 7 position. This isolates the original MINI-DOS flag.
4ED3
LD A,38H
Load Register A with 38H — error code 38H ("Illegal while in MINI-DOS", decimal 56). This error will be returned if the command is not allowed.
4ED5
If the NZ FLAG has been set (bit 6 of original status was 1 —
MINI-DOS is active AND NMI/Break is active), JUMP to
4D8BH to exit with error 38H. This command is not permitted in MINI-DOS during a break condition.
4ED8
OR A B7
OR Register A with itself. Since the AND 80H result was zero (NZ was not set), A is now 0. This sets the Z FLAG, clearing any error condition.
4ED9
RET C9
RETURN with A = 0 and Z FLAG set (success). The stacked return address routes to the next stage of command handling.
[COMMAND PARAMETER PROCESSING] — The command flags in C are examined to determine what parameters the command requires and how to set up the execution call.
4EDA
LD A,C 79
Load Register A with Register C (command flags byte).
4EDB
AND 1FH
Mask Register A with 1FH (binary 00011111). This extracts the low 5 bits of the command flags, isolating the command sub-type and parameter count while clearing the upper flag bits.
4EDD
LD C,A 4F
Store the masked command sub-type back into Register C.
4EDE
PUSH BC C5
Save Register Pair BC (B = SVC parameter, C = command sub-type) onto the stack. These will be used later to invoke the command's SVC handler.
4EDF
LD C,D 4A
Load Register C with Register D (the additional parameter from the table — either the next entry's first character or 00). This is used as a secondary dispatch parameter.
4EE0
LD A,C 79
Load Register A with Register C (the additional parameter, now in C).
4EE1
AND C0H E6 C0
Mask Register A with C0H (binary 11000000). This tests whether the additional parameter has either of its top 2 bits set. If non-zero, the command requires a filename parameter to be parsed first.
4EE3
If the NZ FLAG has been set (top 2 bits are set — command requires a filename), GOSUB to
5164H to parse the filename from the command line into the default file parameter block at 4480H.
4EE6
If the NZ FLAG has been set after the filename parse (parse error), JUMP to
4F08H to handle the error by returning error code 30H.
4EE8
BIT 5,C CB 69
Test bit 5 of Register C (the additional parameter). Bit 5 indicates the command requires a second filename (e.g., COPY, RENAME).
4EEA
If the Z FLAG has been set (bit 5 is 0 — no second filename needed), JUMP to
4F0CH to continue with single-parameter processing.
The command requires a second filename. Parse it, checking for the "TO" keyword between the two filenames.
4EEC
GOSUB to 4C7EH — an external routine that advances the command line pointer past whitespace and checks for the next parameter.
4EEF
If the CARRY FLAG has been set (end of line or invalid syntax), JUMP to
4EBCH to clean up and return.
4EF1
PUSH BC C5
Save Register Pair BC (current parameters) onto the stack.
4EF2
LD BC,51C4H
Point Register Pair BC to 51C4H — the "TO" keyword string (ASCII: "TO" followed by 00H). This is used to check if the user typed "TO" between two filenames (e.g., "COPY file1 TO file2").
4EF5
GOSUB to 4C6AH — an external keyword matching routine that checks if the command line at the current position matches the string pointed to by BC ("TO"). Returns Z if match, NZ if no match.
4EF8
POP BC C1
Restore Register Pair BC from the stack.
4EF9
If the NZ FLAG has been set ("TO" keyword was NOT found), JUMP to
4F00H to parse the second filename without the "TO" separator.
4EFB
GOSUB to 4C7EH to advance past the "TO" keyword and any following whitespace.
4EFE
If the CARRY FLAG has been set (end of line after "TO" — missing second filename), JUMP to
4EBCH to clean up and return.
4F00
PUSH DE D5
Save Register Pair DE (current table position or parameter) onto the stack.
4F01
LD DE,51E0H
Point Register Pair DE to 51E0H — a secondary filename buffer where the second filename will be stored.
4F04
GOSUB to
5167H to parse the second filename from the command line into the buffer at 51E0H.
4F07
POP DE D1
Restore Register Pair DE from the stack.
4F08
LD A,30H
Load Register A with 30H — error code 30H (syntax/parameter error). This will be the return value if the filename parse failed.
4F0A
If the NZ FLAG has been set (filename parse failed), JUMP to
4EBCH to clean up and return with the error code.
4F0C
BIT 4,C CB 61
Test bit 4 of Register C (additional parameter). Bit 4 indicates the command requires an additional numeric or text parameter beyond the filename.
4F0E
If the NZ FLAG has been set (bit 4 is 1 — additional parameter required), GOSUB to 4C7AH to parse the additional parameter from the command line.
4F11
If the NZ FLAG has been set (parameter parse failed), JUMP to
4EBCH to clean up and return with an error.
4F13
BIT 3,C CB 59
Test bit 3 of Register C (additional parameter). Bit 3 indicates a stack/parameter swap operation is needed before dispatch.
4F15
If the Z FLAG has been set (bit 3 is 0 — no swap needed), JUMP to
4F19H.
4F17
EX (SP),HL E3
Exchange HL with the value on top of the stack. This swaps the command line pointer with the saved SVC parameters, reordering them for the dispatch call.
4F18
PUSH HL E5
Save the exchanged value (originally on the stack) back onto the stack.
4F19
LD A,C 79
Load Register A with Register C (the additional parameter byte).
4F1A
AND 07H E6 07
Mask Register A with 07H (binary 00000111). This extracts the low 3 bits, which encode the SVC sub-function table index — the number of address entries to skip in a secondary dispatch table.
4F1C
If the Z FLAG has been set (low 3 bits are 0 — no secondary table lookup needed), JUMP to
4F2CH to skip the table scan and proceed directly to SVC dispatch.
The low 3 bits are non-zero, indicating a secondary dispatch through a table of 3-byte entries starting at 51BBH. The code advances through the table by the specified number of entries.
4F1E
PUSH HL E5
Save Register Pair HL (command line pointer) onto the stack.
4F1F
LD HL,51BBH
Point Register Pair HL to 51BBH — the start of a secondary dispatch address table. Each entry is 3 bytes (a JP instruction address or similar triplet).
4F22
INC HL 23
INCrement HL by 1 (advance through table).
4F23
INC HL 23
INCrement HL by 1.
4F24
INC HL 23
INCrement HL by 1. Together with the previous two INCs, this advances HL by 3 bytes — one table entry.
4F25
DEC A 3D
DECrement Register A (entry counter) by 1.
4F26
If the NZ FLAG has been set (more entries to skip), JUMP back to
4F22H.
[LOOP] — Advances through the table by A entries of 3 bytes each.
4F28
GOSUB to
4F41H to perform the drive prefix insertion operation using the table entry pointed to by HL.
4F2B
POP HL E1
Restore Register Pair HL (command line pointer) from the stack.
[FINAL SVC DISPATCH] — The command parameters have been fully parsed. Recover the SVC code and sub-function from the stack and invoke the command handler.
4F2C
LD A,C 79
Load Register A with Register C (additional parameter byte — used for further flag checking).
4F2D
LD BC,4978H
Load Register Pair BC with 4978H — the command completion return address. After the command executes, control returns here.
4F30
PUSH BC C5
Save Register Pair BC (4978H) onto the stack. This establishes the return point after the SVC call completes.
4F31
BIT 7,A CB 7F
Test bit 7 of Register A (additional parameter byte). Bit 7 determines the dispatch method for the command handler.
4F33
RET Z C8
If the Z FLAG has been set (bit 7 is 0 — standard SVC dispatch), RETURN. The RET pops the return address (4978H) from the stack and jumps there. The stacked SVC parameters (from 4EDEH PUSH BC) are below this on the stack and will be processed by the return handler.
Bit 7 is set — this command requires a direct call to a specific address rather than an SVC dispatch. Set up the direct call with the parameters from the dispatch table.
4F34
LD B,00H
Load Register B with 00H. Clear the high byte for the upcoming address formation.
4F36
LD HL,4300H
Point Register Pair HL to 4300H — a base address for the direct command dispatch table. The specific command handler address is computed relative to this base.
4F39
BIT 6,A CB 77
Test bit 6 of Register A. This distinguishes between two dispatch tables or address computation methods.
4F3B
If the Z FLAG has been set (bit 6 is 0), JUMP to 4424H — an external command dispatch routine that computes the handler address using one method.
4F3E
JUMP to 4420H — an external command dispatch routine that uses the alternate address computation method (bit 6 was 1).
4F41H - SVC A3H / DRIVE PREFIX INSERTION
Inserts a drive prefix (e.g., ":0/") into a filename string. Examines the filename pointed to by HL and DE, checks if it already has a drive specification (colon or slash), and if not, shifts the filename right to make room and inserts the default drive prefix. This is used to ensure all filenames have an explicit drive reference.
On entry: DE points to the filename string. HL points to the drive prefix data (a 3-byte drive specification like ":0/"). The routine scans the filename for an existing drive prefix. If none is found, it inserts the prefix by shifting the filename right by 3 bytes and placing the prefix at the start.
4F41
PUSH DE D5
Save Register Pair DE (filename pointer) onto the stack.
4F42
PUSH BC C5
Save Register Pair BC onto the stack.
4F43
LD BC,091CH
Load Register Pair BC with 091CH. B = 09H (maximum filename length to scan = 9 characters), C = 1CH (internal counter/state).
4F46
LD A,(DE) 1A
Fetch the next character from the filename string (pointed to by DE) into Register A.
4F47
CP 3AH FE 3A
Compare Register A against 3AH (ASCII: : — colon). A colon indicates a drive specification already exists (e.g., ":0/filename").
4F49
If the Z FLAG has been set (character is a colon — drive prefix found), JUMP to
4F55H to skip the insertion since the filename already has a drive spec.
4F4B
CP 2FH FE 2F
Compare Register A against 2FH (ASCII: / — slash). A slash is the directory separator and also indicates a drive spec is present.
4F4D
If the CARRY FLAG has been set (character is less than
/ — meaning it is a control character, space, or similar non-filename character), JUMP to
4F55H. The scan has reached a delimiter or end of the name portion without finding a drive prefix.
4F4F
If the Z FLAG has been set (character IS a
/), JUMP to
4F6CH. A slash without a preceding colon means the filename has a directory path but no drive — the drive prefix will still be inserted.
4F51
DEC C 0D
DECrement Register C (internal counter tracking position within the scanned name).
4F52
INC DE 13
INCrement DE to advance the filename pointer to the next character.
4F53
DECrement B and loop back to
4F46H if not zero.
[LOOP] — Scans up to 9 characters of the filename looking for a colon, slash, or end delimiter.
No drive prefix or slash was found in the first 9 characters. The filename needs a drive prefix inserted. The insertion point is at the start of the filename.
4F55
INC HL 23
INCrement HL to advance past the first byte of the drive prefix data (the colon character).
4F56
INC HL 23
INCrement HL to advance past the second byte (the drive number).
4F57
PUSH HL E5
Save Register Pair HL (now pointing to the third byte of the drive prefix — the slash character) onto the stack.
4F58
EX DE,HL EB
Exchange DE and HL. HL now points into the filename string (where DE was), DE now points into the prefix data.
4F59
LD B,00H
Load Register B with 00H. B is cleared so BC can be used as a 16-bit offset (C contains the position counter from the scan loop).
4F5B
ADD HL,BC 09
ADD BC to HL. This adjusts HL to point to the end of the scanned portion of the filename (offset by C from the start). HL now points to the position where characters will need to be shifted.
4F5C
LD D,H 54
Load Register D with Register H (high byte of the adjusted pointer).
4F5D
LD E,L 5D
Load Register E with Register L (low byte). DE = HL = end of scanned filename portion.
4F5E
DEC HL 2B
DECrement HL by 1. HL points one byte before DE — the source for the block move.
4F5F
INC DE 13
INCrement DE by 1.
4F60
INC DE 13
INCrement DE by 1.
4F61
INC DE 13
INCrement DE by 1. DE is now 3 bytes past HL — the destination is 3 positions higher than the source. This creates a 3-byte gap for the drive prefix.
4F62
LDDR ED B8
Block move (backwards): Copy BC bytes from (HL) to (DE), decrementing HL and DE after each byte. This shifts the filename string 3 positions to the right, creating a gap at the beginning for the drive prefix. The number of bytes moved is determined by BC (C = remaining count from the scan loop).
4F64
POP HL E1
Restore Register Pair HL from the stack. HL points to the third byte of the drive prefix data (saved at 4F57H).
4F65
LD C,03H
Load Register C with 03H — the drive prefix is 3 bytes long (colon, drive number, slash). BC = 0003H (B is still 00H from 4F59H).
4F67
LDDR ED B8
Block move (backwards): Copy 3 bytes from (HL) to (DE), moving the drive prefix data into the gap created by the previous LDDR. The filename now starts with the drive specification (e.g., ":0/").
4F69
LD A,2FH
Load Register A with 2FH (ASCII: / — slash). This is stored as the final slash of the drive prefix.
4F6B
LD (DE),A 12
Store the slash character to (DE), completing the drive prefix insertion.
4F6C
POP BC C1
Restore Register Pair BC from the stack.
4F6D
POP DE D1
Restore Register Pair DE from the stack.
4F6E
RET C9
RETURN to the caller with the drive prefix inserted into the filename string.
4F6FH - NEWDOS/80 COMMAND NAME TABLE
This table contains the command names for NEWDOS/80, each followed by a separate flag byte (with bit 7 set to mark the end of the name), and two parameter bytes used to compute the SVC (Supervisor Call) number in Register A and sub-function in Register C. The table is scanned sequentially during command parsing (starting at 4E8DH). No abbreviations are supported—full command names must match exactly. The table ends with a 00H byte.
Flag byte: Bit 7 always set. Bit 6 set indicates special handling (checked at 4EC7H, may lead to permission check or early return). Low 5 bits (&1FH) become part of parameters.
Parameter bytes: Byte2 and Byte3 are used to construct SVC details. SVC A = 43H if bit 7 of Byte3 set, else 4DH. Sub-function C = Byte3 & 0FH. Byte2 is OR'd with (Byte3 & F0H) for additional parameters pushed to stack.
4F75H
DB C0H
C0 = 1100 000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is high to indicate that extra checks are required before allowing the command to execute (meaning that it is restricted from running under certain circumstances). Bits 5-0 are unused.
4F76H
DEFB 68 00
Dispatch parameters: 68H, 00H (SVC 4DH, sub 00H).
- Byte 2 = 68H: 68H AND 1FH = 08H → this value is loaded into Register C as the base sub-function code (though many handlers treat effective sub-function as 00H after further processing or masking)
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 08H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4F7EH
DEFB 85H
85 = 1000 0101. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000101 (sub-function code 05H).
4F7F
DEFB E9 88
Dispatch parameters: E9H, 88H (SVC 43H, sub 08H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 88H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1000 (8H) and may be used as additional mode/parameter flags passed in secondary stack or register contexts. Then RST 28H is called with A = 43H (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 43H with sub-function 09H (or 08H effective in handler) for attribute manipulation.
4F85H
DEFB 84H
84 = 1000 0100. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000100 (sub-function code 04H).
4F86
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4F8DH
DEFB 81H
81 = 1000 0001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000001 (sub-function code 01H).
4F8E
DEFB E5 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4F94H
DEFB 8AH
8A = 1000 1010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001010 (sub-function code 0AH).
4F95
DEFB EB 10
Dispatch parameters: EBH, 10H (SVC 4DH, sub 00H).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 10H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0001 (1H) and may be used as additional mode/parameter flags passed in secondary stack or register contexts. Then RST 28H is called with A = 4DH (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4F9CH
DEFB 85H
85 = 1000 0101. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000101 (sub-function code 05H).
4F9D
DEFB E5 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FA4H
DEFB C3H
C3 = 1100 0011. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is high to indicate that extra checks are required before allowing the command to execute (meaning that it is restricted from running under certain circumstances). Bits 5-0 are 000011 (sub-function code 03H).
4FA5
DEFB EB 8A
Dispatch parameters: EBH, 8AH (SVC 43H, sub 0AH).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (used as variant or chaining mode selector).
- Byte 3 = 8AH: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1000 (8H) and likely carry chaining-specific flags or options passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 43H with sub-function 0AH for job chaining / overlay loading.
4FACH
DEFB C5H
C5 = 1100 0101. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is high to indicate that extra checks are required before allowing the command to execute (meaning that it is restricted from running under certain circumstances). Bits 5-0 are 000101 (sub-function code 05H).
4FAD
DEFB EB 00
Dispatch parameters: EBH, 00H (SVC 4DH, sub 00H).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FB4H
DEFB 84H
84 = 1000 0100. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000100 (sub-function code 04H).
4FB5
DEFB F0 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FBCH
DEFB 82H
82 = 1000 0010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000010 (sub-function code 02H).
4FBD
DEFB E5 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FC2H
DEFB 89H
89 = 1000 1001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001001 (sub-function code 09H).
4FC3
DEFB E3 10
Dispatch parameters: E3H, 10H (SVC 4DH, sub 00H).
- Byte 2 = E3H: E3H AND 1FH = 03H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 10H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0001 (1H) and may be used as additional mode/parameter flags passed in secondary stack or register contexts. Then RST 28H is called with A = 4DH (SVC code) and C = 03H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FC9H
DEFB C0H
C0 = 1100 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is high to indicate that extra checks are required before allowing the command to execute (meaning that it is restricted from running under certain circumstances). Bits 5-0 are 000000 (sub-function code 00H).
4FCA
DEFB 48 00
Dispatch parameters: 48H, 00H (SVC 4DH, sub 00H).
- Byte 2 = 48H: 48H AND 1FH = 08H → this value is loaded into Register C as the base sub-function code (though many handlers treat effective sub-function as 00H after further processing or masking).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 08H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FD2H
DEFB 82H
82 = 1000 0010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000010 (sub-function code 02H).
4FD3
DEFB F0 40
Dispatch parameters: F0H, 40H (SVC 4DH, sub 00H).
- Byte 2 = F0H: F0H AND 1FH = 10H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 40H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0100 (4H) and may be used as additional mode/parameter flags passed in secondary stack or register contexts (e.g., file creation options). Then RST 28H is called with A = 4DH (SVC code) and C = 10H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FD9H
DEFB 8BH
8B = 1000 1011. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001011 (sub-function code 0BH).
4FDA
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FE1H
DEFB 83H
83 = 1000 0011. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000011 (sub-function code 03H).
4FE2
DEFB E5 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FE7H
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
4FE8
DEFB 2A 00
Dispatch parameters: 2AH, 00H (SVC 4DH, sub 00H).
- Byte 2 = 2AH: 2AH AND 1FH = 0AH → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 0AH (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
4FECH
DEFB C3H
C3 = 1100 0011. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is high to indicate that extra checks are required before allowing the command to execute (meaning that it is restricted from running under certain circumstances). Bits 5-0 are 000011 (sub-function code 03H).
4FED
DEFB EB 8A
Dispatch parameters: EBH, 8AH (SVC 43H, sub 0AH).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (used as variant or JCL/script mode selector).
- Byte 3 = 8AH: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1000 (8H) and likely carry JCL-specific flags or options passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 43H with sub-function 0AH for JCL / script ("DO file") execution.
4FF3H
DEFB 87H
87 = 1000 0111. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000111 (sub-function code 07H).
4FF4
DEFB E9 C8
Dispatch parameters: E9H, C8H (SVC 43H, sub 08H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = C8H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1100 (CH) and likely carry dump-format or memory-range flags passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 43H with sub-function 08H (or 09H effective) for memory/file dumping.
4FFBH
DEFB 87H
87 = 1000 0111. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000111 (sub-function code 07H).
4FFC
DEFB F0 00
Dispatch parameters: F0H, 00H (SVC 4DH, sub 00H).
- Byte 2 = F0H: F0H AND 1FH = 10H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 10H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5003H
DEFB C0H
C0 = 1100 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is high to indicate that extra checks are required before allowing the command to execute (meaning that it is restricted from running under certain circumstances). Bits 5-0 are 000000 (sub-function code 00H).
5005
DEFB 28 00
Dispatch parameters: 28H, 00H (SVC 4DH, sub 00H).
- Byte 2 = 28H: 28H AND 1FH = 08H → this value is loaded into Register C as the base sub-function code (though many handlers treat effective sub-function as 00H after further processing or masking).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 08H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
500CH
DEFB 81H
81 = 1000 0001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000001 (sub-function code 01H).
500D
DEFB F1 00
Dispatch parameters: F1H, 00H (SVC 4DH, sub 00H).
- Byte 2 = F1H: F1H AND 1FH = 11H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 11H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5013H
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
5014
DEFB 4A 00
Dispatch parameters: 4AH, 00H (SVC 4DH, sub 00H).
- Byte 2 = 4AH: 4AH AND 1FH = 0AH → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 0AH (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
501BH
DEFB 82H
82 = 1000 0010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000010 (sub-function code 02H).
501C
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5021H
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
5022
DEFB A5 10
Dispatch parameters: A5H, 10H (SVC 4DH, sub 00H).
- Byte 2 = A5H: A5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 10H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0001 (1H) and may be used as additional mode/parameter flags passed in secondary stack or register contexts. Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5028H
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
5029
DEFB 45 90
Dispatch parameters: 45H, 90H (SVC 43H, sub 00H).
- Byte 2 = 45H: 45H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 90H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1001 (9H) and likely carry file-delete or protection flags passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 43H with sub-function 00H (or 05H effective) for file deletion / KILL operation.
502DH
DEFB 89H
89 = 1000 1001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001001 (sub-function code 09H).
502E
DEFB E5 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5033H
DEFB 82H
82 = 1000 0010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000010 (sub-function code 02H).
5034
DEFB E3 00
Dispatch parameters: E3H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E3H: E3H AND 1FH = 03H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 03H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
503AH
DEFB 85H
85 = 1000 0101. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000101 (sub-function code 05H).
503B
DEFB F0 88
Dispatch parameters: F0H, 88H (SVC 43H, sub 08H).
- Byte 2 = F0H: F0H AND 1FH = 10H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 88H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1000 (8H) and likely carry listing-format or output-mode flags passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 10H (initial sub-function).
Result: Calls SVC 43H with sub-function 08H (or 10H effective) for file/directory listing to printer or screen.
5041H
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
5042
DEFB A4 50
Dispatch parameters: A4H, 50H (SVC 4DH, sub 00H).
- Byte 2 = A4H: A4H AND 1FH = 04H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 50H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0101 (5H) and may be used as additional load-address or mode flags passed in secondary stack or register contexts. Then RST 28H is called with A = 4DH (SVC code) and C = 04H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
504AH
DEFB 85H
85 = 1000 0101. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000101 (sub-function code 05H).
504B
DEFB E3 00
Dispatch parameters: E3H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E3H: E3H AND 1FH = 03H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 03H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5053H
DEFB 82H
82 = 1000 0010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000010 (sub-function code 02H).
5054
DEFB EB B0
Dispatch parameters: EBH, B0H (SVC 43H, sub 00H).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = B0H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1011 (BH) and likely carry multi-disk copy or verification flags passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 43H with sub-function 00H (or 0BH effective) for multi-drive disk copying.
505BH
DEFB 86H
86 = 1000 0110. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000110 (sub-function code 06H).
505C
DEFB E3 00
Dispatch parameters: E3H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E3H: E3H AND 1FH = 03H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 03H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5063H
DEFB 88H
88 = 1000 1000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001000 (sub-function code 08H).
5064
DEFB EB 00
Dispatch parameters: EBH, 00H (SVC 4DH, sub 00H).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (often treated as a pause/wait variant).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H for pause/wait behavior.
506CH
DEFB 83H
83 = 1000 0011. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000011 (sub-function code 03H).
506D
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5074H
DEFB 86H
86 = 1000 0110. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000110 (sub-function code 06H).
5075
DEFB F0 88
Dispatch parameters: F0H, 88H (SVC 43H, sub 08H).
- Byte 2 = F0H: F0H AND 1FH = 10H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 88H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1000 (8H) and likely carry print-format or spooler flags passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 10H (initial sub-function).
Result: Calls SVC 43H with sub-function 08H (or 10H effective) for file/print spooling.
507BH
DEFB 86H
86 = 1000 0110. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000110 (sub-function code 06H).
507C
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5083H
DEFB 89H
89 = 1000 1001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001001 (sub-function code 09H).
5084
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5087H
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
5088
DEFB 23 00
Dispatch parameters: 23H, 00H (SVC 4DH, sub 00H).
- Byte 2 = 23H: 23H AND 1FH = 03H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 03H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
5090H
DEFB 81H
81 = 1000 0001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000001 (sub-function code 01H).
5091
DEFB E4 B0
Dispatch parameters: E4H, B0H (SVC 43H, sub 00H).
- Byte 2 = E4H: E4H AND 1FH = 04H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = B0H: Since bit 7 of Byte 3 is 1, the SVC function code in Register A is set to 43H (special/internal DOS call). Bits 7–4 of Byte 3 are 1011 (BH) and likely carry rename-specific flags or options passed in secondary contexts. Then RST 28H is called with A = 43H (SVC code) and C = 04H (initial sub-function).
Result: Calls SVC 43H with sub-function 00H (or 04H effective) for file renaming.
5098H
DEFB 81H
81 = 1000 0001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000001 (sub-function code 01H).
5099
DEFB F0 00
Dispatch parameters: F0H, 00H (SVC 4DH, sub 00H).
- Byte 2 = F0H: F0H AND 1FH = 10H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 10H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50A1H
DEFB 82H
82 = 1000 0010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000010 (sub-function code 02H).
50A2
DEFB F1 00
Dispatch parameters: F1H, 00H (SVC 4DH, sub 00H).
- Byte 2 = F1H: F1H AND 1FH = 11H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 11H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50A8H
DEFB 89H
89 = 1000 1001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001001 (sub-function code 09H).
50A9
DEFB EB 00
Dispatch parameters: EBH, 00H (SVC 4DH, sub 00H).
- Byte 2 = EBH: EBH AND 1FH = 0BH → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 0BH (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50B1H
DEFB 81H
81 = 1000 0001. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000001 (sub-function code 01H).
50B2
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50B8H
DEFB 8AH
8A = 1000 1010. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 001010 (sub-function code 0AH).
50B9
DEFB E9 00
Dispatch parameters: E9H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E9H: E9H AND 1FH = 09H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 09H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50C1H
DEFB 84H
84 = 1000 0100. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000100 (sub-function code 04H).
50C2
DEFB E5 00
Dispatch parameters: E5H, 00H (SVC 4DH, sub 00H).
- Byte 2 = E5H: E5H AND 1FH = 05H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 05H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50CAH
DEFB 80H
80 = 1000 0000. Bit 7 is high indicating that the last character of the command has been processed. Bit 6 is low indicating no extra checks are required before allowing the command to execute (meaning that it can run under most circumstances). Bits 5-0 are 000000 (sub-function code 00H).
50CB
DEFB 53 00
Dispatch parameters: 53H, 00H (SVC 4DH, sub 00H).
- Byte 2 = 53H: 53H AND 1FH = 13H → this value is loaded into Register C as the base sub-function code (often used directly or as a variant selector in the handler).
- Byte 3 = 00H: Since bit 7 of Byte 3 is 0, the SVC function code in Register A is set to 4DH (standard DOS SVC dispatcher). Bits 7–4 of Byte 3 are 0000 and are not directly used for the SVC number (they may be passed in secondary parameter blocks or ignored in this case). Then RST 28H is called with A = 4DH (SVC code) and C = 13H (initial sub-function).
Result: Calls SVC 4DH with sub-function effectively treated as 00H in most handler paths for this command.
50CD
DEFB 00
End of command table marker.
50CEH - SUB-FUNCTION 2: DISPLAY COMMAND LIST
Displays the list of all available NEWDOS/80 commands by walking through the command name table at 4F6FH. Prints each command name (stripping the bit-7 marker from the last character), formatting them in columns with spaces between entries and carriage returns between rows.
50CE
LD HL,4F6FH
Point Register Pair HL to 4F6FH — the start of the NEWDOS/80 Command Name Table.
50D1
LD C,08H
Load Register C with 08H (8 decimal) — the number of commands per row. After printing 8 commands, a carriage return is output to start a new display line.
50D3
LD B,08H
Load Register B with 08H (8 decimal) — the maximum name display width. Each command name is padded with spaces to fill 8 character positions for columnar alignment.
[PRINT NAME LOOP] — Print characters of the current command name until the last character (with bit 7 set) is encountered.
50D5
LD A,(HL) 7E
Fetch the next byte from the command name table into Register A.
50D6
BIT 7,A CB 7F
Test bit 7 of Register A. If set, this is the last character of the command name (with bit 7 used as an end-of-name marker).
50D8
INC HL 23
INCrement HL to advance the table pointer.
50D9
If the NZ FLAG has been set (bit 7 is 1 —
last character of name), JUMP to
50E0H to skip past the dispatch data bytes and move to the next entry.
50DB
GOSUB to
51B6H to display the character in Register A. This prints one character of the command name.
50DE
DECrement B and loop back to
50D5H if not zero.
[LOOP] — Continues printing characters (up to 8) until the name ends or the column width is reached.
The last character of the name has been found (bit 7 set). Skip past the 2 dispatch data bytes to reach the next table entry.
50E0
INC HL 23
INCrement HL to skip the first dispatch data byte.
50E1
INC HL 23
INCrement HL to skip the second dispatch data byte. HL now points to the start of the next table entry or the 00 end-of-table marker.
50E2
LD A,(HL) 7E
Fetch the first byte of the next table entry into Register A.
50E3
OR A B7
OR Register A with itself. Tests whether this byte is 00H (end of table) or a command name character.
50E4
If the Z FLAG has been set (byte is 00H —
end of command table), JUMP to
51B4H to output a final carriage return and return.
50E7
DEC C 0D
DECrement Register C (column counter). C tracks how many commands have been printed on the current line.
50E8
If the Z FLAG has been set (C reached 0 — 8 commands have been printed on this row), GOSUB to
51B4H to output a carriage return and start a new line.
50EB
If the Z FLAG has been set (a new row was started), JUMP back to
50D1H to reset the column counter to 8 and continue printing.
50ED
GOSUB to
51ACH to pad the remaining column width with spaces. B contains the number of characters remaining (from the DJNZ loop at 50DEH), so this prints B space characters to fill out the column.
50F0
JUMP back to
50D3H to reset B to 8 and print the next command name.
[LOOP]
50F2H - SUB-FUNCTION 4: NMI/BREAK HANDLER
Handles the NMI (Non-Maskable Interrupt) break condition. Saves the complete CPU state, checks the current DOS status, saves the stack pointer, enables cursor visibility, restores the original screen character, and enters the MINI-DOS command loop with the "MINI-NEWDOS/80 READY" prompt.
This routine is invoked when the user presses the BREAK key, triggering an NMI. The CPU state at the time of the interrupt must be saved so the interrupted program can be resumed later.
50F2
DI F3
Disable Interrupts. Prevents further interrupts from disrupting the save process.
50F3
GOSUB to
5142H to save all registers (AF, BC, DE, HL, IX, IY, and alternate register set) onto the stack, preserving the complete CPU state of the interrupted program.
50F6
LD HL,428AH
Point Register Pair HL to 428AH — the DOS System Status Byte.
50F9
LD A,(HL) 7E
Fetch the DOS System Status Byte from (428AH) into Register A.
50FA
AND C0H E6 C0
Mask Register A with C0H (binary 11000000). This isolates bits 7 (NMI/Break) and 6 (MINI-DOS active).
50FC
If the NZ FLAG has been set (either NMI/Break or MINI-DOS is already active), JUMP to
5131H. A break while already in break mode or MINI-DOS is ignored — the registers are simply restored and execution continues.
50FE
LD A,(4022H) 3A 22 40
Fetch the byte from memory location 4022H into Register A. This is the character under the cursor (the character that was at the cursor position when the break occurred). It is saved so it can be restored later.
5101
PUSH AF F5
Save Register Pair AF (the character under cursor) onto the stack for later restoration.
5102
LD (42BBH),SP ED 73 BB 42
Store the current Stack Pointer to memory location 42BBH — the NMI/Break Saved Stack Pointer. This saves the SP value so the complete stack frame (including all saved registers) can be found when resuming the interrupted program.
5106
SET 7,(HL) CB FE
SET bit 7 of the DOS System Status Byte at (428AH) to 1. This sets the NMI/Break active flag, indicating that the system is now in break mode.
5108
EI FB
Enable Interrupts. The critical register-saving section is complete.
5109
LD A,0DH
Load Register A with 0DH (ASCII: CR — Carriage Return).
510B
GOSUB to ROM routine at 0033H to display a carriage return, moving the cursor to a new line.
510E
JUMP to
4D8AH to clear A (success) and enter the SVC exit routine. The exit routine will detect the NMI/Break flag (bit 7 of 428AH) and display the "MINI-NEWDOS/80 READY" prompt, entering the MINI-DOS command loop.
5111H - SUB-FUNCTION 6: NMI RETURN / RESUME INTERRUPTED PROGRAM
Returns from the MINI-DOS break mode to the interrupted program. Checks that a break was actually active, restores the stack pointer from the NMI save area, re-enables the cursor character, restores all saved registers, and returns to the interrupted code.
5111
LD HL,428AH
Point Register Pair HL to 428AH — the DOS System Status Byte.
5114
BIT 7,(HL) CB 7E
Test bit 7 of the DOS System Status Byte. Bit 7 = NMI/Break active. If not set, there is no break to return from.
5116
If the Z FLAG has been set (bit 7 is 0 —
no NMI/Break is active), JUMP to
4D44H to return error code 2AH (General Error). There is no interrupted program to return to.
5119
LD SP,(42BBH) ED 7B BB 42
Load the Stack Pointer from memory location 42BBH — the NMI/Break Saved Stack Pointer. This restores SP to the value it had when the break occurred, pointing to the saved register block.
511D
LD A,0EH
Load Register A with 0EH — ASCII control code for Cursor On (SO — Shift Out). This re-enables the cursor display.
511F
GOSUB to ROM routine at 0033H to send the cursor-on control code, making the cursor visible again.
5122
POP AF F1
Restore Register Pair AF from the stack. This recovers the saved character under cursor (pushed at 5101H during the break handler).
5123
OR A B7
OR Register A with itself. Tests if the saved character is zero (no character to restore).
5124
LD B,A 47
Load Register B with the saved cursor character for temporary storage.
5125
LD A,0FH
Load Register A with 0FH — ASCII control code for Cursor Off (SI — Shift In). This hides the cursor so the original screen character can be restored.
5127
If the Z FLAG has been set (the saved character was zero), GOSUB to ROM routine at 0033H to send the cursor-off code. When the character is zero, cursor management is different.
512A
LD A,B 78
Load Register A with Register B — restore the saved cursor character.
512B
LD (4022H),A 32 22 40
Store the saved cursor character back to memory location 4022H, restoring the character that was under the cursor when the break occurred.
512E
DI F3
Disable Interrupts for the register restoration phase.
512F
RES 7,(HL) CB BE
RESET bit 7 of the DOS System Status Byte at (428AH) to 0. This clears the NMI/Break active flag since the break is being resolved.
[REGISTER RESTORATION] — Restore all saved registers in reverse order of how they were saved at 5142H-5153H, then return to the interrupted program.
5131
XOR A AF
Set Register A to ZERO and clear all flags.
5132
EX AF,AF' 08
Exchange AF with the alternate AF'. This saves A=0 in AF' for a clean return, and brings the alternate AF into main position for restoration.
5133
POP IY FD E1
Restore Register Pair IY from the stack.
5135
POP IX DD E1
Restore Register Pair IX from the stack.
5137
POP AF F1
Restore Register Pair AF from the stack (this is the alternate AF' that was saved).
5138
POP BC C1
Restore Register Pair BC from the stack (alternate BC').
5139
POP DE D1
Restore Register Pair DE from the stack (alternate DE').
513A
POP HL E1
Restore Register Pair HL from the stack (alternate HL').
513B
EXX D9
Switch back to the main register set. The alternate registers have been restored.
513C
POP BC C1
Restore Register Pair BC from the stack (main BC).
513D
POP DE D1
Restore Register Pair DE from the stack (main DE).
513E
POP HL E1
Restore Register Pair HL from the stack (main HL).
513F
EX AF,AF' 08
Exchange AF with AF' again. This brings back the A=0 (clean return) from AF' into the main AF. The interrupted program's AF was already restored from the stack.
5140
EI FB
Enable Interrupts. The register restoration is complete.
5141
RET C9
RETURN to the interrupted program. The return address was on the stack below all the saved registers, placed there by the original interrupt/call mechanism. Execution resumes exactly where it was interrupted.
5142H - REGISTER SAVE SUBROUTINE
Saves the complete CPU register state (all main and alternate registers, plus IX and IY) onto the stack. Used by the MINI-DOS entry (4D5BH) and NMI break handler (50F2H) to preserve the caller's context. Uses a clever stack manipulation technique to save the return address while pushing all registers.
On entry, the stack contains the return address to the caller (from the CALL 5142H instruction). This routine must save all registers WITHOUT destroying any of them. It accomplishes this by popping the return address into AF, pushing all other registers, then pushing AF last (so the return address ends up at the bottom of the saved block) and using RET to return.
5142
POP AF F1
Pop the return address from the stack into Register Pair AF. This retrieves the address that CALL 5142H pushed, freeing the stack for register saves. The return address is temporarily held in AF.
5143
PUSH HL E5
Save Register Pair HL (main) onto the stack.
5144
PUSH DE D5
Save Register Pair DE (main) onto the stack.
5145
PUSH BC C5
Save Register Pair BC (main) onto the stack.
5146
EX AF,AF' 08
Exchange AF with AF'. The return address moves to AF', and the alternate AF comes to the main position for saving.
5147
EXX D9
Switch to the alternate register set (BC', DE', HL' become active).
5148
PUSH HL E5
Save Register Pair HL' (alternate) onto the stack.
5149
PUSH DE D5
Save Register Pair DE' (alternate) onto the stack.
514A
PUSH BC C5
Save Register Pair BC' (alternate) onto the stack.
514B
PUSH AF F5
Save Register Pair AF (which is the alternate AF due to the EX AF,AF' at 5146H) onto the stack.
514C
PUSH IX DD E5
Save Register Pair IX onto the stack.
514E
PUSH IY FD E5
Save Register Pair IY onto the stack.
5150
EXX D9
Switch back to the main register set.
5151
EX AF,AF' 08
Exchange AF with AF'. The return address comes back from AF' into the main AF.
5152
PUSH AF F5
Save the return address (in AF) onto the stack. This places it at the top of the saved register block.
5153
RET C9
RETURN using the return address just pushed. This pops AF (the return address) and jumps back to the caller. All registers are preserved on the stack below the return point.
5154H - SVC 83H HANDLER: FILENAME PARSING
Handles SVC 83H — parses a filename from the command line. Calls the filename skip routine to advance past the filename, then checks the delimiter character to determine the filename type.
5154
GOSUB to
5167H to parse the filename from the command line, scanning characters and copying them to the destination buffer.
5157
PUSH AF F5
Save Register Pair AF (parse result flags) onto the stack.
5158
LD A,(HL) 7E
Fetch the delimiter character at the current command line position (where the filename parse stopped) into Register A.
5159
SUB 03H D6 03
SUBtract 03H from Register A. If the delimiter is 03H (ETX — End of Text), A becomes 0 and Z is set.
515B
If the Z FLAG has been set (delimiter was 03H — ETX), JUMP to
515FH.
515D
SUB 0AH D6 0A
SUBtract 0AH from Register A. After the previous SUB 03H, this is equivalent to checking if the original delimiter was 0DH (03H + 0AH = carriage return). If so, Z is set.
515F
If the Z FLAG has been set (delimiter was ETX or CR — end of command), JUMP to
5162H to skip the HL increment.
5161
INC HL 23
INCrement HL to advance past the delimiter character. This positions HL at the next parameter on the command line (if the delimiter was a space or other separator).
5162
POP AF F1
Restore Register Pair AF (parse result flags) from the stack.
5163
RET C9
RETURN to the SVC caller with the parse results: HL points past the filename, AF contains the parse status.
5164H - FILENAME PARSE TO DEFAULT BUFFER
Parses a filename from the command line into the default file parameter block at 4480H. Sets up DE to point to 4480H, then falls through to the general filename parser at 5167H.
5164
LD DE,4480H
Point Register Pair DE to 4480H — the default file parameter block where the parsed filename will be stored.
Execution falls through to 5167H to perform the actual filename parsing.
5167H - FILENAME PARSER: PARSE NAME FROM COMMAND LINE
Parses a filename from the text pointed to by HL into the buffer pointed to by DE. Handles the asterisk (*) wildcard prefix and copies filename characters (letters, digits, and special characters) into the destination buffer. Returns with B=0 on success.
5167
PUSH DE D5
Save Register Pair DE (destination buffer pointer) onto the stack.
5168
LD B,20H
Load Register B with 20H (32 decimal) — the maximum filename length. B serves as a character counter to prevent buffer overruns during parsing.
516A
GOSUB to
5171H to begin parsing the filename. This routine handles the asterisk wildcard check and copies the filename characters.
516D
POP DE D1
Restore Register Pair DE (original destination buffer pointer) from the stack.
516E
LD B,00H
Load Register B with 00H — clear B to indicate success.
5170
RET C9
RETURN with B = 0 (success), DE = original buffer pointer, HL = position in command line after the filename.
5171H - FILENAME COPY ENGINE
Core filename copying routine. First checks for the asterisk (*) wildcard prefix, then copies valid filename characters (digits and certain special characters) from the command line at (HL) to the destination buffer at (DE). Uses the character class checker at 51A0H to validate characters.
5171
LD A,(HL) 7E
Fetch the current character from the command line at (HL) into Register A.
5172
CP 2AH FE 2A
Compare Register A against 2AH (ASCII: * — asterisk wildcard). If the first character is an asterisk, it indicates a wildcard filename.
5174
If the NZ FLAG has been set (character is NOT
*), JUMP to
517AH to skip the wildcard handling and proceed with normal filename parsing.
5176
LD (DE),A 12
Store the asterisk character to the destination buffer at (DE).
5177
INC DE 13
INCrement DE to advance the destination buffer pointer.
5178
INC HL 23
INCrement HL to advance past the asterisk in the command line.
5179
DEC B 05
DECrement B (remaining character count) by 1.
517A
PUSH HL E5
Save Register Pair HL (command line position) onto the stack as a fallback position in case the parse fails.
[FILENAME CHARACTER VALIDATION AND COPY LOOP] — Check each character against valid filename character classes and copy valid characters to the destination buffer.
517B
LD A,(HL) 7E
Fetch the current character from the command line at (HL) into Register A.
517C
SUB 30H D6 30
SUBtract 30H from Register A. This converts ASCII digit 0-9 (30H-39H) to values 0-9. If the character was a digit, the result is 0-9.
517E
CP 0AH FE 0A
Compare Register A against 0AH (10 decimal). If A < 10 (character was a digit), the CARRY FLAG is set.
5180
GOSUB to
51A0H — the
character class checker. If the CARRY FLAG was already set (character is a digit), this routine returns immediately. Otherwise, it checks if the character is an alphabetic letter (A-Z or a-z).
5183
If the NO CARRY FLAG has been set (character is NOT a digit or letter — it is a non-alphanumeric character), JUMP to
519BH to end the filename and exit the copy loop.
The character is a valid alphanumeric filename character. Now check for special delimiter characters that also terminate the filename.
5185
LD A,(HL) 7E
Re-fetch the current character from the command line (the SUB at 517CH destroyed the original value).
5186
SUB 2EH D6 2E
SUBtract 2EH from Register A. This converts ASCII . (period, 2EH) to 0, and / (slash, 2FH) to 1, etc.
5188
CP 0DH FE 0D
Compare the adjusted value against 0DH. This checks if the original character was in the range 2EH to 3AH (period through colon), which includes ., /, digits, and :.
518A
GOSUB to
51A0H to check if the character is in the special range. Returns Carry set if valid filename character, Carry clear if not.
518D
If the CARRY FLAG has been set (character is a valid filename character like a period, slash, or colon), JUMP to
5195H to copy it to the destination buffer.
The character is not a valid filename character within the period-colon range. Store a filename terminator (03H = ETX) and exit.
518F
LD A,03H
Load Register A with 03H (ETX — End of Text). This is the filename terminator in NEWDOS/80's internal format.
5191
LD (DE),A 12
Store the filename terminator 03H to the destination buffer at (DE).
5192
POP AF F1
Restore Register Pair AF from the stack (discard the saved HL from 517AH).
5193
XOR A AF
Set Register A to ZERO and clear all flags (Z FLAG set = success).
5194
RET C9
RETURN with A = 0, Z FLAG set = filename parsed successfully.
[COPY VALID CHARACTER] — The character at (HL) is a valid filename character. Copy it to the destination buffer.
5195
LD A,(HL) 7E
Re-fetch the character from the command line (it was modified by SUB operations).
5196
LD (DE),A 12
Store the character to the destination buffer at (DE).
5197
INC DE 13
INCrement DE to advance the destination buffer pointer.
5198
INC HL 23
INCrement HL to advance the command line pointer to the next character.
5199
DECrement B and loop back to
5185H if not zero.
[LOOP] — Continues copying filename characters until a non-filename character is encountered or B reaches zero (maximum length reached).
The filename buffer is full (B reached 0) or a non-alphanumeric character was found. Set error flag and return the character for the caller to examine.
519B
OR 01H F6 01
OR Register A with 01H. This ensures the NZ FLAG is set (non-zero result), indicating the filename ended due to a delimiter or buffer full condition rather than a clean terminator.
519D
POP HL E1
Restore Register Pair HL from the stack. This recovers the saved fallback position from 517AH.
519E
LD A,(HL) 7E
Fetch the character at the fallback position for the caller to examine.
519F
RET C9
RETURN with the delimiter character in A and NZ FLAG set.
51A0H - CHARACTER CLASS CHECKER: ALPHANUMERIC TEST
Tests whether a character is alphabetic (A-Z or a-z). If the Carry flag is already set on entry (indicating the character was already classified as a digit), returns immediately. Otherwise, checks for uppercase (41H-5AH) and lowercase (61H-7AH) letters.
51A0
RET C D8
If the CARRY FLAG is already set on entry (character was already classified as valid — e.g., a digit), RETURN immediately. No further checking is needed.
51A1
LD A,(HL) 7E
Fetch the original character from the command line at (HL) into Register A for testing.
51A2
SUB 41H D6 41
SUBtract 41H from Register A. This converts uppercase A (41H) to 0, B to 1, ..., Z (5AH) to 25.
51A4
CP 1AH FE 1A
Compare Register A against 1AH (26 decimal). If A < 26, the character was an uppercase letter (A-Z) and the CARRY FLAG is set.
51A6
RET C D8
If the CARRY FLAG is set (character is uppercase A-Z), RETURN with Carry set indicating a valid alphabetic character.
51A7
SUB 20H D6 20
SUBtract 20H from Register A. Since A already had 41H subtracted, this is equivalent to subtracting 61H from the original character. This converts lowercase a (61H) to 0, b to 1, ..., z (7AH) to 25.
51A9
CP 1AH FE1A
Compare Register A against 1AH (26 decimal). If A < 26, the character was a lowercase letter (a-z) and the CARRY FLAG is set.
51AB
RET C9
RETURN. The CARRY FLAG indicates the result: Carry set = lowercase letter (a-z), Carry clear = not a letter.
51ACH - DISPLAY PADDING SPACES
Outputs B space characters (20H) for column alignment in the command list display. Called by the command list routine at 50CEH to pad between command names.
51AC
LD A,20H
Load Register A with 20H (ASCII: SPACE).
51AE
GOSUB to
51B6H to display the space character.
51B1
DECrement B and loop back to
51ACH if not zero.
[LOOP] — Prints B space characters total.
51B3
RET C9
RETURN after printing all padding spaces.
51B4H - DISPLAY CARRIAGE RETURN
Outputs a carriage return (0DH) character. Used to end display lines in the command list and other output routines.
51B4
LD A,0DH
Load Register A with 0DH (ASCII: CR — Carriage Return).
Execution falls through to 51B6H to display the character.
51B6H - DISPLAY CHARACTER SUBROUTINE
Displays the character in Register A on the screen by calling the ROM display routine at 0033H. Preserves DE and AF across the call.
51B6
PUSH DE D5
Save Register Pair DE onto the stack (preserved across the ROM call).
51B7
PUSH AF F5
Save Register Pair AF (the character to display and current flags) onto the stack.
51B8
GOSUB to ROM routine at 0033H to display the character in Register A at the current cursor position and advance the cursor.
51BB
POP AF F1
Restore Register Pair AF from the stack (the original character and flags).
51BC
POP DE D1
Restore Register Pair DE from the stack.
51BD
RET C9
RETURN with DE and AF preserved.
51BEH - STRING DATA TABLES
Static string data used by the command interpreter and MINI-DOS prompt. These bytes are ASCII text, not executable code — the disassembler has interpreted them as Z80 instructions.
51BE
DEFM "CMD"
Command file extension identifier.
51C1
DEFM "JCL""
Job Control Language file extension identifier.
51C4
DEFM "TO" + 00H"
Used by the command parser at 4EF2H to check for the "TO" keyword between two filenames (e.g., "COPY file1 TO file2").
51C7
DEFM "MINI-""
Prefix for the MINI-DOS prompt. Displayed before "NEWDOS/80 READY" when in break/NMI mode to show "MINI-NEWDOS/80 READY".
51CC
DEFM "NEWDOS/80 READY" + 0DH"
This is the main DOS prompt displayed when the system is ready for command input.
51DC
DEFB 1CH 1FH 03H 00H
This is CLEAR SCREEN followed by an 03H Delimter and a 00H Null