TRS-80 DOS - LS-DOS 6.3.1 for the Model 4 - Disassembled

Overview

LS-DOS 6.3.1 is the MISOSYS release (1990) of the Model 4 operating system that Logical Systems wrote as TRSDOS 6; its history is on the LS-DOS reference page. These pages disassemble the level 1H system diskette (MiM-11-043), whose name string reads LS-DOS63Level-1H. Every row is written from the bytes of the release file. The labels and many comments are those of the LS-DOS 6.3.1 Source Code Restoration Project, whose build gives these files byte for byte. DIR/SYS, the directory, has no page.

Memory Map

LS-DOS runs the Model 4 in its native mode, with no ROM in its memory map. The boot sector sends 86H to the Operation Register (port 84H), which leaves RAM from 0000H to F3FFH, the keyboard at F400H-F7FFH and the video memory at F800H-FFFFH. The system then occupies the bottom of memory:

AddressContents
0000H-01FFHRestart vectors, system flags and storage, the SVC table at 0100H-01FFH (loaded by SYS0/SYS).
0200H-12FFHDevice control blocks, the stack, system information, the drive code tables and the resident keyboard, video, printer and floppy disk drivers (BOOT/SYS, read in at boot to 0200H-11FFH; 0380H-03FFH loaded over by SYS0/SYS). The low I/O zone for added drivers starts at 0FF4H.
1300H-1DFFHThe resident system, SYSRES (SYS0/SYS).
1E00H-23FFHThe system overlay area: SYS0/SYS start-up, then SYS1/SYS to SYS5/SYS and SYS9/SYS to SYS13/SYS. The directory buffer is at 2300H.
2400H-The library overlays SYS6/SYS to SYS8/SYS, drivers and filters; utilities load at 2600H and programs at 3000H.

BOOT/SYS

Purpose:

BOOT/SYS is cylinder 0, sectors 0 to 15 of the system diskette, 4096 bytes written by FORMAT. The ROM reads sector 1 into 4300H and runs it: that boot code turns on the all RAM memory map (86H to port 84H), clears the screen, reads all of BOOT/SYS to 0200H-11FFH, sets up the video controller, finds SYS0/SYS through the GAT and its directory entry, and hands over to the loader at 0238H, which reads SYS0/SYS through the floppy driver and jumps to 1E00H.

Most of BOOT/SYS stays in memory as part of the resident system: the bank bytes and the six device control blocks at 0200H, the system information, the command line buffer and the drive code tables at 0400H, and the resident I/O code at 0500H-0FF3H: the character I/O SVCs (@DSPLY, @KEYIN, @GET, @PUT, @CTL and their relatives), @MUL16 and @DIV16, the decimal and hex conversions, the clock and cursor blink task, @BANK, the keyboard driver with its type-ahead buffer, the video driver with @VDCTL and the screen print, the printer driver and the floppy disk driver.

Disassembly:

A disassembly of BOOT/SYS can be found here.

SYS0/SYS

Purpose:

SYS0/SYS is the resident system that BOOT/SYS loads, 4343 bytes in 37 load blocks with its transfer address at 1E00H. It fills low memory (0000H-01FFH: the restart vectors, the time and date, the interrupt vectors and the twelve task slots, the 26 system flags, the system FCBs and the SVC table at 0100H), loads @PAUSE, @SOUND and @DECHEX at 0380H, puts the resident system SYSRES at 1300H-1CFFH, runs its start-up code at 1E00H and writes the sign-on screen straight into video memory.

SYSRES holds the file system's core: byte and record I/O to files, @POSN and the other positioning SVCs, the translation of a record number into a cylinder and sector through the file's extents, the allocation of space as a file grows, and the directory, GAT and HIT reads and writes. It also holds the SVC dispatcher at RST 28H, which serves SVCs 0 to 127 from the table and loads the system overlays (SYS1/SYS to SYS13/SYS) on request, the disk SVCs, @LOAD and @RUN with the load module reader, and the task processor that serves the interrupts and runs the twelve task slots on the clock interrupt. The start-up sets the ports, tests for 128K of memory, asks for the date and the time, handles the AUTO command, the D, ENTER and CLEAR keys and the SYSGEN configuration, and enters the command level.

Disassembly:

A disassembly of SYS0/SYS can be found here.

SYS1/SYS

Purpose:

