DOSPLUS 3.5 for the Model III - SYS1/SYS Disassembled

Page Customization

Introduction/Summary

DOSPLUS 3.5 SYS1/SYS Disassembly - The Command Interpreter (Model III)

SYS1/SYS is the DOSPLUS command interpreter. It is a low overlay: SYS0/SYS loads it at 4E00H when a request code with 0 in bits 7-4 asks for it (CMD@, CMNDI@, FSPEC@, FEXT@, PARAM@), and any other low overlay (SYS2/SYS-SYS8/SYS) loads over it. It holds the DOSPLUS command level with the DOS PLUS prompt, the routine that runs a command line (a library command through its request code, anything else as a program with the extension /CMD), the parsing of file specifications and parameters that every command uses, the table of the 39 library commands, and the two library commands that need no overlay of their own, BOOT and CLS.

The file is a load module of 4 blocks, 1014 bytes, from 4E00H to 51F5H, with the transfer address 4E00H; the blocks load 4E00H-51F5H in order.

The Parts of SYS1/SYS

AddressContents
4E00H-4E15HThe routine table of routines 2-11, and routines 2 and 4 (XOR A and RET) (4E00H, 4E14H).
4E16H-4E8DHCMD@, the command level: stack, EXIT@, ABORT@ and BREAK$, the next command of a line of several, the prompt, the line input, the period (comment) and slash (repeat) lines (4E16H, 4E57H).
4E8EH-4ED0HCMNDI@: the command name into the file control block at 42DEH, the library command look-up and its RST 28H, or RUN@ for a program (4E8EH).
4ED1H-4F1CHFSPEC@: name, extension, password, drive or device, with the words TO, FROM and USING passed over (4ED1H).
4F1DH-4F4AHFEXT@: the default extension (4F1DH).
4F4BH-4F7AHThe field copier that FSPEC@ and PARAM@ use (4F4BH).
4F7BH-4FE0HThe keyword search of PARAM@ and the name table search of CMNDI@ and FSPEC@ (4F7BH, 4FBAH).
4FE1H-5022HThe character tests and the table of name characters (4FE1H, 5019H).
5023H-50F9HPARAM@ and its value readers: yes or no, decimal and hexadecimal (5023H, 5088H, 50B2H, 50CDH).
50FBH-5102HRoutine 9 (the library table's address), CLS and BOOT (50FBH, 50FFH, 5102H).
5103H-51F5HThe library command names and request codes, the prompt, CMD, and the words TO, FROM and USING (5103H, 51B6H, 51DDH).

How a Command Runs

Every return to DOSPLUS goes through CMD@ (4400H), whose request code 03H brings in SYS1/SYS and runs 4E16H. The routine reloads the stack pointer with 41E5H, puts EXIT@ (402DH) on the stack as the return of the command it starts, restores the JP of ABORT@ (which goes to EXIT@, or to DEBUG@ when the DEBUG flag, bit 2 of SFLAG1$ at 4297H, is set) and makes BREAK$ a RET. A line typed at the prompt may hold several commands separated by semicolons: the pointer at 42A3H keeps the start of the command that ran, and the command level skips to its end (4E40H); after a semicolon it runs the next one through CMNDI@, after the carriage return it shows the prompt again. The prompt is not displayed while a DO file is active (bit 5 of SFLAG1$). The line is read with the ROM's line input (0040H) into 4300H and copied to INPBUF$ at 4225H. A line that is empty or begins with a period is not run; a line beginning with a slash runs the last command again, displayed first (4E77H).

CMNDI@ (4E8EH) takes the command name with FSPEC@ into the file control block at 42DEH and checks the first character; an @ or a colon gives error 6CH. The name is looked up in the library table at 5103H: the names are stored with bit 7 set on the first character and the request code of entry n is at 51B5H + n. A library command becomes a RST 28H with its request code (overlay in bits 7-4, routine in bits 3-0), and Register Pair HL points to its parameters. Any other name gets the extension /CMD when it has none, OVLYH$ is set to FFH (the program loads over the high overlay area) and RUN@ loads and runs it. CMNDI@ takes the overlay request handler's return and saved word off the stack itself, so the command returns to the caller of CMNDI@ directly; it puts back the DEBUG on BREAK switch (429BH) that the handler had cleared.

Three things the Model III file does besides: the command level also puts JP 402DH into the ROM's READY vector at 4203H-4205H (4E1EH, 4E26H), so a ROM routine that ends there returns to EXIT@; CMNDI@ clears 4214H, the ROM's count of scroll-protected lines at the top of the screen, before each command (4EABH); and BOOT is a RST 00H to the ROM's reset (5102H).

The Library Commands

CommandCodeOverlay and Routine
APPEND94HSYS10/SYS routine 4
ASSIGNA5HSYS11/SYS routine 5
ATTRIBD3HSYS14/SYS routine 3
AUTOB3HSYS12/SYS routine 3
BOOT0AHSYS1/SYS routine 10
BREAKB4HSYS12/SYS routine 4
BUILDE3HSYS15/SYS routine 3
CAT83HSYS9/SYS routine 3
CLEARE4HSYS15/SYS routine 4
CLOCKB5HSYS12/SYS routine 5
CLS0BHSYS1/SYS routine 11
CONFIGF3HSYS16/SYS routine 3
COPY93HSYS10/SYS routine 3
CREATEE5HSYS15/SYS routine 5
DATEB6HSYS12/SYS routine 6
DEBUGB7HSYS12/SYS routine 7
DIR84HSYS9/SYS routine 4
DOC3HSYS13/SYS routine 3
DUMPE6HSYS15/SYS routine 6
ERRORB8HSYS12/SYS routine 8
FILTERA7HSYS11/SYS routine 7
FORCEA3HSYS11/SYS routine 3
FORMSC4HSYS13/SYS routine 4
FREE85HSYS9/SYS routine 5
IB9HSYS12/SYS routine 9
JOINA6HSYS11/SYS routine 6
KILLD4HSYS14/SYS routine 4
LIBBAHSYS12/SYS routine 10
LIST95HSYS10/SYS routine 5
LOADE7HSYS15/SYS routine 7
PAUSEBBHSYS12/SYS routine 11
PROTD5HSYS14/SYS routine 5
RENAMEE8HSYS15/SYS routine 8
RESETA4HSYS11/SYS routine 4
RS232C5HSYS13/SYS routine 5
SCREENBCHSYS12/SYS routine 12
SYSTEMF4HSYS16/SYS routine 4
TIMEBDHSYS12/SYS routine 13
VERIFYBEHSYS12/SYS routine 14

File Specifications and Parameters

FSPEC@ (4ED1H) copies a name of up to 8 characters, then /extension (3), .password (8) and :drive (2), each with its separator, and ends the whole with 03H; a device specification is @ with up to 2 characters. Letters are made upper case. Besides letters and digits a name may hold # $ % & + < > ? ! and the asterisk (5019H); any other character ends a part. Characters beyond the length of a part are passed over. A specification that is TO, FROM or USING is skipped, so COPY A TO B reads as COPY A B. FEXT@ (4F1DH) inserts /EXT after a name that has no extension, moving the rest up 4 bytes.

PARAM@ (5023H) takes the parameters, with or without parentheses, separated by commas. A name is looked up in the caller's table of 8 byte entries (6 characters and the address of a value word) and may be shortened: the first entry that begins with it is taken. NAME alone stores FFFFH; NAME=value stores Y, YES or ON as FFFFH, N, NO or OFF as 0000H, digits ending with H as hexadecimal and other digits as decimal.

Differences from the Manual

The manual (T/37) says that PARAM@ returns the character that caused an error in Register A. For a parameter name that is not in the table Register A is FFH (4F8EH); the character is returned only for a missing name (5038H) or a wrong character after a value (506AH). The manual does not say that parameter names may be shortened (4F9BH) or that a value has to be a word or a number: PARAM@ has no string values.

Variables

Memory Outside SYS1/SYS

Address
Size
Contents
402DH
3 bytes
EXIT@
Pushed as the return of every command (4E1AH).
4030H-4032H
3 bytes
ABORT@
A JP to EXIT@ or to DEBUG@ (440DH), stored at 4E23H and 4E3DH.
4203H-4205H
3 bytes
The ROM's READY Vector
Made JP 402DH (EXIT@) (4E1EH, 4E26H).
41E5H
the stack
System Stack
The stack pointer the command level starts with (4E17H).
4300H-42FFH
256 bytes
System Sector Buffer
The line typed at the prompt (4E64H) and the parameter name of PARAM@ (5030H).
4214H
1 byte
Protected Lines
The ROM's count of scroll-protected lines, cleared by CMNDI@ (4EACH).
4297H
1 byte
SFLAG1$
Bit 2 DEBUG (4E31H), bit 5 DO file active (4E5DH).
429BH
1 byte
DEBUG on BREAK Switch
Set to FFH with DEBUG on (4E3AH); put back by CMNDI@ (4E90H).
429EH
1 byte
OVLYH$
Set to FFH before a program runs (4ECAH).
42A3H-4311H
2 bytes
Command Buffer Pointer
The start of the command that runs (4E40H, 4E49H, 4E54H).
42ADH
1 byte
BREAK$
Made a RET (4E2BH).
4225H-4264H
64 bytes
INPBUF$
The command line (4E81H).
42DEH
32 bytes
Command File Control Block
The command name from FSPEC@ (4E97H).

Tables and Texts

Address
Size
Contents
4E00H-4E13H
20 bytes
Routine Table
Routines 2-11 (4E00H).
5019H-5022H
10 bytes
Name Characters
5019H
5103H-51B5H
179 bytes
Library Command Names
39 names and the 80H end (5103H).
51B6H-51DCH
39 bytes
Library Request Codes
51B6H
51DDH-51E6H
10 bytes
Prompt
51DDH
51E7H-51E9H
3 bytes
Default Extension
CMD (51E7H).
51EAH-51F5H
12 bytes
TO, FROM, USING
51EAH

Changed Operands

Address
Size
Contents
4F77H
1 byte
Empty Field Flag
The operand of LD A,00H at 4F76H, stored at 4F4CH and 4F69H.

Outside Routines

AddressContents
0000HROM: the reset that BOOT reaches with RST 00H (5102H).
0040HROM KEYIN@: the line input of the command level (4E67H).
01C9HROM: clear the screen, for CLS (50FFH).
4405H, 4409H, 441CH, 4433H, 4467H, 444BHSYS0/SYS: CMNDI@, ERROR@, FSPEC@, RUN@, DSPLY@, FEXT@.
45A2HSYS0/SYS: the register saving wrapper of FEXT@ (4F1DH).

Disassembly

4E00H - The Routine Table

Data: SYS1/SYS's table of routines 2-11, one word each. The overlay request handler in SYS0/SYS (its 49D3H-49E6H) takes routine number n from bits 3-0 of the request code and runs the word at 4E00H + 2 x (n - 2). The request codes of SYS1/SYS have 0 in bits 7-4: 03H CMD@ (4400H), 05H CMNDI@ (4405H), 06H FSPEC@ (441CH), 07H FEXT@ (444BH) and 08H PARAM@ (4454H) come from SYS0/SYS's entry points, 0AH (BOOT) and 0BH (CLS) from the library table at 51B5H.

4E00-4E01
DEFW 4E14H 14 4E
Routine 2: 4E14H, XOR A and RET. SYS0/SYS's record locator loads the low overlay it displaced back and requests its routine 2 (its 4D5FH-4D6CH), and every low overlay answers with Register A = 00H.
4E02-4E03
DEFW 4E16H 16 4E
Routine 3: 4E16H, the DOSPLUS command level, requested by CMD@ (4400H) with code 03H. EXIT@ (402DH) and ABORT@ (4030H) jump to CMD@.
4E04-4E05
DEFW 4E14H 14 4E
Routine 4: 4E14H, the same XOR A and RET as routine 2. No file of this diskette loads Register A with 04H for a RST 28H.
4E06-4E07
DEFW 4E8EH 8E 4E
Routine 5: 4E8EH, CMNDI@, which runs the command line at Register Pair HL; requested by 4405H with code 05H.
4E08-4E09
DEFW 4ED1H D1 4E
Routine 6: 4ED1H, FSPEC@, which moves a file specification from Register Pair HL into the file control block at Register Pair DE; requested by 441CH with code 06H.
4E0A-4E0B
DEFW 4F1DH 1D 4F
Routine 7: 4F1DH, FEXT@, which adds the default extension at Register Pair HL to the file specification at Register Pair DE; requested by 444BH with code 07H.
4E0C-4E0D
DEFW 5023H 23 50
Routine 8: 5023H, PARAM@, which reads the parameters at Register Pair HL by the keyword table at Register Pair DE; requested by 4454H with code 08H.
4E0E-4E0F
DEFW 50FBH FB 50
Routine 9: 50FBH, which returns Register Pair HL = 5103H, the library command table. No file of this diskette loads Register A with 09H for a RST 28H.
4E10-4E11
DEFW 5102H 02 51
Routine 10: 5102H, the BOOT command (request code 0AH in the library table at 51BAH), which resets the computer.
4E12-4E13
DEFW 50FFH FF 50
Routine 11: 50FFH, the CLS command (request code 0BH in the library table at 51C0H), which clears the screen.

4E14H - Routines 2 and 4

The routine SYS0/SYS's record locator runs when it loads SYS1/SYS back after SYS4/SYS (its 4D5FH-4D6CH): nothing to do.

4E14
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: routines 2 and 4 have no work to do.
4E15
RET C9
RETurn to SYS0/SYS's overlay request handler (49E7H) and through it to the caller with Register A = 00H.

4E16H - CMD@ - The DOSPLUS Command Level

Routine 3, reached through CMD@ (4400H) from EXIT@ (402DH), ABORT@ (4030H) and the start-up's last return. It resets the stack, EXIT@'s return and the ABORT@ and BREAK$ vectors, then runs the next command of a command line that holds several (separated by semicolons), or displays the DOS PLUS prompt and reads a new line.

4E16
EI FB
Enable interrupts. SYS0/SYS's start-up runs with them disabled (its 4E00H); this is where they are turned on, and every return to the command level turns them on again.
4E17
LD SP,41E5H 31 E5 41
Load the Stack Pointer with 41E5H, the system stack, so whatever the program before left on the stack is dropped.
4E1A
LD HL,402DH 21 2D 40
Load Register Pair HL with 402DH, EXIT@, the return to the command level.
4E1D
PUSH HL E5
Save Register Pair HL (402DH) to the top of the stack: when the command run below returns, it goes to EXIT@ and so back to here.
4E1E
LD (4204H),HL 22 04 42
Store Register Pair HL (402DH, EXIT@) to 4204H-4205H, the address of the ROM's READY vector at 4203H: a ROM routine that ends through 4203H goes to EXIT@.
4E21
LD A,C3H 3E C3
Load Register A with C3H, the code of a JP instruction.
4E23
LD (4030H),A 32 30 40
Store Register A (C3H) to 4030H, the opcode of the ABORT@ vector, in case a program has changed it.
4E26
LD (4203H),A 32 03 42
Store Register A (C3H, a JP) to 4203H, the ROM's READY vector, which the ROM fills with JP 022EH: with 4204H-4205H it is now JP 402DH.
4E29
LD A,C9H 3E C9
Load Register A with C9H, the code of a RET instruction.
4E2B
LD (42ADH),A 32 AD 42
Store Register A (C9H) to BREAK$ at 42ADH: the BREAK vector returns at once until a program sets its own.
4E2E
LD A,(4297H) 3A 97 42
Load Register A with SFLAG1$, the system flags at 4297H.
4E31
BIT 2,A CB 57
Test bit 2 of Register A (SFLAG1$), the DEBUG flag that the DEBUG command sets.
4E33
If the Z FLAG is set (DEBUG is off), JUMP to 4E3DH with Register Pair HL = 402DH (EXIT@), the address ABORT@ goes to.
4E35
LD HL,440DH 21 0D 44
DEBUG is on: load Register Pair HL with 440DH, DEBUG@, the address ABORT@ goes to instead.
4E38
LD A,FFH 3E FF
Load Register A with FFH, to switch on DEBUG at the BREAK key.
4E3A
LD (429BH),A 32 9B 42
Store Register A (FFH) to 429BH, the DEBUG on BREAK switch: the interrupt handler enters DEBUG@ when BREAK is pressed.
4E3D
LD (4031H),HL 22 31 40
Store Register Pair HL (402DH, or 440DH with DEBUG on) to 4031H-4032H, the operand of the ABORT@ vector: ABORT@ = JP 402DH (EXIT@) or JP 440DH (DEBUG@).
4E40
LD HL,(42A3H) 2A A3 42
Load Register Pair HL with the command buffer pointer at 42A3H, the start of the command that has just run.
4E43
GOSUB to 4FE2H to skip spaces and commas: Register A returns the character at Register Pair HL, with the C FLAG set when it ends the command (a control character or a semicolon).
4E46
INC HL 23
INCrement Register Pair HL by 1, past the character in Register A.
4E47
If the NC FLAG is set (Register A is a character of the command), JUMP back to 4E43H: the loop runs to the end of the command that has just run.
4E49
LD (42A3H),HL 22 A3 42
Store Register Pair HL, the address after the character that ended the command, to the command buffer pointer at 42A3H.
4E4C
CP 20H FE 20
Compare Register A, the character that ended the command, against 20H. The NC FLAG is set when it is the semicolon (3BH) and another command follows on the line.
4E4E
If the NC FLAG is set, JUMP to 4405H (CMNDI@) to run the next command at Register Pair HL, the address after the semicolon.
4E51
LD HL,4225H 21 25 42
The line is done: point Register Pair HL to 4225H, INPBUF$, the command buffer.
4E54
LD (42A3H),HL 22 A3 42
Store Register Pair HL (4225H) to the command buffer pointer at 42A3H: the next command starts at the beginning of INPBUF$.

4E57H - The Prompt and the Command Line

Displays the prompt (unless a DO file is running), reads a line of up to 63 characters into 4300H, ignores an empty line, a line that starts with a control character and a line that starts with a period, repeats the last command for a slash, and otherwise copies the line to INPBUF$ and runs it through CMNDI@.

4E57
LD HL,51DDH 21 DD 51
Point Register Pair HL to 51DDH, the prompt text: a line feed, DOS PLUS and a carriage return.
4E5A
LD A,(4297H) 3A 97 42
Load Register A with SFLAG1$, the system flags at 4297H.
4E5D
BIT 5,A CB 6F
Test bit 5 of Register A (SFLAG1$), the flag of an active DO file. The Z FLAG is set when no DO file is running.
4E5F
If the Z FLAG is set, GOSUB to 4467H (DSPLY@) to display the prompt at Register Pair HL (51DDH). The commands of a DO file are read without a prompt.
4E62
LD B,3FH 06 3F
Load Register B with 3FH, the most characters (63) the line may have.
4E64
LD HL,4300H 21 00 43
Point Register Pair HL to 4300H, the system sector buffer, which takes the line as it is typed.
4E67
GOSUB to the ROM's line input at 0040H (KEYIN@): it reads up to Register B (63) characters into the buffer at Register Pair HL (4300H), ends them with 0DH and returns Register Pair HL = 4300H. The keyboard driver of SYS0/SYS (4DCAH) gives the lines of a DO file here.
4E6A
PUSH HL E5
Save Register Pair HL (4300H, the line) to the top of the stack.
4E6B
GOSUB to 4FE2H to skip the spaces and commas at the start of the line: Register A returns its first other character, with the C FLAG set when that ends the line.
4E6E
POP HL E1
Restore Register Pair HL (4300H, the start of the line) from the top of the stack.
4E6F
CP 20H FE 20
Compare Register A, the first character of the line, against 20H. The C FLAG is set for a control character: the line is empty (0DH) or BREAK ended it.
4E71
If the C FLAG is set, JUMP back to 4E57H for the prompt and a new line.
4E73
CP 2EH FE 2E
Compare Register A, the first character of the line, against 2EH (a period).
4E75
If the Z FLAG is set (a period: the line is a comment), JUMP back to 4E57H without running it.
4E77
CP 2FH FE 2F
Compare Register A, the first character of the line, against 2FH (a slash).
4E79
If the NZ FLAG is set (not a slash), JUMP to 4E81H to copy the line at Register Pair HL (4300H) into INPBUF$.
4E7B
LD HL,4225H 21 25 42
A slash repeats the last command: point Register Pair HL to 4225H, INPBUF$, which still holds the last line run.
4E7E
GOSUB to 4467H (DSPLY@) to display the last command at Register Pair HL (4225H). DSPLY@ keeps Register Pair HL, so the copy below moves INPBUF$ onto itself.
4E81
LD DE,4225H 11 25 42
Point Register Pair DE to 4225H, INPBUF$, where the line is to go.
4E84
PUSH DE D5
Save Register Pair DE (4225H) to the top of the stack.
4E85
LD BC,0040H 01 40 00
Load Register Pair BC with 0040H, the length of INPBUF$ (64 bytes).
4E88
LDIR ED B0
Copy Register Pair BC (64) bytes from Register Pair HL (4300H, the new line, or 4225H for a slash) to Register Pair DE (4225H, INPBUF$).
4E8A
POP HL E1
Restore Register Pair HL from the top of the stack: 4225H, the line in INPBUF$.
4E8B
JUMP to 4405H (CMNDI@) to run the command line at Register Pair HL (4225H). The command returns to EXIT@ (402DH), which comes back to 4E16H.

4E8EH - CMNDI@ - Run a Command

Routine 5, requested by CMNDI@ (4405H) with Register Pair HL pointing to a command line. The command name goes through FSPEC@ into the file control block at 42DEH; a name found in the library table (5103H) becomes the request code of its library command, any other name is run as a program with the default extension CMD. On entry the stack holds 49E7H (the overlay request handler's return) and the word it saved from 429AH-429BH; both are taken off here, so the command returns straight to the caller of CMNDI@.

4E8E
POP AF F1
Restore Register Pair AF from the top of the stack: it drops 49E7H, the return into SYS0/SYS's overlay request handler, so the handler's end (49E7H-49ECH) does not run.
4E8F
POP AF F1
Restore Register Pair AF from the top of the stack: the word the handler saved from 429AH-429BH, so Register A = the old value of 429BH, the DEBUG on BREAK switch that the handler cleared for the request.
4E90
LD (429BH),A 32 9B 42
Store Register A, the old DEBUG on BREAK switch, back to 429BH, the step the handler's end would have made.
4E93
GOSUB to 4FE2H to skip spaces and commas: Register A returns the first other character at Register Pair HL, with the C FLAG set when it ends the line.
4E96
RET C D8
If the C FLAG is set (nothing to run), RETurn to the caller of CMNDI@ with Register A = the character that ends the line.
4E97
LD DE,42DEH 11 DE 42
Point Register Pair DE to 42DEH, the file control block that takes the command name (inside the system file control block at 42CEH).
4E9A
GOSUB to 441CH (FSPEC@, routine 6 at 4ED1H) to move the command name at Register Pair HL into the file control block at Register Pair DE (42DEH). Register Pair HL returns past it; the NZ FLAG is set when it is not a file specification.
4E9D
LD A,53H 3E 53
Load Register A with 53H, the error code for ERROR@: 13H (the manual's Improper file name) with bit 6 set, the plain form of the message; bit 7 is clear, so ERROR@ ends through ABORT@.
4E9F
If the NZ FLAG is set (FSPEC@ found no name), JUMP to 4409H (ERROR@) with Register A = 53H.
4EA2
LD A,(DE) 1A
Load Register A with the first character of the name in the file control block at Register Pair DE (42DEH).
4EA3
GOSUB to 4FF9H: the C FLAG returns set when Register A is a digit, a letter or one of the characters # $ % & + < > ? ! and 2AH (the asterisk), which a name may start with.
4EA6
LD A,6CH 3E 6C
Load Register A with 6CH, the error code for ERROR@: 2CH (the manual's Illegal filespec) with bit 6 set, the plain form of the message.
4EA8
If the NC FLAG is set (the specification starts with @ or a colon: a device or a drive alone), JUMP to 4409H (ERROR@) with Register A = 6CH.
4EAB
XOR A AF
Set Register A to 00H by XORing it with itself.
4EAC
LD (4214H),A 32 14 42
Store Register A (00H) to 4214H, the ROM's count of protected lines at the top of the screen: every command starts with the whole screen scrolling.
4EAF
PUSH HL E5
Save Register Pair HL, the command line after the command name, to the top of the stack.
4EB0
LD HL,5103H 21 03 51
Point Register Pair HL to 5103H, the table of library command names.
4EB3
GOSUB to 4FBAH to look the name in the file control block at Register Pair DE (42DEH) up in the table at Register Pair HL (5103H). Register A returns the number of the entry (1-39) with the NZ FLAG, or 00H with the Z FLAG when it is not a library command.
4EB6
If the Z FLAG is set (not a library command), JUMP to 4EC2H to run it as a program.
4EB8
LD HL,51B5H 21 B5 51
Point Register Pair HL to 51B5H, the byte before the request codes of the library commands (51B6H-51DCH).
4EBB
LD E,A 5F
Load Register E with Register A, the number of the library command (1-39).
4EBC
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the number of the command.
4EBE
ADD HL,DE 19
ADD Register Pair DE (the number) to Register Pair HL (51B5H): Register Pair HL points to the command's request code.
4EBF
LD A,(HL) 7E
Load Register A with the request code of the library command at Register Pair HL: the overlay in bits 7-4 (SYS1 0, SYS9 8 ... SYS16 F) and its routine in bits 3-0.
4EC0
POP HL E1
Restore Register Pair HL from the top of the stack: the command line after the command name, which the library command reads for its parameters.
4EC1
RST 28H EF
RST 28H to 400CH and the overlay request handler (498EH) with Register A = the request code: the overlay is loaded and its routine runs the command. The handler drops the address this RST pushes, so the command returns to the caller of CMNDI@.
4EC2
LD HL,51E7H 21 E7 51
A program: point Register Pair HL to 51E7H, the text CMD, the default extension.
4EC5
GOSUB to 444BH (FEXT@, routine 7 at 4F1DH) to give the name in the file control block at Register Pair DE (42DEH) the extension at Register Pair HL (CMD) when it has none.
4EC8
LD A,FFH 3E FF
Load Register A with FFH, the value that names no overlay.
4ECA
LD (429EH),A 32 9E 42
Store Register A (FFH) to OVLYH$ at 429EH: the program loads over 5200H, so no high overlay stays resident.
4ECD
POP HL E1
Restore Register Pair HL from the top of the stack: the command line after the program name, which the program gets in Register Pair HL.
4ECE
JUMP to 4433H (RUN@) to load and run the program whose file control block Register Pair DE (42DEH) points to.

4ED1H - FSPEC@ - Move a File Specification

Routine 6, requested by FSPEC@ (441CH). Register Pair HL points to the text, Register Pair DE to the file control block. The name (up to 8 characters), the extension after a slash (3), the password after a period (8) and the drive after a colon (2) are copied with their separators and an 03H at the end; a device specification is @ and up to 2 characters. A specification that is one of the words TO, FROM and USING (51EAH) is skipped and the next one is taken. On return the Z FLAG is set when a specification was moved; Register Pair HL points past it.

4ED1
PUSH DE D5
Save Register Pair DE, the file control block, to the top of the stack.
4ED2
GOSUB to 4FE2H to skip spaces and commas at Register Pair HL: Register A returns the next other character.
4ED5
LD B,08H 06 08
Load Register B with 08H, the most characters a file name has.
4ED7
GOSUB to 4F4BH to copy up to Register B (8) characters of the name from Register Pair HL to Register Pair DE (the file control block). Register A returns the character that ended the name; the NZ FLAG is set when there were none.
4EDA
If the NZ FLAG is set (no name), JUMP to 4F13H, where @ (a device) and a colon (a drive alone) are taken.
4EDC
CP 2FH FE 2F
Compare Register A, the character after the name, against 2FH (a slash, the start of an extension).
4EDE
If the NZ FLAG is set (no extension), JUMP to 4EE9H.
4EE0
LD (DE),A 12
Store Register A (the slash) to the file control block at Register Pair DE, after the name.
4EE1
INC DE 13
INCrement Register Pair DE by 1, where the extension goes.
4EE2
LD B,03H 06 03
Load Register B with 03H, the most characters an extension has.
4EE4
GOSUB to 4F4BH to copy up to Register B (3) characters of the extension from Register Pair HL to Register Pair DE. Register A returns the character after it; the NZ FLAG is set when there were none.
4EE7
If the NZ FLAG is set (a slash with no extension), JUMP to 4F1BH to return with the NZ FLAG.
4EE9
CP 2EH FE 2E
Compare Register A, the character after the name or extension, against 2EH (a period, the start of a password).
4EEB
If the NZ FLAG is set (no password), JUMP to 4EF6H.
4EED
LD (DE),A 12
Store Register A (the period) to the file control block at Register Pair DE.
4EEE
INC DE 13
INCrement Register Pair DE by 1, where the password goes.
4EEF
LD B,08H 06 08
Load Register B with 08H, the most characters a password has.
4EF1
GOSUB to 4F4BH to copy up to Register B (8) characters of the password from Register Pair HL to Register Pair DE. Register A returns the character after it; the NZ FLAG is set when there were none.
4EF4
If the NZ FLAG is set (a period with no password), JUMP to 4F1BH to return with the NZ FLAG.
4EF6
CP 3AH FE 3A
Compare Register A, the character after the specification so far, against 3AH (a colon, the start of a drive number).
4EF8
If the NZ FLAG is set (no drive), JUMP to 4F03H to end the specification.
4EFA
LD (DE),A 12
Store Register A (the colon, or the @ of a device from 4F15H) to the file control block at Register Pair DE.
4EFB
INC DE 13
INCrement Register Pair DE by 1, where the drive or device name goes.
4EFC
LD B,02H 06 02
Load Register B with 02H, the most characters a drive or device name has.
4EFE
GOSUB to 4F4BH to copy up to Register B (2) characters from Register Pair HL to Register Pair DE. Register A returns the character after them; the NZ FLAG is set when there were none.
4F01
If the NZ FLAG is set (a colon or @ with nothing after it), JUMP to 4F1BH to return with the NZ FLAG.
4F03
LD A,03H 3E 03
Load Register A with 03H, the character that ends a file specification.
4F05
LD (DE),A 12
Store Register A (03H) to the file control block at Register Pair DE, after the last part. 4F4BH left an 03H there too; this one stays when nothing follows.
4F06
POP DE D1
Restore Register Pair DE from the top of the stack: the start of the file control block.
4F07
PUSH HL E5
Save Register Pair HL, the text after the specification, to the top of the stack.
4F08
LD HL,51EAH 21 EA 51
Point Register Pair HL to 51EAH, the list of the words TO, FROM and USING.
4F0B
GOSUB to 4FBAH to look the specification in the file control block at Register Pair DE up in the list at Register Pair HL (51EAH). The NZ FLAG returns set when it is one of the three words.
4F0E
POP HL E1
Restore Register Pair HL from the top of the stack: the text after the specification.
4F0F
If the NZ FLAG is set (TO, FROM or USING), JUMP back to 4ED1H to take the next specification at Register Pair HL in place of the word.
4F11
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: a file specification was moved.
4F12
RET C9
RETurn to the caller with the Z FLAG set, Register Pair DE = the file control block and Register Pair HL past the specification.
4F13
CP 40H FE 40
No name: compare Register A, the character that stopped it, against 40H (@, a device specification).
4F15
If the Z FLAG is set, JUMP to 4EFAH to store the @ and up to 2 characters of the device name.
4F17
CP 3AH FE 3A
Compare Register A, the character that stopped the name, against 3AH (a colon: a drive number alone).
4F19
If the Z FLAG is set, JUMP to 4EFAH to store the colon and the drive number.
4F1B
POP DE D1
Restore Register Pair DE from the top of the stack: the start of the file control block.
4F1C
RET C9
RETurn to the caller with the NZ FLAG set: no file specification. Register A holds the character that stopped the scan.

4F1DH - FEXT@ - Add a Default Extension

Routine 7, requested by FEXT@ (444BH) with Register Pair DE pointing to a file specification (as FSPEC@ leaves it) and Register Pair HL to a 3 character extension. When the name has no extension, the rest of the specification is moved up by 4 bytes and a slash and the extension are put after the name. The NZ FLAG returns set when the extension was added. All registers but Register Pair AF are kept by SYS0/SYS's wrapper at 45A2H.

4F1D
GOSUB to 4485H, the entry point that jumps to SYS0/SYS's register saving wrapper at 45A2H: it saves Register Pairs BC, DE, HL and Index Registers IX and IY, calls the code at 4F20H and, when it returns, restores them and returns to the caller of FEXT@ with Register Pair AF as 4F20H-4F4AH leave it.
4F20
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the file specification, Register Pair DE = the default extension.
4F21
LD B,09H 06 09
Load Register B with 09H, the most bytes to look at: the 8 characters of a name and the one after it.
4F23
LD A,(HL) 7E
Load Register A with the byte of the specification at Register Pair HL.
4F24
CP 2FH FE 2F
Compare Register A against 2FH (a slash): the name already has an extension.
4F26
RET Z C8
If the Z FLAG is set, RETurn with the Z FLAG: the extension is left as it is.
4F27
GOSUB to 4FF9H: the C FLAG returns set when Register A is a digit, a letter or one of the characters a name may hold.
4F2A
If the NC FLAG is set (03H, a period or a colon: the end of the name), JUMP to 4F31H to put the extension at Register Pair HL.
4F2C
INC HL 23
INCrement Register Pair HL by 1 to the next byte of the name.
4F2D
DECrement Register B and loop back to 4F23H while Register B is not zero.
4F2F
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: no end of the name within 9 bytes, nothing is added.
4F30
RET C9
RETurn to the wrapper (45B1H) with the Z FLAG set: the specification is unchanged.
4F31
PUSH DE D5
Save Register Pair DE, the default extension, to the top of the stack.
4F32
LD BC,0010H 01 10 00
Load Register Pair BC with 0010H (16), the distance to the last byte that moves.
4F35
ADD HL,BC 09
ADD Register Pair BC (16) to Register Pair HL (the byte after the name): Register Pair HL = the last of the 17 bytes from there that are to move.
4F36
LD D,H 54
Load Register D with Register H, the high byte of that address.
4F37
LD E,L 5D
Load Register E with Register L: Register Pair DE = Register Pair HL.
4F38
INC DE 13
INCrement Register Pair DE by 1, the first of four.
4F39
INC DE 13
INCrement Register Pair DE by 1 again, the second of the four bytes of room.
4F3A
INC DE 13
INCrement Register Pair DE by 1 again, the third of the four bytes of room.
4F3B
INC DE 13
INCrement Register Pair DE by 1, the fourth: Register Pair DE = Register Pair HL + 4, where the last byte goes.
4F3C
INC BC 03
INCrement Register Pair BC by 1 to 0011H, the 17 bytes from the end of the name on.
4F3D
LDDR ED B8
Copy Register Pair BC (17) bytes from Register Pair HL to Register Pair DE, from the last byte down: the rest of the specification (password, drive and the 03H) moves up 4 bytes. Register Pair DE ends at the byte after the name + 3 and Register Pair HL one below the byte after the name.
4F3F
POP HL E1
Restore Register Pair HL from the top of the stack: the default extension.
4F40
INC HL 23
INCrement Register Pair HL by 1 to the second character of the extension.
4F41
INC HL 23
INCrement Register Pair HL by 1 to the third, the last one.
4F42
LD C,03H 0E 03
Load Register C with 03H: Register Pair BC = 0003H (Register B is 00H after the LDDR), the 3 characters of the extension.
4F44
LDDR ED B8
Copy Register Pair BC (3) bytes from Register Pair HL (the extension) to Register Pair DE, from the last byte down: the extension goes into bytes 2-4 after the name, and Register Pair DE ends at the byte after the name.
4F46
LD A,2FH 3E 2F
Load Register A with 2FH, the slash that goes before the extension.
4F48
LD (DE),A 12
Store Register A (the slash) to Register Pair DE, the byte after the name, before the extension.
4F49
OR A B7
OR Register A (2FH) with itself to set the NZ FLAG: the extension was added.
4F4A
RET C9
RETurn to the wrapper (45B1H) with the NZ FLAG set.

4F4BH - Copy a Field

Copies the letters, digits and name characters (4FF9H) at Register Pair HL to Register Pair DE, at most Register B of them (more are passed over), and ends them with 03H, which is not counted in Register Pair DE. The field stops at the end of the line, an open parenthesis, a comma or any other character; that character is passed when it is not one of the first three. Register A returns the character that stopped the field; the Z FLAG is set when the field had at least one character.

4F4B
LD A,B 78
Load Register A with Register B, the most characters the field may have (never 00H).
4F4C
LD (4F77H),A 32 77 4F
Store Register A to 4F77H, the operand of the LD A,00H at 4F76H: it stays not zero, and so gives the NZ FLAG at the end, unless a character is stored.
4F4F
INC B 04
INCrement Register B by 1, so the count below lets Register B characters in.
4F50
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
4F51
GOSUB to 4FF0H: the C FLAG returns set when Register A is a control character or a semicolon, the end of the line.
4F54
If the C FLAG is set, JUMP to 4F72H to end the field with Register Pair HL at the end of the line.
4F56
CP 28H FE 28
Compare Register A against 28H (an open parenthesis, the start of the parameters).
4F58
If the Z FLAG is set, JUMP to 4F72H to end the field with Register Pair HL at the parenthesis.
4F5A
CP 2CH FE 2C
Compare Register A against 2CH (a comma, which separates the parts of a command).
4F5C
If the Z FLAG is set, JUMP to 4F72H to end the field with Register Pair HL at the comma.
4F5E
INC HL 23
INCrement Register Pair HL by 1 past the character in Register A.
4F5F
GOSUB to 4FF9H: the C FLAG returns set when Register A is a digit, a letter (made upper case) or a name character.
4F62
If the NC FLAG is set (a separator, such as a space, a slash, a period, a colon or an equals sign), JUMP to 4F72H to end the field; Register Pair HL is past the separator.
4F64
DEC B 05
DECrement Register B, the room left in the field.
4F65
If the Z FLAG is set (the field is full), JUMP to 4F6FH to pass over the character.
4F67
LD (DE),A 12
Store Register A, the character (upper case for a letter), to Register Pair DE.
4F68
XOR A AF
Set Register A to 00H by XORing it with itself.
4F69
LD (4F77H),A 32 77 4F
Store Register A (00H) to 4F77H, the operand of the LD A,00H at 4F76H: the field has a character, so the end gives the Z FLAG.
4F6C
INC DE 13
INCrement Register Pair DE by 1 to the next byte of the field.
4F6D
JUMP back to 4F50H for the next character of the field at Register Pair HL.
4F6F
INC B 04
INCrement Register B back to 1, so each further character of the field is passed over too.
4F70
JUMP back to 4F50H for the next character, which is passed over in the same way.
4F72
LD C,A 4F
Load Register C with Register A, the character that stopped the field.
4F73
LD A,03H 3E 03
Load Register A with 03H, the end of field character.
4F75
LD (DE),A 12
Store Register A (03H) to Register Pair DE, after the field. Register Pair DE is not moved, so the next part stored overwrites it.
4F76
LD A,00H 3E 00
Load Register A with the byte at 4F77H.
Self-Modifying Code
The operand is 00H in the file; 4F4CH stores the field's length there at the start and 4F69H stores 00H when a character is copied, so Register A = 00H for a field with characters and the length for an empty one.
4F78
OR A B7
OR Register A with itself: the Z FLAG is set when the field has characters, the NZ FLAG when it is empty.
4F79
LD A,C 79
Load Register A with Register C, the character that stopped the field; the flags stay as 4F78H set them.
4F7A
RET C9
RETurn with Register A = the stopping character and the Z FLAG for a field with characters.

4F7BH - Find a Parameter Keyword

Used by PARAM@ (5049H). Register Pair DE points to the parameter name (ended by 03H) and Register Pair BC to a keyword table of 8 byte entries: 6 characters, then the address where the value goes; a 00H after the last entry ends it. The name matches the first entry that begins with it, so a name may be shortened. On a match the Z FLAG is set and Register Pair DE returns the entry's address word; otherwise the NZ FLAG is set and Register A = FFH. Register Pair HL is kept.

4F7B
PUSH HL E5
Save Register Pair HL, the parameter text, to the top of the stack.
4F7C
LD H,B 60
Load Register H with Register B, the high byte of the keyword table.
4F7D
LD L,C 69
Load Register L with Register C: Register Pair HL = the keyword table.
4F7E
LD A,(DE) 1A
Load Register A with the first character of the parameter name at Register Pair DE.
4F7F
GOSUB to 5000H to make Register A upper case when it is a letter.
4F82
CP (HL) BE
Compare Register A against the first character of the table entry at Register Pair HL.
4F83
If the Z FLAG is set (the first characters agree), JUMP to 4F91H to compare the rest.
4F85
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the length of an entry.
4F88
ADD HL,BC 09
ADD Register Pair BC (8) to Register Pair HL: Register Pair HL points to the next entry.
4F89
LD A,(HL) 7E
Load Register A with the first byte of the entry at Register Pair HL.
4F8A
OR A B7
OR Register A with itself to test it for 00H, the end of the table.
4F8B
If the NZ FLAG is set (another entry), JUMP back to 4F7EH to try it.
4F8D
POP HL E1
Restore Register Pair HL from the top of the stack: the parameter text.
4F8E
OR FFH F6 FF
OR Register A with FFH: Register A = FFH and the NZ FLAG is set, the name is not in the table.
4F90
RET C9
RETurn to PARAM@ (504CH) with the NZ FLAG set and Register A = FFH.
4F91
PUSH HL E5
Save Register Pair HL, the entry whose first character agrees, to the top of the stack.
4F92
PUSH DE D5
Save Register Pair DE, the parameter name, to the top of the stack.
4F93
LD B,05H 06 05
Load Register B with 05H, the other five characters of the entry.
4F95
INC DE 13
INCrement Register Pair DE by 1 to the next character of the name.
4F96
INC HL 23
INCrement Register Pair HL by 1 to the next character of the entry.
4F97
LD A,(DE) 1A
Load Register A with the character of the name at Register Pair DE.
4F98
GOSUB to 4FF0H: the C FLAG returns set when Register A is a control character (the 03H at the end of the name) or a semicolon.
4F9B
If the C FLAG is set (the name ended and all of it agreed), JUMP to 4FA5H: a match.
4F9D
GOSUB to 5000H to make Register A upper case when it is a letter.
4FA0
CP (HL) BE
Compare Register A against the character of the entry at Register Pair HL.
4FA1
If the NZ FLAG is set (they differ), JUMP to 4FB1H.
4FA3
DECrement Register B and loop back to 4F95H while Register B is not zero: all six characters agreed when it ends.
4FA5
POP DE D1
Restore Register Pair DE from the top of the stack: the parameter name.
4FA6
POP BC C1
Restore Register Pair BC from the top of the stack: the start of the matching entry.
4FA7
LD HL,0006H 21 06 00
Load Register Pair HL with 0006H, the offset of the entry's address word.
4FAA
ADD HL,BC 09
ADD Register Pair BC (the entry) to Register Pair HL: Register Pair HL points to the word at entry+06H.
4FAB
LD E,(HL) 5E
Load Register E with the low byte of the word at Register Pair HL.
4FAC
INC HL 23
INCrement Register Pair HL by 1 to the high byte.
4FAD
LD D,(HL) 56
Load Register D with the high byte at Register Pair HL: Register Pair DE = the address where the parameter's value goes.
4FAE
POP HL E1
Restore Register Pair HL from the top of the stack: the parameter text, as it was on entry.
4FAF
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: the keyword was found.
4FB0
RET C9
RETurn with the Z FLAG set and Register Pair DE = the value's address.
4FB1
The characters differ: GOSUB to 4FF9H, which returns the C FLAG when Register A (the name's character) is a digit, a letter or a name character.
4FB4
If the NC FLAG is set (the name's character is a separator), JUMP to 4FA5H: the name ended and is a match.
4FB6
POP DE D1
Restore Register Pair DE from the top of the stack: the start of the parameter name.
4FB7
POP HL E1
Restore Register Pair HL from the top of the stack: the entry that did not match.
4FB8
JUMP to 4F85H to try the next entry of the keyword table after Register Pair HL.

4FBAH - Look a Word Up in a Name Table

Register Pair HL points to a table of words, each with bit 7 set on its first character, ended by 80H; Register Pair DE points to the word, ended by 03H (as 4F4BH leaves a field). Used for the library commands (5103H) and the words TO, FROM and USING (51EAH). Register A returns the number of the matching entry, counted from 1, with the NZ FLAG; or 00H with the Z FLAG when no entry matches all of the word.

4FBA
LD B,00H 06 00
Load Register B with 00H, the entry count, which 4FBCH counts up from 1.
4FBC
INC B 04
INCrement Register B by 1, the number of the entry about to be compared.
4FBD
LD A,(HL) 7E
Load Register A with the byte of the table at Register Pair HL.
4FBE
INC HL 23
INCrement Register Pair HL by 1 to the byte after it.
4FBF
OR A B7
OR Register A with itself to test bit 7, the mark of an entry's first character.
4FC0
If the P FLAG is set (bit 7 clear: the rest of an entry that did not match), JUMP back to 4FBDH to pass over it.
4FC3
AND 7FH E6 7F
AND Register A with 7FH to drop the mark: Register A = the first character of the entry, or 00H for the 80H that ends the table.
4FC5
RET Z C8
If the Z FLAG is set (the end of the table), RETurn with Register A = 00H and the Z FLAG: the word is not in the table.
4FC6
PUSH DE D5
Save Register Pair DE, the start of the word, to the top of the stack.
4FC7
LD C,A 4F
Load Register C with Register A, the character of the entry to compare.
4FC8
LD A,(DE) 1A
Load Register A with the character of the word at Register Pair DE.
4FC9
GOSUB to 5000H to make Register A upper case when it is a letter.
4FCC
CP C B9
Compare Register A, the character of the word, against Register C, the character of the entry.
4FCD
If the NZ FLAG is set (they differ, or Register C is the marked first character of the next entry), JUMP to 4FD4H.
4FCF
LD A,(HL) 7E
Load Register A with the next byte of the table at Register Pair HL.
4FD0
INC DE 13
INCrement Register Pair DE by 1 to the next character of the word.
4FD1
INC HL 23
INCrement Register Pair HL by 1 past the byte in Register A.
4FD2
JUMP back to 4FC7H to compare that byte of the table with the next character of the word.
4FD4
POP DE D1
Restore Register Pair DE from the top of the stack: the start of the word.
4FD5
BIT 7,C CB 79
Test bit 7 of Register C. It is set when the whole entry agreed and Register C is the first character of the next entry (or the 80H at the end).
4FD7
If the Z FLAG is set (a character differed), JUMP back to 4FBCH for the next entry; Register Pair HL is already past the differing byte.
4FD9
CP 03H FE 03
Compare Register A, the character of the word after the entry's last, against 03H, the end of the word.
4FDB
DEC HL 2B
DECrement Register Pair HL by 1, back to the marked byte of the next entry. The flags stay as the compare set them.
4FDC
If the NZ FLAG is set (the word is longer than the entry), JUMP back to 4FBCH; the next entry is read from Register Pair HL.
4FDE
LD A,B 78
Load Register A with Register B, the number of the matching entry.
4FDF
OR A B7
OR Register A with itself to set the NZ FLAG: the word was found.
4FE0
RET C9
RETurn with Register A = the entry number and the NZ FLAG set.

4FE1H - Character Tests

4FE2H skips spaces and commas; 4FF0H tests for the end of a line; 4FF9H tests for a character a name may hold; 5000H tests for a letter and makes it upper case; 5009H tests for one of the ten name characters at 5019H.

4FE1
INC HL 23
INCrement Register Pair HL by 1 past the space or comma.
4FE2
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
4FE3
GOSUB to 4FF0H: the C FLAG returns set when Register A ends the line (a control character or a semicolon).
4FE6
RET C D8
If the C FLAG is set, RETurn with Register A = the character that ends the line and the C FLAG.
4FE7
CP 2CH FE 2C
Compare Register A against 2CH (a comma), which is skipped like a space.
4FE9
If the Z FLAG is set, JUMP back to 4FE1H to pass over it.
4FEB
CP 20H FE 20
Compare Register A against 20H (a space), which is skipped.
4FED
If the Z FLAG is set, JUMP back to 4FE1H to pass over it.
4FEF
RET C9
RETurn with Register A = the first other character, the NC FLAG set and Register Pair HL pointing to it.
4FF0
CP 20H FE 20
Compare Register A against 20H. The C FLAG is set for a control character (00H-1FH), which ends a line.
4FF2
RET C D8
If the C FLAG is set, RETurn with the C FLAG: the end of the line.
4FF3
CP 3BH FE 3B
Compare Register A against 3BH (a semicolon, which ends one command of a line of several).
4FF5
SCF 37
Set the C FLAG, keeping the Z FLAG of the compare.
4FF6
RET Z C8
If the Z FLAG is set (a semicolon), RETurn with the C FLAG: the end of the command.
4FF7
CCF 3F
Complement the C FLAG to NC: Register A does not end the line.
4FF8
RET C9
RETurn with the NC FLAG set and Register A unchanged: not the end of the line.
4FF9
CP 30H FE 30
Compare Register A against 30H, the character 0. The C FLAG is set below it.
4FFB
If the C FLAG is set, JUMP to 5009H to test Register A against the name characters.
4FFD
CP 3AH FE 3A
Compare Register A against 3AH, one past the character 9.
4FFF
RET C D8
If the C FLAG is set (a digit), RETurn with the C FLAG.
5000
CP 41H FE 41
Compare Register A against 41H, the character A. The C FLAG is set below it.
5002
If the C FLAG is set, JUMP to 5009H to test Register A against the name characters.
5004
AND 5FH E6 5F
AND Register A with 5FH, clearing bits 7 and 5: a lower case letter becomes upper case.
5006
CP 5BH FE 5B
Compare Register A against 5BH, one past the character Z. The C FLAG is set for a letter.
5008
RET C9
RETurn with Register A = the character (upper case) and the C FLAG set for a letter.
5009
PUSH BC C5
Save Register Pair BC to the top of the stack.
500A
PUSH HL E5
Save Register Pair HL to the top of the stack.
500B
LD BC,000AH 01 0A 00
Load Register Pair BC with 000AH, the number of name characters in the table.
500E
LD HL,5019H 21 19 50
Point Register Pair HL to 5019H, the table of name characters.
5011
CPIR ED B1
Compare Register A with the bytes at Register Pair HL (5019H), INCrementing Register Pair HL and DECrementing Register Pair BC (10), until one agrees (the Z FLAG) or Register Pair BC is zero.
5013
POP HL E1
Restore Register Pair HL from the top of the stack, as it was.
5014
POP BC C1
Restore Register Pair BC from the top of the stack, as it was.
5015
SCF 37
Set the C FLAG, keeping the Z FLAG of the search.
5016
RET Z C8
If the Z FLAG is set (Register A is in the table), RETurn with the C FLAG.
5017
CCF 3F
Complement the C FLAG to NC: Register A is not a name character.
5018
RET C9
RETurn with the NC FLAG set and Register A unchanged.
5019-5022
DEFB 23H,24H,25H,26H,2BH,3CH,3EH,3FH,2AH,21H 23 24 25 26 2B 3C 3E 3F 2A 21
Data: the ten characters 5009H accepts in a name besides letters and digits: # $ % & + < > ? and 2AH and 21H (the asterisk and the exclamation mark).

5023H - PARAM@ - Read the Parameters

Routine 8, requested by PARAM@ (4454H) with Register Pair HL pointing to the parameters and Register Pair DE to the caller's keyword table (8 byte entries: 6 characters, then the address of the value word; 00H ends the table). The parameters may be in parentheses and are separated by commas: NAME=value or NAME alone. A value is Y, YES, ON (FFFFH), N, NO, OFF (0000H), a hexadecimal number with an H after it, or a decimal number; NAME alone stores FFFFH. Each value goes to the 2 bytes the keyword's entry names. The Z FLAG returns set when all the parameters were taken (or there are none); the NZ FLAG for a name that is missing or not in the table, or a bad character after a value.

5023
GOSUB to 4FE2H to skip spaces and commas: Register A returns the first other character at Register Pair HL, with the C FLAG set when the line ends there.
5026
If the C FLAG is set (no parameters), JUMP to 506CH to return with the Z FLAG.
5028
CP 28H FE 28
Compare Register A, the first character of the parameters, against 28H (an open parenthesis).
502A
If the Z FLAG is set, JUMP to 502DH with Register Pair HL at the parenthesis, which 5033H passes.
502C
DEC HL 2B
No parenthesis: DECrement Register Pair HL by 1, so the INC HL at 5033H comes back to the first character.
502D
PUSH DE D5
Save Register Pair DE, the keyword table, to the top of the stack.
502E
LD B,06H 06 06
Load Register B with 06H, the most characters of a parameter name.
5030
LD DE,4300H 11 00 43
Point Register Pair DE to 4300H, the system sector buffer, which takes the name.
5033
INC HL 23
INCrement Register Pair HL by 1, past the parenthesis or the comma before the name.
5034
GOSUB to 4F4BH to copy up to Register B (6) characters of the parameter name from Register Pair HL to Register Pair DE (4300H), ended by 03H. Register A returns the character after the name; the NZ FLAG is set when there was none.
5037
POP DE D1
Restore Register Pair DE from the top of the stack: the keyword table.
5038
RET NZ C0
If the NZ FLAG is set (no name), RETurn with the NZ FLAG and Register A = the character found in its place.
5039
GOSUB to 4FF0H: the C FLAG returns set when Register A, the character after the name, ends the line.
503C
If the C FLAG is set, JUMP to 5043H; 4F4BH left Register Pair HL at that character.
503E
CP 2CH FE 2C
Compare Register A, the character after the name, against 2CH (a comma).
5040
If the Z FLAG is set, JUMP to 5043H; 4F4BH left Register Pair HL at the comma.
5042
DEC HL 2B
Any other character (an equals sign, a close parenthesis) was passed by 4F4BH: DECrement Register Pair HL by 1 back to it.
5043
PUSH DE D5
Save Register Pair DE, the keyword table, to the top of the stack.
5044
LD B,D 42
Load Register B with Register D, the high byte of the keyword table.
5045
LD C,E 4B
Load Register C with Register E: Register Pair BC = the keyword table.
5046
LD DE,4300H 11 00 43
Point Register Pair DE to 4300H, the parameter name.
5049
GOSUB to 4F7BH to find the name at Register Pair DE (4300H) in the table at Register Pair BC. On a match the Z FLAG is set and Register Pair DE returns the address of the value.
504C
If the Z FLAG is set (the keyword was found), JUMP to 5050H with Register Pair DE = the value address.
504E
POP DE D1
Restore Register Pair DE from the top of the stack: the keyword table.
504F
RET C9
RETurn with the NZ FLAG set and Register A = FFH: the parameter is not in the table.
5050
LD A,(HL) 7E
Load Register A with the character after the name at Register Pair HL.
5051
CP 3DH FE 3D
Compare Register A against 3DH (an equals sign, which a value follows).
5053
If the Z FLAG is set, JUMP to 506EH to read the value.
5055
LD BC,FFFFH 01 FF FF
A name alone: load Register Pair BC with FFFFH, the value of a switch that is named (on).
5058
LD A,C 79
Load Register A with Register C, the low byte of the value.
5059
LD (DE),A 12
Store Register A, the low byte, to the value's address at Register Pair DE.
505A
INC DE 13
INCrement Register Pair DE by 1 to the high byte of the value.
505B
LD A,B 78
Load Register A with Register B, the high byte of the value.
505C
LD (DE),A 12
Store Register A, the high byte, to Register Pair DE.
505D
POP DE D1
Restore Register Pair DE from the top of the stack: the keyword table.
505E
LD A,(HL) 7E
Load Register A with the character after the parameter at Register Pair HL.
505F
CP 2CH FE 2C
Compare Register A against 2CH (a comma: another parameter follows).
5061
If the Z FLAG is set, JUMP back to 502DH for the next parameter.
5063
GOSUB to 4FF0H: the C FLAG returns set when Register A ends the line.
5066
If the C FLAG is set (the end of the line), JUMP to 506CH to return with the Z FLAG.
5068
CP 29H FE 29
Compare Register A against 29H (a close parenthesis, the end of the parameters).
506A
RET NZ C0
If the NZ FLAG is set (any other character), RETurn with the NZ FLAG and Register A = that character.
506B
INC HL 23
INCrement Register Pair HL by 1 past the close parenthesis.
506C
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: the parameters were taken.
506D
RET C9
RETurn with the Z FLAG set and Register Pair HL past the parameters.
506E
INC HL 23
INCrement Register Pair HL by 1 past the equals sign, to the value.
506F
PUSH HL E5
Save Register Pair HL, the value's text, to the top of the stack.
5070
GOSUB to 5088H to read Y, YES, N, NO, ON or OFF at Register Pair HL. The Z FLAG returns set with the value in Register Pair BC (FFFFH or 0000H) when it is one of them.
5073
If the NZ FLAG is set (not one of the words), JUMP to 5078H to try a number.
5075
POP AF F1
Restore Register Pair AF from the top of the stack: it drops the saved address of the value's text, as Register Pair HL is past the word.
5076
JUMP back to 5058H to store Register Pair BC (FFFFH or 0000H).
5078
POP HL E1
Restore Register Pair HL from the top of the stack: the start of the value's text.
5079
PUSH HL E5
Save Register Pair HL, the value's text, to the top of the stack again.
507A
GOSUB to 50CDH to read a hexadecimal number at Register Pair HL. The Z FLAG returns set with the number in Register Pair BC when the digits end with H.
507D
If the NZ FLAG is set (no H after the digits), JUMP to 5082H to read the value as a decimal number.
507F
POP AF F1
Restore Register Pair AF from the top of the stack: it drops the saved address of the value's text, as Register Pair HL is past the H.
5080
JUMP back to 5058H to store Register Pair BC, the hexadecimal number.
5082
POP HL E1
Restore Register Pair HL from the top of the stack: the start of the value's text.
5083
GOSUB to 50B2H to read a decimal number at Register Pair HL into Register Pair BC (0000H when no digit is there).
5086
JUMP back to 5058H to store Register Pair BC, the decimal number.

5088H - Read a Yes or No Value

Register Pair HL points to the value. Y or ON gives Register Pair BC = FFFFH, N or OFF 0000H, with the Z FLAG; the rest of the word (YES, NO) is passed. Any other value gives the NZ FLAG.

5088
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the value of N, NO and OFF.
508B
LD A,(HL) 7E
Load Register A with the first character of the value at Register Pair HL.
508C
GOSUB to 5000H to make Register A upper case when it is a letter.
508F
CP 59H FE 59
Compare Register A against 59H (Y, the start of Y or YES).
5091
If the Z FLAG is set (Y or YES), JUMP to 50A6H to load Register Pair BC with FFFFH.
5093
CP 4EH FE 4E
Compare Register A against 4EH (N, the start of N or NO).
5095
If the Z FLAG is set (N or NO), JUMP to 50A9H with Register Pair BC = 0000H.
5097
CP 4FH FE 4F
Compare Register A against 4FH (O, the start of ON or OFF).
5099
RET NZ C0
If the NZ FLAG is set (none of these), RETurn with the NZ FLAG.
509A
INC HL 23
INCrement Register Pair HL by 1 to the second character.
509B
LD A,(HL) 7E
Load Register A with the second character at Register Pair HL.
509C
GOSUB to 5000H to make Register A upper case when it is a letter.
509F
CP 46H FE 46
Compare Register A against 46H (F, the second character of OFF).
50A1
If the Z FLAG is set, JUMP to 50A9H with Register Pair BC = 0000H.
50A3
CP 4EH FE 4E
Compare Register A against 4EH (N, the second character of ON).
50A5
RET NZ C0
If the NZ FLAG is set (neither), RETurn with the NZ FLAG.
50A6
LD BC,FFFFH 01 FF FF
Load Register Pair BC with FFFFH, the value of Y, YES and ON.
50A9
INC HL 23
INCrement Register Pair HL by 1 to the next character of the word.
50AA
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
50AB
GOSUB to 4FF9H: the C FLAG returns set when Register A is a digit, a letter or a name character.
50AE
If the C FLAG is set (still the word), JUMP back to 50A9H to pass over it.
50B0
XOR A AF
Set Register A to 00H by XORing it with itself, and set the Z FLAG: the value is in Register Pair BC.
50B1
RET C9
RETurn with the Z FLAG and Register Pair HL past the word.

50B2H - Read a Decimal Number

Register Pair HL points to the digits; Register Pair BC returns their value (the low 16 bits) and Register Pair HL the first character that is not a digit.

50B2
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the value so far.
50B5
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
50B6
SUB 30H D6 30
SUBtract 30H from Register A: a digit becomes 0-9.
50B8
RET C D8
If the C FLAG is set (below the character 0), RETurn with Register Pair BC = the number.
50B9
CP 0AH FE 0A
Compare Register A against 0AH. The NC FLAG is set for a character above 9.
50BB
RET NC D0
If the NC FLAG is set, RETurn with Register Pair BC = the number.
50BC
PUSH HL E5
Save Register Pair HL, the text, to the top of the stack.
50BD
LD H,B 60
Load Register H with Register B, the high byte of the value so far.
50BE
LD L,C 69
Load Register L with Register C: Register Pair HL = the value so far.
50BF
ADD HL,HL 29
ADD Register Pair HL to itself: twice the value.
50C0
ADD HL,HL 29
ADD Register Pair HL to itself: four times the value.
50C1
ADD HL,BC 09
ADD Register Pair BC (the value) to Register Pair HL: five times the value.
50C2
ADD HL,HL 29
ADD Register Pair HL to itself: ten times the value.
50C3
LD B,00H 06 00
Load Register B with 00H, the high byte of the digit to add.
50C5
LD C,A 4F
Load Register C with Register A, the digit: Register Pair BC = the digit.
50C6
ADD HL,BC 09
ADD Register Pair BC (the digit) to Register Pair HL (ten times the value).
50C7
LD B,H 44
Load Register B with Register H, the high byte of the new value.
50C8
LD C,L 4D
Load Register C with Register L: Register Pair BC = the new value.
50C9
POP HL E1
Restore Register Pair HL from the top of the stack: the text.
50CA
INC HL 23
INCrement Register Pair HL by 1 to the next character.
50CB
JUMP back to 50B5H for the next digit at Register Pair HL.

50CDH - Read a Hexadecimal Number

Register Pair HL points to the digits (0-9, A-F). When they end with H, Register Pair BC returns their value (the low 16 bits) with the Z FLAG and Register Pair HL past the H; otherwise the NZ FLAG is returned.

50CD
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the value so far.
50D0
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
50D1
GOSUB to 5000H to make Register A upper case when it is a letter.
50D4
SUB 30H D6 30
SUBtract 30H from Register A: the digits 0-9 become 00H-09H.
50D6
RET C D8
If the C FLAG is set (below the character 0), RETurn with the NZ FLAG: no H ends the number.
50D7
CP 0AH FE 0A
Compare Register A against 0AH. The C FLAG is set for 0-9.
50D9
If the C FLAG is set, JUMP to 50EDH to add the digit in Register A.
50DB
SUB 07H D6 07
SUBtract 07H from Register A: the letters A-F become 0AH-0FH.
50DD
CP 0AH FE 0A
Compare Register A against 0AH. The C FLAG is set for the characters between 9 and A.
50DF
RET C D8
If the C FLAG is set, RETurn with the NZ FLAG: not a hexadecimal number.
50E0
CP 10H FE 10
Compare Register A against 10H. The C FLAG is set for A-F.
50E2
If the C FLAG is set, JUMP to 50EDH to add the digit in Register A.
50E4
LD A,(HL) 7E
Load Register A with the character after the digits at Register Pair HL.
50E5
GOSUB to 5000H to make Register A upper case when it is a letter.
50E8
CP 48H FE 48
Compare Register A against 48H (H, the mark of a hexadecimal number).
50EA
RET NZ C0
If the NZ FLAG is set (no H), RETurn with the NZ FLAG.
50EB
INC HL 23
INCrement Register Pair HL by 1 past the H that ends the number.
50EC
RET C9
RETurn with the Z FLAG set and Register Pair BC = the number.
50ED
PUSH HL E5
Save Register Pair HL, the text, to the top of the stack.
50EE
LD H,B 60
Load Register H with Register B, the high byte of the value so far.
50EF
LD L,C 69
Load Register L with Register C: Register Pair HL = the value so far.
50F0
ADD HL,HL 29
ADD Register Pair HL to itself: twice the value.
50F1
ADD HL,HL 29
ADD Register Pair HL to itself: 4 times the value so far.
50F2
ADD HL,HL 29
ADD Register Pair HL to itself: 8 times the value so far.
50F3
ADD HL,HL 29
ADD Register Pair HL to itself: 16 times the value, with the low four bits 0.
50F4
LD B,H 44
Load Register B with Register H, the high byte of 16 times the value.
50F5
ADD A,L 85
ADD Register L to Register A (the digit, 00H-0FH): the low four bits of Register L are 0, so no carry comes out.
50F6
LD C,A 4F
Load Register C with Register A: Register Pair BC = 16 times the value + the digit.
50F7
POP HL E1
Restore Register Pair HL from the top of the stack: the text.
50F8
INC HL 23
INCrement Register Pair HL by 1 to the next character.
50F9
JUMP back to 50D0H for the next digit at Register Pair HL.

50FBH - Routine 9 - The Library Table's Address

Returns the address of the library command names.

50FB
LD HL,5103H 21 03 51
Point Register Pair HL to 5103H, the table of library command names.
50FE
RET C9
RETurn to the overlay request handler (49E7H), which keeps Register Pair HL as the routine leaves it, so the caller gets 5103H.

50FFH - Routine 11 - CLS

The CLS command (request code 0BH, 51C0H).

50FF
JUMP to the ROM's 01C9H, which clears the screen and homes the cursor; its RET goes back to the overlay request handler (49E7H) and the caller of CMNDI@.
5102
RST 00H C7
RST 00H to the ROM's 0000H, the reset: the ROM sets up the computer and boots the diskette in drive 0. Nothing returns.

5103H - The Library Commands

Data: the names of the 39 library commands, in alphabetical order, each with bit 7 set on its first character; the 80H at 51B5H ends the table. CMNDI@ looks the command name up here with 4FBAH (4EB3H), which gives the entry's number n, and takes the request code at 51B5H + n (4EB8H-4EBFH).

5103-5108
DEFB C1H / DEFM "PPEND" C1 50 50 45 4E 44
Entry 1: APPEND, with bit 7 set on the A (C1H). Its request code is at 51B6H.
5109-510E
DEFB C1H / DEFM "SSIGN" C1 53 53 49 47 4E
Entry 2: ASSIGN, with bit 7 set on the A (C1H). Its request code is at 51B7H.
510F-5114
DEFB C1H / DEFM "TTRIB" C1 54 54 52 49 42
Entry 3: ATTRIB, with bit 7 set on the A (C1H). Its request code is at 51B8H.
5115-5118
DEFB C1H / DEFM "UTO" C1 55 54 4F
Entry 4: AUTO, with bit 7 set on the A (C1H). Its request code is at 51B9H.
5119-511C
DEFB C2H / DEFM "OOT" C2 4F 4F 54
Entry 5: BOOT, with bit 7 set on the B (C2H). Its request code is at 51BAH.
511D-5121
DEFB C2H / DEFM "REAK" C2 52 45 41 4B
Entry 6: BREAK, with bit 7 set on the B (C2H). Its request code is at 51BBH.
5122-5126
DEFB C2H / DEFM "UILD" C2 55 49 4C 44
Entry 7: BUILD, with bit 7 set on the B (C2H). Its request code is at 51BCH.
5127-5129
DEFB C3H / DEFM "AT" C3 41 54
Entry 8: CAT, with bit 7 set on the C (C3H). Its request code is at 51BDH.
512A-512E
DEFB C3H / DEFM "LEAR" C3 4C 45 41 52
Entry 9: CLEAR, with bit 7 set on the C (C3H). Its request code is at 51BEH.
512F-5133
DEFB C3H / DEFM "LOCK" C3 4C 4F 43 4B
Entry 10: CLOCK, with bit 7 set on the C (C3H). Its request code is at 51BFH.
5134-5136
DEFB C3H / DEFM "LS" C3 4C 53
Entry 11: CLS, with bit 7 set on the C (C3H). Its request code is at 51C0H.
5137-513C
DEFB C3H / DEFM "ONFIG" C3 4F 4E 46 49 47
Entry 12: CONFIG, with bit 7 set on the C (C3H). Its request code is at 51C1H.
513D-5140
DEFB C3H / DEFM "OPY" C3 4F 50 59
Entry 13: COPY, with bit 7 set on the C (C3H). Its request code is at 51C2H.
5141-5146
DEFB C3H / DEFM "REATE" C3 52 45 41 54 45
Entry 14: CREATE, with bit 7 set on the C (C3H). Its request code is at 51C3H.
5147-514A
DEFB C4H / DEFM "ATE" C4 41 54 45
Entry 15: DATE, with bit 7 set on the D (C4H). Its request code is at 51C4H.
514B-514F
DEFB C4H / DEFM "EBUG" C4 45 42 55 47
Entry 16: DEBUG, with bit 7 set on the D (C4H). Its request code is at 51C5H.
5150-5152
DEFB C4H / DEFM "IR" C4 49 52
Entry 17: DIR, with bit 7 set on the D (C4H). Its request code is at 51C6H.
5153-5154
DEFB C4H / DEFM "O" C4 4F
Entry 18: DO, with bit 7 set on the D (C4H). Its request code is at 51C7H.
5155-5158
DEFB C4H / DEFM "UMP" C4 55 4D 50
Entry 19: DUMP, with bit 7 set on the D (C4H). Its request code is at 51C8H.
5159-515D
DEFB C5H / DEFM "RROR" C5 52 52 4F 52
Entry 20: ERROR, with bit 7 set on the E (C5H). Its request code is at 51C9H.
515E-5163
DEFB C6H / DEFM "ILTER" C6 49 4C 54 45 52
Entry 21: FILTER, with bit 7 set on the F (C6H). Its request code is at 51CAH.
5164-5168
DEFB C6H / DEFM "ORCE" C6 4F 52 43 45
Entry 22: FORCE, with bit 7 set on the F (C6H). Its request code is at 51CBH.
5169-516D
DEFB C6H / DEFM "ORMS" C6 4F 52 4D 53
Entry 23: FORMS, with bit 7 set on the F (C6H). Its request code is at 51CCH.
516E-5171
DEFB C6H / DEFM "REE" C6 52 45 45
Entry 24: FREE, with bit 7 set on the F (C6H). Its request code is at 51CDH.
5172
DEFB C9H C9
Entry 25: I, with bit 7 set on the I (C9H). Its request code is at 51CEH.
5173-5176
DEFB CAH / DEFM "OIN" CA 4F 49 4E
Entry 26: JOIN, with bit 7 set on the J (CAH). Its request code is at 51CFH.
5177-517A
DEFB CBH / DEFM "ILL" CB 49 4C 4C
Entry 27: KILL, with bit 7 set on the K (CBH). Its request code is at 51D0H.
517B-517D
DEFB CCH / DEFM "IB" CC 49 42
Entry 28: LIB, with bit 7 set on the L (CCH). Its request code is at 51D1H.
517E-5181
DEFB CCH / DEFM "IST" CC 49 53 54
Entry 29: LIST, with bit 7 set on the L (CCH). Its request code is at 51D2H.
5182-5185
DEFB CCH / DEFM "OAD" CC 4F 41 44
Entry 30: LOAD, with bit 7 set on the L (CCH). Its request code is at 51D3H.
5186-518A
DEFB D0H / DEFM "AUSE" D0 41 55 53 45
Entry 31: PAUSE, with bit 7 set on the P (D0H). Its request code is at 51D4H.
518B-518E
DEFB D0H / DEFM "ROT" D0 52 4F 54
Entry 32: PROT, with bit 7 set on the P (D0H). Its request code is at 51D5H.
518F-5194
DEFB D2H / DEFM "ENAME" D2 45 4E 41 4D 45
Entry 33: RENAME, with bit 7 set on the R (D2H). Its request code is at 51D6H.
5195-5199
DEFB D2H / DEFM "ESET" D2 45 53 45 54
Entry 34: RESET, with bit 7 set on the R (D2H). Its request code is at 51D7H.
519A-519E
DEFB D2H / DEFM "S232" D2 53 32 33 32
Entry 35: RS232, with bit 7 set on the R (D2H). Its request code is at 51D8H.
519F-51A4
DEFB D3H / DEFM "CREEN" D3 43 52 45 45 4E
Entry 36: SCREEN, with bit 7 set on the S (D3H). Its request code is at 51D9H.
51A5-51AA
DEFB D3H / DEFM "YSTEM" D3 59 53 54 45 4D
Entry 37: SYSTEM, with bit 7 set on the S (D3H). Its request code is at 51DAH.
51AB-51AE
DEFB D4H / DEFM "IME" D4 49 4D 45
Entry 38: TIME, with bit 7 set on the T (D4H). Its request code is at 51DBH.
51AF-51B4
DEFB D6H / DEFM "ERIFY" D6 45 52 49 46 59
Entry 39: VERIFY, with bit 7 set on the V (D6H). Its request code is at 51DCH.
51B5
DEFB 80H 80
The end of the name table: 4FBAH stops at a byte with bit 7 set and nothing else (4FC3H-4FC5H). The same byte is the place before the request codes: the code of entry n is at 51B5H + n.

51B6H - The Request Codes of the Library Commands

Data: one byte for each entry of the name table, in the same order. Bits 7-4 name the overlay (0 SYS1/SYS, 8 SYS9/SYS ... F SYS16/SYS: the system number less 1) and bits 3-0 the routine in its table. CMNDI@ gives the code to RST 28H at 4EC1H.

51B6
DEFB 94H 94
The APPEND command: request code 94H, routine 4 of SYS10/SYS.
51B7
DEFB A5H A5
The ASSIGN command: request code A5H, routine 5 of SYS11/SYS.
51B8
DEFB D3H D3
The ATTRIB command: request code D3H, routine 3 of SYS14/SYS.
51B9
DEFB B3H B3
The AUTO command: request code B3H, routine 3 of SYS12/SYS.
51BA
DEFB 0AH 0A
The BOOT command: request code 0AH, routine 10 of SYS1/SYS.
51BB
DEFB B4H B4
The BREAK command: request code B4H, routine 4 of SYS12/SYS.
51BC
DEFB E3H E3
The BUILD command: request code E3H, routine 3 of SYS15/SYS.
51BD
DEFB 83H 83
The CAT command: request code 83H, routine 3 of SYS9/SYS.
51BE
DEFB E4H E4
The CLEAR command: request code E4H, routine 4 of SYS15/SYS.
51BF
DEFB B5H B5
The CLOCK command: request code B5H, routine 5 of SYS12/SYS.
51C0
DEFB 0BH 0B
The CLS command: request code 0BH, routine 11 of SYS1/SYS.
51C1
DEFB F3H F3
The CONFIG command: request code F3H, routine 3 of SYS16/SYS.
51C2
DEFB 93H 93
The COPY command: request code 93H, routine 3 of SYS10/SYS.
51C3
DEFB E5H E5
The CREATE command: request code E5H, routine 5 of SYS15/SYS.
51C4
DEFB B6H B6
The DATE command: request code B6H, routine 6 of SYS12/SYS.
51C5
DEFB B7H B7
The DEBUG command: request code B7H, routine 7 of SYS12/SYS.
51C6
DEFB 84H 84
The DIR command: request code 84H, routine 4 of SYS9/SYS.
51C7
DEFB C3H C3
The DO command: request code C3H, routine 3 of SYS13/SYS.
51C8
DEFB E6H E6
The DUMP command: request code E6H, routine 6 of SYS15/SYS.
51C9
DEFB B8H B8
The ERROR command: request code B8H, routine 8 of SYS12/SYS.
51CA
DEFB A7H A7
The FILTER command: request code A7H, routine 7 of SYS11/SYS.
51CB
DEFB A3H A3
The FORCE command: request code A3H, routine 3 of SYS11/SYS.
51CC
DEFB C4H C4
The FORMS command: request code C4H, routine 4 of SYS13/SYS.
51CD
DEFB 85H 85
The FREE command: request code 85H, routine 5 of SYS9/SYS.
51CE
DEFB B9H B9
The I command: request code B9H, routine 9 of SYS12/SYS.
51CF
DEFB A6H A6
The JOIN command: request code A6H, routine 6 of SYS11/SYS.
51D0
DEFB D4H D4
The KILL command: request code D4H, routine 4 of SYS14/SYS.
51D1
DEFB BAH BA
The LIB command: request code BAH, routine 10 of SYS12/SYS.
51D2
DEFB 95H 95
The LIST command: request code 95H, routine 5 of SYS10/SYS.
51D3
DEFB E7H E7
The LOAD command: request code E7H, routine 7 of SYS15/SYS.
51D4
DEFB BBH BB
The PAUSE command: request code BBH, routine 11 of SYS12/SYS.
51D5
DEFB D5H D5
The PROT command: request code D5H, routine 5 of SYS14/SYS.
51D6
DEFB E8H E8
The RENAME command: request code E8H, routine 8 of SYS15/SYS.
51D7
DEFB A4H A4
The RESET command: request code A4H, routine 4 of SYS11/SYS.
51D8
DEFB C5H C5
The RS232 command: request code C5H, routine 5 of SYS13/SYS.
51D9
DEFB BCH BC
The SCREEN command: request code BCH, routine 12 of SYS12/SYS.
51DA
DEFB F4H F4
The SYSTEM command: request code F4H, routine 4 of SYS16/SYS.
51DB
DEFB BDH BD
The TIME command: request code BDH, routine 13 of SYS12/SYS.
51DC
DEFB BEH BE
The VERIFY command: request code BEH, routine 14 of SYS12/SYS.

51DDH - Texts

Data: the prompt, the default extension of a command program, and the three words a file specification may be preceded by.

51DD-51E6
DEFB 0AH / DEFM "DOS PLUS" / DEFB 0DH 0A 44 4F 53 20 50 4C 55 53 0D
The prompt, displayed by DSPLY@ at 4E5FH: a line feed starts a new line, then DOS PLUS, and the carriage return ends the text and puts the cursor at the start of the next line, where the command is typed.
51E7-51E9
DEFM "CMD" 43 4D 44
The default extension of a command program: FEXT@ adds /CMD to a command name that is not a library command and has no extension (4EC2H-4EC5H).
51EA-51EB
DEFB D4H / DEFM "O" D4 4F
The word TO, with bit 7 set on the T (D4H): FSPEC@ passes over a specification that is this word (4F08H-4F0FH), so a command may read COPY A TO B.
51EC-51EF
DEFB C6H / DEFM "ROM" C6 52 4F 4D
The word FROM, with bit 7 set on the F (C6H): FSPEC@ passes over a specification that is this word (4F08H-4F0FH), so a command may read COPY A TO B.
51F0-51F4
DEFB D5H / DEFM "SING" D5 53 49 4E 47
The word USING, with bit 7 set on the U (D5H): FSPEC@ passes over a specification that is this word (4F08H-4F0FH), so a command may read COPY A TO B.
51F5
DEFB 80H 80
The end of the list of words for 4FBAH. It is the last byte of SYS1/SYS, in the fourth load block (50FAH-51F5H).