DOSPLUS 3.5 for the Model I - HELP/CMD Disassembled
Page Customization
Page Index
HELP/CMD
Other Navigation
Introduction/Summary
DOSPLUS 3.5 HELP/CMD Disassembly - The Syntax Help of the Commands (Model I)
HELP/CMD shows the syntax and the parameters of a DOSPLUS 3.5 library command or utility, run from the DOS command level as HELP [FROM] command [TO] fs/@ds. It is a load module of 9 blocks, 1809 bytes, at 5200H-5906H and 5A2AH-5A33H with the transfer address 5200H, after the two comment records (the name HELP and the copyright notice). The code (5200H-534FH) and the dictionary (5350H-5505H) are the same in both models apart from addresses; the Model III texts show the optional parts in [ ] where the Model I has < >, and are 8 bytes longer, so every address after them is 8 higher on the Model III, as is LOCDCB% (4488H on the Model I, 44A0H on the Model III). This page is the Model I one.
The Parts of HELP/CMD
| Address | Contents |
|---|---|
| 5200H-5231H | EVAL@ and the output: @DO, a device, or a file opened by INIT@ (5200H). |
| 5232H-525CH | The name compared with the words of the dictionary (5232H). |
| 525DH-5288H | The text of a command (525DH). |
| 5289H-530EH | Routines: a byte of a text, a character and a tab, the column count, the output, the close of a file, a line (5289H, 52B5H, 52D1H, 52E8H, 52F2H, 5301H). |
| 530FH-534FH | The list of the commands, and an error (530FH, 534BH). |
| 5350H-5505H | The dictionary of 89 words (5350H). |
| 5506H-58BDH | The 49 texts (5506H). |
| 58BEH-5A33H | The heading of the list, the variables and the evaluation block ([58BEHH], [5A2AHH]). |
How HELP Works
EVAL@ puts the first field of the command line into the source block (58E6H) and a second field, or the field after TO, into the destination block (5909H); the evaluation block names the same block for the wildmask, so a field with a wildcard is taken as the output too, and its parameter block is empty. With no destination the output is device 1, @DO (520FH). A destination with a name is opened as a file by INIT@, with the text of the field as its file control block and a buffer of 256 bytes (5221H); any other destination is taken by the number in bits 0-2 of its flag byte and LOCDCB%% (522BH), so that a drive :d as the destination sends the output to the device numbered d (:2 is @PR). Every character goes out through the ROM's 001BH (52E8H), and a file is closed when HELP ends (52F2H).
The name is compared with the first 49 words of the dictionary (5232H). A word matches only when the name ends, with its 03H, where the word ends: HELP takes no abbreviations, and a name with an extension or a drive matches nothing. A match shows the text of the same number (525DH); no match, or no name, shows the heading HELP is available for the following: and the 49 words, five to a row in columns of 12 (530FH). Word 39 is a carriage return: it ends the row of SCREEN, SYSTEM, TIME and VERIFY, and the tab and the end of the row after it make a line of 12 spaces before the nine utilities.
The texts are tokenized: a byte of 80H and up is a word of the dictionary, numbered by its bits 0-6 (5289H), so that the names of the commands, the keywords FROM, TO and USING, the kinds of field (fs, @ds, :dr, wildmask) and value (=switch, ='string', =value) and the names of the common parameters are each stored once. A tab moves to the next multiple of 15 columns in a text and of 12 in the list; the width is stored into the SUB at 52C0H (525EH, 5310H), and the column is counted by 52D1H.
Differences from the Manual
The manual (Utilities, HELP) gives the syntax and the list of the commands and utilities, the example HELP COPY and the output to a device (HELP ATTRIB TO @PR), and HELP agrees with it. The manual does not say that the name must be given in full, that the output may also be a file, or that a drive given as the output is taken as a device number. The texts themselves differ from the commands in one place: the text of FORMAT gives SIZE=value, a parameter FORMAT/CMD does not have; its count of sides is SIDES (5B61H), and EVAL@ does not take SIZE as an abbreviation of it.
The Model I list and texts name seven utilities that are not on the Model I master: CONVERT, DIRCHECK, DISKDUMP, MAP, PATCH, RESTORE and SYSGEN; only BACKUP and FORMAT of the nine are there. The Model I texts also differ from the Model III ones in three places: CONFIG lists HC=value for a rigid drive, CREATE gives DATA=switch, and SYSTEM has no MODE and PORT.
Variables
HELP/CMD Variables
| Address Size | Contents |
|---|---|
| 58E5H 1 byte | Column The column count of the output, 00H at the start of a line (52E4H). |
| 58E6H-5906H 33 bytes | Source block The flag byte and the text of the name asked about (5232H). |
| 5907H-5908H 2 bytes | Output The address of the DCB or of the file control block (522EH). |
| 5909H-5929H 33 bytes | Destination block The flag byte, and the text that is the file control block of an output file (5213H). |
| 592AH-5A29H 256 bytes | Buffer The buffer of an output file (521CH). |
| 52C1H 1 byte | Tab width The operand of the SUB at 52C0H: 0FH for a text, 0CH for the list (5260H, 5312H). |
Outside Routines
| Address | Contents |
|---|---|
| 4479H | SYS0/SYS: EVAL@ (5204H). |
| 4420H | SYS0/SYS: INIT@ (5221H). |
| 4488H | SYS0/SYS: LOCDCB%% (522BH). |
| 4428H | SYS0/SYS: CLOSE@ (52FAH). |
| 4409H | SYS0/SYS: ERROR@ (52FDH, 534DH). |
| 001BH | ROM: send a character to a device or a file (52EDH). |
Disassembly
5200H - HELP
HELP/CMD's transfer address, entered from the DOS command level with Register Pair HL at the command line after the word HELP: HELP [FROM] command [TO] fs/@ds. EVAL@ takes the name asked about into the source block at 58E6H and an output file or device into the block at 5909H. HELP compares the name with the first 49 words of its dictionary (5350H): a match shows the text of that command, any other name, or none, shows the list of the 48 commands and utilities HELP knows. The output goes to @DO, or to the device or the file given, and a file is closed at the end. HELP returns to the DOS by RET, or leaves through ERROR@.
5232H - Look Up the Name
The name in the source block is compared with the words of the dictionary, the first character of each without its bit 7; a word matches when the name ends (03H) where the word does. Register B counts the words from 1; at 32H (50) the 49 words with a text have all failed.
525DH - Show the Text of a Command
Reached with Register B = the number of the word that matched, 1 (APPEND) to 49 (SYSGEN). The text of that number, counted from 5506H, is shown after a carriage return, with its tabs at every 15 columns; a carriage return ends the last line when it is not empty, and an output file is closed.
5289H - Show a Byte of a Text
Register Pair HL points to a byte of a text: below 80H a character (09H a tab, 0DH a carriage return), 80H and above the word of the dictionary numbered by its bits 0-6. Entered at 528AH with the byte in Register A by the list (530FH). Register Pair HL returns at the next byte, and the Z FLAG when that byte is 03H, the end of the text.
52B5H - Send a Character
Sends the character in Register A: a tab (09H) as spaces up to the next multiple of the tab width at 52C1H, any other character through 52D1H, which counts the columns.
52D1H - Count the Columns
Sends the character in Register A and keeps the column count at 58E5H: 00H after a carriage return, one more after any other character.
52E8H - Send to the Output
Sends the character in Register A through the ROM's 001BH to the DCB or the file control block whose address is at 5907H.
52F2H - Close a File
Closes the output when it is a file: the first byte of the file control block is 80H while the file is open (INIT@ at 5221H); a DCB starts with its type byte.
5301H - Send a Line
Sends the bytes at Register Pair HL through 52E8H, without the column count, up to a 03H (not sent) or a carriage return (sent); Register Pair HL returns past the carriage return.
530FH - The List of Commands
Reached when the name matched none of the 49 words, or when no name was given: shows the heading HELP is available for the following: and the first 49 words of the dictionary, five to a row, each followed by a tab to the next column of 12. Word 39 is a carriage return: it ends the row of the last library commands, and the tab after it and the end of its row make a line of 12 spaces before the nine utilities.
534BH - Post an Error
An error of EVAL@ or INIT@ is posted with bit 6 set, so ERROR@ shows the message without its frame; bit 7 is clear, so ERROR@ ends through ABORT@.
5350H - The Dictionary
89 words, the first character of each with bit 7 set, ended by the byte 80H at 5505H; a text names word n by the byte 80H + n (5293H). Words 0-48 have a text each and make the list: the 39 library commands (0-38), a carriage return (39) and the nine utilities (40-48). Words 49-88 are the parts of the syntax lines: the keywords FROM, TO and USING, the kinds of fields and values, and names of parameters.
5506H - The Texts
49 texts, one for each of words 0-48, each ended by 03H; text n is found by passing n - 1 bytes 03H from 5506H (526BH). A byte below 80H is a character (09H a tab to the next column of 15, 0DH a carriage return), a byte of 80H and up a word of the dictionary. Each row below is one line of the screen; its comment gives the line as HELP shows it, (tab) for a tab. Text 40, that of the carriage return of word 39, is empty, and no name can reach it.
58BEH - The Heading and the Variables
The heading of the list, the column count, the source block of EVAL@ (loaded as 00H) and, not loaded, the address of the output, the destination block, which is also the wildmask block and the file control block of an output file, and the buffer of the file.
5A2AH - The Evaluation Block
The block EVAL@ works with (5200H): the flags, the addresses of the source, destination and wildmask blocks, and of the parameter block, which is empty: HELP has no parameters.