SYS1/SYS is the command interpreter, a system overlay of 1265 bytes loaded at 1E00H whenever an SVC asks for it: @EXIT, @CMNDI and @CMNDR, and the parsing SVCs @FSPEC, @FEXT and @PARAM. @EXIT resets the stack, the BREAK vector, the flags and LOW$, then hands control to an Extended Command Interpreter in SYS13/SYS when EFLAG$ is set, or shows LS-DOS Ready and reads a command of up to 79 characters.

The command line is logged and bank 0 switched in; a line starting with a period is a comment, one starting with * goes to SYS13/SYS and one starting with ! is always run as a program. The name is looked up in the table of 39 library commands, which run members of SYS6/SYS, SYS7/SYS and SYS8/SYS (and BOOT, which restarts the machine); any other name gets /CMD added and is run with @RUN. @CMNDR runs a command for a program and returns to it.

@FSPEC copies a file or device specification into an FCB in capitals and passes over the prepositions TO, ON, OVER and USING; @FEXT adds a default extension; @PARAM reads a parameter list in parentheses against a table of the old or the enhanced format, with flag, decimal, hexadecimal and string values. Five bugs are listed for this file (B11 to B15), among them that a command name longer than a six letter library command whose letters it starts with (APPENDIX, SETCOMM) runs the library command.

Disassembly:

A disassembly of SYS1/SYS can be found here.

SYS2/SYS

Purpose:

SYS2/SYS is the overlay that opens files and devices, 1222 bytes loaded at 1E00H whenever an SVC asks for it: @OPEN, @INIT, @RENAME, @CKDRV and @GTDCB, and the hashes of a file name and of a password that ATTRIB, PURGE, BACKUP, FORMAT and REPAIR ask it for. A device specification (an asterisk and two letters) is found among the device control blocks at 0208H-02FFH and the FCB is routed to it.

For a file, the name and extension are hashed into one byte and looked for in the Hash Index Table of the drive given, or of drives 0 to 7 in turn. Each drive is first checked by @CKDRV, which waits for an index pulse, reads the GAT, takes the number of cylinders and sides from it and records whether the diskette uses the new style of directory dating. The owner password gives full access; otherwise the file's protection level is the access granted, and a file with protection NO ACCESS cannot be opened without the password. The open FCB gets the buffer, the drive, the directory entry, the record length and the file's extents.

@INIT creates a file that is not found, in a free directory slot, trying the middle of the directory first; a file created with a password is protected NO ACCESS. @RENAME renames a file on its own drive, or gives a device new letters (but not KI, DO, PR, SI, SO or JL). Five bugs are listed for this file (B16 to B20), among them that an extension or password starting with a digit is quietly dropped together with the drive, so REPORT/1A:1 opens or creates REPORT on whatever drive.

Disassembly:

A disassembly of SYS2/SYS can be found here.

SYS3/SYS

Purpose:

SYS3/SYS is the overlay that closes files and devices, 825 bytes loaded at 1E00H whenever an SVC asks for it: @CLOSE, and @FNAME, which turns a directory entry code into a file specification. A device FCB just gets its specification back. For a file, CLOSE first makes sure a diskette is turning in the drive (except on drive 0 of the release and on hard drives); if not, the message CLOSE FAULT asks for ENTER to try again or BREAK to give up.

The last buffer of the file is written if it was changed. A file opened with UPDATE access or better has its directory entry brought up to date: the open bit reset, the end of file copied from the FCB, and, when the file was written to, the MOD flag that BACKUP looks for and the date of the change, with the time and the full year on a diskette dated in the 6.3 style. The granules that the directory gives the file past its end are given back to the GAT one at a time, and extended directory entries left empty are given up with their slots in the Hash Index Table; a file set up with CREATE keeps its space. Last, the name, extension and drive are written into the FCB as text, which closes it.

Four bugs are listed for this file (B21 to B24). The worst, B21: CLOSE reads the directory entry before it writes the last buffer, and when that write has to go through an extended directory entry in another directory sector, CLOSE writes the wrong sector over its own, so the file and the others listed in the same directory sector are lost.

Disassembly:

A disassembly of SYS3/SYS can be found here.

SYS4/SYS

Purpose:

SYS4/SYS is the system error dictionary behind @ERROR, 1242 bytes loaded at 1E00H whenever a program or a command asks for an error message. The messages are not kept as text: each of the errors 0 to 45 is a short list of word numbers, and the words, 58 of them, sit in a dictionary where the last letter of each has bit 7 set. The message is put together a word at a time, with a capital letter in front and a space after every word; 46 to 62 all give Unknown error code, and 63, the extended error, shows the program's HL register pair in hex.

