TRSDOS 6.2 for the Model 4 - SYS13/SYS Disassembled
Page Customization
Page Index
SYS13/SYS
Other Navigation
Introduction/Summary
TRSDOS 6.2 SYS13/SYS Disassembly (Model 4)
SYS13/SYS is the overlay that TRSDOS 6.2 keeps for an Extended Command Interpreter (ECI), a command interpreter of the user's own that would stand in for the TRSDOS Ready prompt, and for commands that start with an asterisk. The release diskette's SYS13 holds no interpreter, only two messages that say so. It is a load module of 700 bytes, 651 of them loaded at 1E00H-208AH, with its transfer address at 1E00H; 532 of the 651 are zero bytes kept as room for a program. Unlike SYS1-SYS5 and SYS9-SYS12, the other overlays that run at 1E00H, it has no length word at 23FEH-23FFH, which SYSTEM (SYSRES) reads to copy an overlay below HIGH$. SYSTEM refuses SYSRES=13 before that, by the number alone (Can't SYSRES requested module, as for 14).
The command interpreter of SYS1/SYS sends SYS13 two kinds of request through RST 28H. Before it shows TRSDOS Ready, CMDCONT tests EFLAG$ (006EH): when it is not zero, the request is EFLAG$ OR 8FH, SYS13 with the function in bits 6-4 of EFLAG$ (1E8EH). A command line whose first character is an asterisk is sent as request FFH, function 7, with Register Pair HL just after the asterisk and Register Pair BC at the line (1ED4H). Function 7 shows No command <*> present, as SYS13 (1E38H), and does not clear EFLAG$, so an EFLAG$ with bits 6-4 = 111 (70H-7FH, F0H-FFH) asks for function 7 at every return to the command level and the system loops (T31); every other function, function 0 included, shows No Extended Command Interpreter Present, as SYS13 and clears EFLAG$, so that the next command line is read as usual (1E29H). Both messages go to the screen and the job log through @LOGOT and end with a line feed and a carriage return, so an empty line follows each (and TRSDOS Ready's own line feed adds a second).
RST28 drops the return address of the RST, so SYS13's RET goes to whatever is under SYS1's entry: @EXIT, pushed by CLEANUP, for a typed line or a line of a DO job. For @CMNDR it is the caller's return address: the program gets Register Pair HL = 1E74H, Register A = 00H and Z. In a DO job @EXIT goes on to SYS11's NEWEXIT (1B0CH = ADH). The ECI request never comes while a DO job runs: SYS11 feeds the lines through @CMNDI and @EXIT reaches NEWEXIT, so CMDCONT is first reached after Job done.
The bytes are those of the TRSDOS 6.2.1 Level AR system diskette. The labels are those of Logical Systems' own source of the system, whose SYS13/ASM is headed LDOS 6.2 and dated 23 September 1983: aligned against this file it accounts for all 651 loaded bytes with no instruction unexplained. Two of its bytes are a patch later than that source, and both are in the messages: the source spells the word Interpretor and ends each line with an exclamation mark, where this release spells it Interpreter and ends with a space. Level AH still carries the source's spelling, so the correction was made for Level AN.
This file is the same program in LS-DOS 6.3.1H. Laid into memory through their own load records the two releases' SYS13/SYS images are identical to the byte, all 651 of them, and all 620 instructions stand at the same address doing the same thing. The two files differ in twenty bytes and nowhere else: the copyright record at file offset 0008H, which is never loaded, reads *(C) 1982,83,84 by LSI* here and (C) 1982-4,6,90 MISOSYS in the later release. So the LS-DOS 6.3.1 SYS13/SYS page is this same disassembly under the later name, and the two bugs below are those two bugs one generation earlier.
Notes
To use SYS13 a program of the user's own would be put into it (the 32 bytes of slack after the first JR, then the 500 at the end, and the overlay area up to 22FFH; 2300H-23FFH is DIRBUF$, which a GAT read writes over) and EFLAG$ set to a non zero value. The interpreter receives EFLAG$ OR 8FH in Register A with Register Pairs HL and BC = 0420H; function 7 is the same request FFH as an asterisk line, which comes with Register Pair HL = 0421H. Nothing in TRSDOS 6.2 sets EFLAG$.
There are no hidden instructions and no operands written while SYS13 runs. The asterisk of the command line is not looked at again; Register Pairs HL and BC as SYS1 sends them are not used.
Bugs (listed on the TRSDOS 6.2 reference page): T30, SYS13 returns with Register Pair HL = the address of its message (@LOGOT keeps it), and @EXIT and @CMNDR pass Register Pair HL on as the return code. Typed at TRSDOS Ready nothing follows from it, as SYS1 ignores the code; in a DO job SYS11 aborts the job on a code that is not zero, so a line starting with an asterisk shows No command <*> present, as SYS13, then Job aborted, and the rest of the job is not run, as for a command that is not found; a program that runs such a line with @CMNDR gets Register Pair HL = 1E74H with Register A = 00H and Z (1E3FH). T31, an EFLAG$ of 70H-7FH or F0H-FFH makes CMDCONT send function 7, which shows its message without clearing EFLAG$: the message repeats without end, SYS1 and SYS13 are read from drive 0 on every pass, and only a reset ends it (1E3FH).
Variables
Memory Used by SYS13/SYS
| Address Size | Contents |
|---|---|
| 006EH 1 byte | EFLAG$ The ECI flag, cleared by every request but function 7 (1E2CH); SYS1 tests it before each TRSDOS Ready. |
| 1E02H-1E21H 32 bytes | Slack Zero bytes after the first JR, room for a program. |
| 1E97H-208AH 500 bytes | More slack Zero bytes at the end of the file, room for a program. |
Routines of Other Files Called
| Address | Routine |
|---|---|
| RST 28H, SVC 101 | @FLAGS (SYS0/SYS): Index Register IY to FLGTAB$ 006AH (1E2BH). |
| RST 28H, SVC 12 | @LOGOT (BOOT/SYS, 0500H): shows a line on the screen and writes it to the job log (1E35H, 1E3DH). |
Disassembly
1E00H - SYS13: the Extended Command Interpreter and the Asterisk Command
SYS13 is the place for an Extended Command Interpreter (ECI) of the user's own, and for a command that starts with an asterisk. SYS1/SYS's interpreter sends it two kinds of request through RST 28H. When EFLAG$ (006EH) is not zero, CMDCONT (1E8EH on the SYS1/SYS page) sends EFLAG$ OR 8FH instead of showing TRSDOS Ready, so the function in bits 6-4 is the user's own code. A command line that starts with an asterisk sends FFH, function 7 (1ED4H on the SYS1/SYS page), with Register Pair HL just after the asterisk. The release SYS13 holds no interpreter: function 7 shows the No command message and leaves EFLAG$ as it is (T31), any other function shows No Extended Command Interpreter Present and clears EFLAG$, so the next command line is read as usual. Each message goes to the screen and the job log by @LOGOT. SYS13's RET goes, through RST28 at 1A77H, to the address that was on the stack when SYS1 issued its RST 28H: @EXIT (1B0BH, pushed by CLEANUP) for a typed line or a line of a DO job, the program for @CMNDR. Register Pair HL then holds 1E40H or 1E74H, the address of the message, which @LOGOT returns unchanged (T30). The 32 bytes after the first JR and the 500 at the end are zeros kept as room for a program; SYS13 has no length word at 23FEH-23FFH; SYSTEM refuses SYSRES=13 anyway, by its number test (SYS8 2805H: 13 and up, like 0 and 6-8, give Can't SYSRES requested module).