The library commands ask only for the short message. A program can have the long form instead, which adds the error number and the address of the call, the file or device the error came from, and the last SVC before the error with the address it returned to. It can also have the message put into its own buffer, have nothing shown at all, and choose whether it gets control back or is ended through @ABORT.

Six bugs are listed for this file (B25 to B30), all in the long display, which the DOS's own commands never use: the extended error loses its header line, errors 41 and 42 always name an Unknown FCB/DCB, a closed file is shown as a device with a made-up name, and two of the texts SYS4 fills in can be left wrong for the next call.

Disassembly:

A disassembly of SYS4/SYS can be found here.

SYS5/SYS

Purpose:

SYS5/SYS is the ghost debugger, 1471 bytes loaded at 1E00H whenever the debugger is entered: through a breakpoint or any RST 30H, through @DEBUG, through the BREAK key or at the start of a program once DEBUG is on, or with the D key held down at boot. It saves every register of the program in 32 bytes of low memory, shows them with the flags and the memory they point to, and shows memory in hex and ASCII, four lines under the registers or a full page.

Its commands go on with the program, with up to two breakpoints, or run it one instruction at a time, into calls or over them; change a register pair, the Program Counter included; modify memory in hex or in ASCII; move, fill and show memory; read and write a port; and read and write disk sectors with a drive, cylinder, sector, operation, address and count. Any other key is passed to the extended debugger of SYS9 when DEBUG (EXT) has installed it.

Nine bugs are listed for this file (B31 to B39): single stepping a JP (IX) puts its breakpoint at the address in IY, the breakpoint save areas share their bytes with the variables of the commands, a BREAK just after an F7H byte is taken for a breakpoint, a fill of a single byte does nothing and one up to FFFFH never ends, the display breaks up when the video's special characters are on, a bar of the memory display can land on the wrong line, a disk operation without an address reads into or writes from whatever the last number typed points at, BREAK cannot reach the debugger while a stepped call runs, and a branch to itself can never be stepped past.

Disassembly:

A disassembly of SYS5/SYS can be found here.

SYS6/SYS

Purpose:

SYS6/SYS is Library A, fourteen members that load at 2400H (one at 2C00H) when their command is typed or sent by a program: MEMORY, DIR and CAT, COPY and APPEND, LIB with CLS, ID and TOF, REMOVE, RENAME, DEVICE, ROUTE, LINK, RESET, SET and FILTER, LIST, DO, and LOAD and RUN. SYS1/SYS finds the command in its table and sends the member's request byte; SYS0/SYS reads the member headers at the front of the file to find where the member's load blocks start.

MEMORY reads and changes memory (ADD, WORD, BYTE), fills it (CLEAR), moves HIGH$ down behind a module header (HIGH), sets LOW$ (LOW) and jumps to an address (GO). Every MEMORY command then shows HIGH$ and LOW$, the 32K memory banks and whether each is in use, and a map of every module in the driver zone and in high memory, one line each, a screen at a time, with PRINT on the printer too. Four bugs are listed for it (B40 to B43): a HIGH below 10 wraps round, the bank count goes wrong for a program whose stack is in the upper 32K, the search for a module after a block without a header cannot find the drivers and filters whose names start with a dollar sign, and a header pointing below itself makes the map repeat one line for ever.

DIR and CAT show the directory of a drive, a range of drives or every drive: a title line with the diskette's name, size, free space and date, then the files that the partspec, S, I, MOD and DATE select, sorted by name unless SORT=NO, four names a line (CAT, or A=N) or one line a file with its protection, LRL, records, EOF, size, extents and date and time (A). Seven bugs are listed for it (B44 to B50): the room test before the sort can let the sort table run over high memory, a drive's title can be shown twice around a screen pause, a name with many attribute letters fills the screen with spaces, the second date of a range can accept a 29 or 30 February that does not exist, DIR (A) of several drives can count the extents of a fragmented file from another drive's directory, DIR -8 lists drive 0, and a file of 65535 records and a part shows 0 records.

COPY and APPEND copy a file or a device to a file or a device, or add one to the end of a file. A destination that is only partly given takes the missing name, extension and password from the source; two files are copied a sector at a time through all the free memory after the space is taken, with CLONE giving the copy the source's directory entry, and a device on either side is copied a byte at a time until the end of file or BREAK, with ECHO on the screen. COPY (X) copies between two diskettes in one drive, asking for each in turn and checking that the right one is in. Twelve bugs are listed for them (B51 to B62): APPEND to a write protected diskette gives the wrong message, any LRL is accepted, COPY (X) on a drive other than 0 can close the copy on the source diskette and change its directory, a destination left out before the parameters makes COPY overwrite a file of the same name on a lower drive and APPEND append a file to itself, a LOW$ lowered by a program makes the copy run over memory, a BREAK pressed while COPY (X) reads or writes hangs the next prompt, BREAK at a prompt on drive 0 skips the system diskette prompt, COPY (X) with no drive can overwrite a file on another drive, CLONE to an old style diskette puts the time where the old style keeps a password, a refused file is closed before the system diskette is back, a destination with UPDATE access gets a sector overwritten before the copy fails, and the swaps of COPY (X) do not learn the new diskette's number of sides.

LIB lists the commands of Library A, B and C from SYS1/SYS's command table, seven names a line; CLS clears the screen; TOF sends a form feed to the printer and shows Device not available when the printer is not ready; ID only shows No service contract!, since 6.3.1 has no customer service number. One bug is listed for them (B63): Library A's 21 commands fill three lines exactly, and LIB then adds a line of two spaces, so a blank line too many comes before Library B.

REMOVE deletes the files and devices named after it, one after the other, and stops at the first error. A file must be opened with a password that gives FULL or REMOVE access, and the line Removing: shows its name with the drive it was found on. A device must not be a system device and must be pointed NIL; its DCB is cleared, and any device routed to it is to be set NIL. Three bugs are listed for it (B64 to B66): a device routed to the one removed makes REMOVE hang, a device linked to it is left linked to nothing, so that the next output through it jumps to 0000H, and a full length name with an exclamation mark does not fit the buffer for the Removing: line, so the file is not removed.

RENAME gives a file a new name and extension, or a device a new name. Whatever the new name leaves out, the filename, extension, drive and password, comes from the old one, so RENAME TEST/DAT TO /OLD gives TEST/OLD; the file stays on its drive, a new name already in use gives Duplicate file name, and the line Renaming: shows both names without their passwords. A device may not be one of the six system devices and may not take a name already in use. Three bugs are listed for it (B67 to B69): a new name typed with a colon and no drive shows stray characters, or the old password, on the Renaming: line; a partial new name followed by a parenthesis, as in RENAME TEST/DAT (X), can fill memory with one letter and hang the computer; and a completed name too long for its field loses its extension.

DEVICE shows the enabled drives, the devices and the options. Each drive line gives the drive, WP for a write protected diskette, the pack name (or No Disk), the size, Floppy or Rigid, the select digit, the cylinders and, for a floppy drive, the density, sides, step rate and delay; the drives are logged on as they are shown. With B the devices follow, each with its input and output symbol and its driver address, the device it is routed or linked to, its filter, Nil, or the file it is routed to. Last come the options that are on, Fast or Slow, and the system overlays SYSTEM (SYSRES=) has made resident. Five bugs are listed for it (B70 to B74): two devices routed to each other make DEVICE (B) write through all of memory, also when the cycle runs through a NIL device, whose route DEVICE follows though the I/O does not, a filter module at an unlucky address shows a false name, a one letter device name ends its line early so that the next line runs on after it, and a PRINT value such as 256 prints only the single characters.

ROUTE sends the I/O of a device to another device or to a file, or makes it NIL, and makes a new device when the name is new. A route to a file gets an FCB and a buffer below HIGH$, 302 bytes, and the file is opened at its end unless REWIND is given; it stays open until a RESET of the device, and the device's old type and vector are kept for RESET. Four bugs are listed for it (B75 to B78): routing a device that is routed to a file to another file loses what went to the first file, whose FCB is written over before the close; with no DCB spare, a route of a new name to a file leaves the file open and the memory taken, and ROUTE (NIL) of a new name writes the name over a system pointer; and once two devices are routed to each other, any ROUTE of either of them hangs the computer.

LINK joins two devices, so that output sent to the first goes to the second as well and input asked of the first may come from the second. It takes a spare DCB as the link DCB, which keeps the first device's old type and vector and points on to the second, and names it L0, L1 and on. Two bugs are listed for it (B79 and B80): only the two names are compared, so two devices can be linked to each other, and the next character sent to them then goes round them for ever; and from the eleventh link at once the names are characters such as L: that no command can name.

RESET undoes the routes, links and filters of a device, closes a file the device is routed to and makes a device of the user's NIL; for a file it clears the open state in the directory, and its 6.3.1 parameters LRL and DATE change the record length or the date. There is no global reset. Eight bugs are listed for it (B81 to B88): RESET of a device on a cycle of routes hangs the computer; a file routed to before a LINK of the device is not closed; a link DCB is cleared even when another device still leads to it; LRL and DATE=ON together lose the LRL; a device routed, linked and routed again ends with no driver at all; RESET of a link DCB or of an active filter's DCB cuts off the device behind it; a file closed by ROUTE (NIL) is closed a second time; and two filters on one DCB hang FIXDCB.

SET loads a driver or filter program for a device and enters it with the device's DCB, after making the DCB a NIL device of that name; it tries the file with /FLT first and then with /DVR, and sets only a new device or a NIL device of the user's, so a device already in use, or a system device, is refused. FILTER puts an installed filter in front of a device by swapping the first three bytes of the two DCBs. Six bugs are listed for them (B89, B90 and B93 to B96): the two refusal messages of FILTER are swapped; a failed second load returns the error number with C0H added; SET refuses while HIGH$ is frozen even for a program that would fit in low memory; SET can reuse the DCB of a filter in use, or drop the link or filter bit of a NIL device, and FILTER can put two unused filters in front of each other, which makes the next character sent there loop for ever.

LIST shows a file on the video or prints it, as text with optional line numbers, tab expansion and a starting line, or in hex with the bytes and their characters on one line, record by record. In 6.3.1 the display pauses after each page (23 lines of text, or 17 lines of hex: one 256 byte record and a blank line); ENTER goes on, C goes on without pausing, BREAK stops, and NS or P turn the pause off. Five bugs are listed for it (B91, B92 and B97 to B99): LINE=0 skips the whole file and ends with End of file encountered; a hex listing of a file that ends on the end of a hex line shows one more empty heading; a byte 8DH starts a new screen line without starting a new numbered line; the closing carriage return can stop at one more page pause; and past record 9999H the hex headings gain a stray leading digit.

DO runs a Job Control Language file. It compiles the file into SYSTEM/JCL, on the first drive that is ready and not write protected, replacing each #token# with the value given on the DO line or by //ASSIGN, keeping or dropping blocks by //IF, //ELSE and //END, reading in other files with //INCLUDE (five deep) and starting at an @LABEL when one is given; then SYS11/SYS runs SYSTEM/JCL line by line. DO = runs a file without the compile, DO $ compiles only, and DO * runs the last SYSTEM/JCL again. Fourteen bugs are listed for it (B105 to B118): DO * can run an older SYSTEM/JCL from a write protected drive 0 instead of the one just compiled; a continuation line of 79 characters writes over the first byte of the drive table; text after a false //IF term aborts while after a true one it is ignored; //IF nesting, the compiled line's length and the symbol table have no limit; the rest of a value after a dropped character or a substitution is lost, and an unknown token inside a value can blank the label; a number sign right after a substitution in a value, or a closing parenthesis on the DO line, is read twice; an at sign or an unclosed quote anywhere upsets the fields that follow; some characters that are not hex digits pass as hex; //ASSIGN takes an empty value; and an error or //QUIT leaves a part of the compile in SYSTEM/JCL for a later DO *.

RUN loads a program and starts it, LOAD only loads it; both take /CMD as the default extension and, with X, ask for the diskette that holds the program and then for the system diskette again. Five bugs are listed for them (B100 to B104): a load error is returned with C0H added; BREAK at the Insert SYSTEM disk prompt is taken as ENTER and leaves the cursor off; a program started by RUN (X) gets neither the command buffer pointer in BC nor the debugger that RUN without X gives it; LOAD (X) loads a file of EXEC protection into memory where it can be read; and BREAK at the Insert SOURCE disk prompt leaves the source diskette where the system must read SYS1.

With DO the page is complete: all fourteen members of SYS6/SYS, 13219 loaded bytes in 6241 rows, are disassembled, and the file's 79 bugs, B40 to B118, are listed on the reference page.

Disassembly:

A disassembly of SYS6/SYS can be found here.

SYS7/SYS

Purpose:

SYS7/SYS is Library B, nine members that load at 2400H when their command is typed or sent by a program: FREE, DATE and TIME, DEBUG and VERIFY, ATTRIB, PURGE, DUMP, CREATE, AUTO and BUILD. As with SYS6/SYS, SYS1/SYS finds the command in its table and sends the member's request byte, and SYS0/SYS reads the member headers at the front of the file to find where the member's load blocks start.

FREE shows, for every enabled drive or for one, a line with the disk name and date, the free and total space in K and the free and possible files, read from the GAT and the HIT; for one drive it adds a map of the granules, eight cylinders to a line, and a footer with the media. P sends it all to the printer too. Four entries are listed (B146, B147, B150, B151): a drive with more than eight granules to a cylinder, which no driver of the release sets up, would be given a wrong size and have its map written past the line; the wait after the footer can come twice, even under DO; and the first map line is always labelled 0 to 7.

DATE and TIME show or set the date and the time. DATE takes the years 1980 to 2011 (00 to 11 for 2000 to 2011, the 6.3.1 change) and works out the day of the week and of the year each time it runs; TIME with CLOCK switches the clock display at the top right of the screen. Six entries are listed (B142 to B145, B148, B149): DATE leaves February's length for the clock's midnight roll-over as the start-up set it and keeps two old bits of the day of the year and the leap year flag, TIME refuses a time without seconds when anything follows it and ignores a time typed after the parameters, CLOCK=OFF can let the clock be drawn once, and no date after 2011 can be set.

DEBUG switches the debugger on or off by the DEBUG flag and the debugger hook, and with EXT has SYS9/SYS put the extended debugger in high memory, or takes it out again when it is the lowest module there; it also keeps the video driver's special character setting aside while the debugger is on. VERIFY points the write SVC at the routine that reads each sector back. Two bugs are listed for them (B119, B120): ON=N still switches on, and a second DEBUG or a DEBUG (OFF) on its own loses the special character setting.

ATTRIB changes a file's protection level, visibility and owner password, or, for a drive, the disk name and master password, and with LOCK or UNLOCK puts the master password on every ordinary file with no password or takes it off again. Eight entries are listed for it (B152 to B156, B162 to B164): PROT=REMOVE gives READ, a HIT that cannot be read during LOCK or UNLOCK is reported with a wrong message, inside a DO file a needed prompt is reported as Invalid master password, a write protected diskette gives GAT write error, ATTRIB(LOCK) with no space is refused, the new name reaches the boot sector even when the rest of the command fails, ATTRIB:1 changes drive 0, and UNLOCK with PW looks for the new master password. Running it also showed B165, a SYS1/SYS bug: any space inside a parameter list is Parameter error, so the manual's examples must be typed without the spaces after their commas.

PURGE removes many files of a drive at once, those matching a partspec with the wild card $ or, after a minus sign, those that do not, within a range of dates, normally after asking about each one; BOOT/SYS and DIR/SYS are never touched. Six entries are listed for it (B157 to B161, B166): February grows with each leap year date of a range, a year from 12 to 79 is taken as 1980, an old style diskette's year modulo 8 is compared with the full year, an undated file on a new style diskette can count as one of 1982, the line of the question can run one byte past its buffer, and an asterisk puts a single $ in the partspec, both to no effect.

DUMP writes a block of memory from 3000H up into a file, as a load module (extension LMF) with a name record, load blocks of up to 254 bytes and a transfer record, or with ASCII as the bytes alone (extension TXT). Five bugs are listed for it (B131 to B135): an ASCII dump gets no ETX byte unless ETX is given, ETX=OFF still writes 03H, ASCII=256 gives a TXT file holding a load module, an existing file of another record length is refused, and a dumped program with no TRA ends with a return code that is not zero.

CREATE makes a file of a given number of records or K, or enlarges an existing one, by writing its last record, marks it CREATED so that closing keeps the space, optionally fills it, and puts the end of file back where it was. Four entries are listed for it (B123 to B126): SIZE wraps round above 16383K, FILL=N fills with zeros, a device spec is taken as a file, and FILL writes over the records an existing file already had.

AUTO writes, shows (?) or runs (=) the command kept in sector 2 of a diskette's boot track, which the system runs at start-up. Two bugs are listed for it (B121, B122): the character after a drive number is skipped whatever it is, and AUTO = run through @CMNDR returns into code that a library command has loaded over it.

BUILD makes a file from lines typed at the keyboard, kept in memory and written when the input ends: plain text with a carriage return after each line, the lines of a KSM file prompted A to Z, or with HEX bytes typed as pairs of hex digits. Six entries are listed for it (B136 to B141): a device spec is taken for an existing file, an empty line in a HEX build ends it with nothing written, the text has no memory limit, some signs and the letters W to Z pass as hex digits, an existing file of another record length gives error 42, and a dead test that would upset the stack.

Disassembly:

A disassembly of SYS7/SYS can be found here.

SYS8/SYS

Purpose:

SYS8/SYS is Library C, six members that load at 2400H when their command is typed or sent by a program: SYSTEM, SYSGEN, FORMS, SETCOM, SETKI and SPOOL. As with SYS6/SYS and SYS7/SYS, SYS1/SYS finds the command in its table and sends the member's request byte, and SYS0/SYS reads the member headers at the front of the file to find where the member's load blocks start. SETKI's member is followed in the file by the patch record SETKI1, the fix of 6.3.1 Level 1C.

SYSTEM sets the options of the running system and of the system information sector of drive 0: the processor clock, TRACE, the 12 or 24 hour times of DIR, BREAK, the printer time-out, the date and time prompts and the boot step rate, the cursor, type-ahead, SMOOTH, the mains frequency, the graphics printer, the ALIVE indicator, overlays kept in high memory (SYSRES, with a handler of its own hooked into the SVC dispatcher), the drive tables (write protection, cylinders, step rate, delay, CKDRV, enabling and disabling), a drive driver program, and, new in 6.3.1, the exchange of two drives with SWAP. Ten entries are listed (B172 to B181): SLOW given a number can stop the clock, ALIVE can be installed twice, CYL on an 8 inch drive tests the drive the wrong way, STEP on a hard drive skips DELAY and CKDRV, BREAK at the DRIVER prompt neither restores the drive's driver nor does more than drive 0, a swap of two drives other than 0 loses one CKDRV setting, an unreadable directory sector is not noticed when a system diskette is checked, a failed DRIVER load returns the wrong error code, and a DRIVE value from FF00H up can crash the system.

SYSGEN writes the state of the system into CONFIG/SYS, a load module that SYS0/SYS loads at every start-up: the drivers added in low memory, the modules in high memory, the device control blocks and a table of system areas (flags, tasks, VERIFY, the key repeat, the cursor, the extra SVCs), and the drive tables; it marks sector 2 of the diskette and makes the file invisible with ATTRIB. SYSGEN (OFF) switches the configuration off and removes the file. Three entries are listed (B169 to B171): a program that runs SYSGEN through @CMNDR never gets control back after a build, one table entry saves other bytes than its source comment says, and a rebuild that fails part way leaves a mixed CONFIG/SYS that is still loaded at the next start-up.

FORMS shows or changes the settings of the forms filter FORMS/FLT, which it finds in memory by its module name: page length, lines printed, characters to a line, margin, indent, line feeds after a carriage return, real form feeds, tab expansion and a one byte translation, with DEFAULT and QUERY. Eight entries are listed (B182 to B189): QUERY=NO and DEFAULT=NO act as if ON, a page length below the lines in force is refused, no margin can be set while the line length is off, a margin that leaves no room for the indent ends in Parameter error, a line length shorter than margin and indent is taken and then hangs the filter, a refused answer to QUERY can still be installed, a shorter page in the middle of a page feeds about 250 lines, and with QUERY the switches given on the line are installed behind prompts that show the old setting.

SETCOM shows or changes the settings of the serial driver COM/DVR: baud rate, word length, stop bits, parity, the BREAK character, DTR and RTS, and the line conditions RI, DSR, CD and CTS that the driver waits for before it sends, with DEFAULT and QUERY, and then has the driver set the UART. Five entries are listed (B190 to B194): BREAK=OFF leaves a BREAK character in place, a refused command can leave a new baud rate in the driver that the UART never gets, the Parity prompt refuses EVEN and ODD, three of the QUERY answers are checked only at the end, and a quoted parity answer is read back after later answers have overwritten it.

SETKI shows or sets the delay before a held key repeats and the rate of the repeat, two bytes of the keyboard driver, with WAIT, RATE, DEFAULT and QUERY. The release's member needed the patch SETKI1 to read the answers to QUERY at all. Two entries are listed (B167, B168): a command that fails can still change a value, and an answer of 0 or 256 to QUERY is taken for ENTER.

Disassembly:

The disassembly of SYS8/SYS is in progress (so far members 1 (SYSTEM), 2 (SYSGEN), 3 (FORMS), 4 (SETCOM) and 5 (SETKI), of its 6 members); what is done can be found here.

SYS9/SYS

Purpose:

From the manual: the extended debugging commands available after DEBUG (EXT).

Disassembly:

The disassembly of SYS9/SYS is in progress.

SYS10/SYS

Purpose:

From the manual: deletes a file.

Disassembly:

The disassembly of SYS10/SYS is in progress.

SYS11/SYS

Purpose:

From the manual: the execution phase of the Job Control Language.

Disassembly:

The disassembly of SYS11/SYS is in progress.

SYS12/SYS

Purpose:

From the manual: the @DODIR and @RAMDIR directory vectors.

Disassembly:

The disassembly of SYS12/SYS is in progress.

SYS13/SYS

Purpose:

From the manual: a base for copying an Immediate Execution Program (IEP), run by typing * and ENTER at DOS Ready.

Disassembly:

The disassembly of SYS13/SYS is in progress.

BASIC/CMD

Purpose:

Disk BASIC for the Model 4.

Disassembly:

The disassembly of BASIC/CMD is in progress.

BASIC/OV1

Purpose:

An overlay of BASIC/CMD, loaded at 2600H.

Disassembly:

The disassembly of BASIC/OV1 is in progress.

BASIC/OV2

Purpose:

An overlay of BASIC/CMD, stored with no load records.

Disassembly:

The disassembly of BASIC/OV2 is in progress.

BACKUP/CMD

Purpose:

Copies diskettes: mirror image backups, backup by class, backup reconstruct.

Disassembly:

The disassembly of BACKUP/CMD is in progress.

BREF/CMD

Purpose:

A cross reference of the variables and line numbers of a BASIC program.

Disassembly:

The disassembly of BREF/CMD is in progress.

COMM/CMD

Purpose:

The communications (terminal) program.

Disassembly:

The disassembly of COMM/CMD is in progress.

CONV/CMD

Purpose:

Copies files from a Model III version 5 diskette.

Disassembly:

The disassembly of CONV/CMD is in progress.

DATECONV/CMD

Purpose:

Converts the directory dates of a pre-6.3 diskette to the 6.3 form.

Disassembly:

The disassembly of DATECONV/CMD is in progress.

DISKCOPY/CMD

Purpose:

Formats and copies a diskette in one pass.

Disassembly:

The disassembly of DISKCOPY/CMD is in progress.

FORMAT/CMD

Purpose:

Formats a diskette.

Disassembly:

The disassembly of FORMAT/CMD is in progress.

HELP/CMD

Purpose:

Shows the help screens kept in DOS/HLP.

Disassembly:

The disassembly of HELP/CMD is in progress.

LOG/CMD

Purpose:

Logs in a diskette after it has been changed in a drive.

Disassembly:

The disassembly of LOG/CMD is in progress.

PATCH/CMD

Purpose:

Applies patches to program and system files.

Disassembly:

The disassembly of PATCH/CMD is in progress.

REPAIR/CMD

Purpose:

Brings the directory information of a diskette in line with what the DOS expects.

Disassembly:

The disassembly of REPAIR/CMD is in progress.

TAPE100/CMD

Purpose:

Moves files to and from cassette in the format of the TRS-80 Model 100.

Disassembly:

The disassembly of TAPE100/CMD is in progress.

TED/CMD

Purpose:

The full-screen text editor.

Disassembly:

The disassembly of TED/CMD is in progress.

COM/DVR

Purpose:

The RS-232 serial driver.

Disassembly:

The disassembly of COM/DVR is in progress.

CLICK/FLT

Purpose:

The keyboard click filter.

Disassembly:

The disassembly of CLICK/FLT is in progress.

FORMS/FLT

Purpose:

The printer forms filter.

Disassembly:

The disassembly of FORMS/FLT is in progress.

KSM/FLT

Purpose:

The KeyStroke Multiply filter: a phrase for each ALPHA key.

Disassembly:

The disassembly of KSM/FLT is in progress.

FLOPPY/DCT

Purpose:

The floppy disk driver for added drives.

Disassembly:

The disassembly of FLOPPY/DCT is in progress.

MEMDISK/DCT

Purpose:

The memory disk driver.

Disassembly:

The disassembly of MEMDISK/DCT is in progress.