TRS-80 DOS - VTOS v4.0.2 for the Model I - SYS6/SYS Disassembled
Page Customization
Page Index
SYS6/SYS - Library Command Overlay
Disassembly
Other Navigation
Introduction:
VTOS 4.0 SYS6/SYS - Library Command Overlay (Model I)
SYS6/SYS holds the library commands of VTOS 4.0: ALLOC, APPEND, ATTRIB, AUTO, BUILD, CHAIN, CLOCK, COPY, DATE, DEBUG, DEVICE, DIR, DUMP, FILTER, FREE, KILL, LIB, LINK, LIST, LOAD, MEMORY, PRINT, PROT, PURGE, RENAME, RESET, ROUTE, RUN, SET, SPOOL, SYSTEM, TIME, TRACE, VERIFY and XFER, plus SYSGEN (run by SYSTEM (SYSGEN)) and O!, which displays the copyright notice. SYS1 finds the command in its command table (4EADH) and calls SYS6 with RST 28H, A = 88H and Register B = the command's ISAM number (SYS1 4EA2H).
SYS6/SYS is a partitioned data set (PDS): a directory of 37 ISAM entries, each giving an ISAM number, an entry (transfer) address and a triad pointer to the member that holds the code, followed by the 29 members. Only the member for the command is loaded. Every member loads at 5200H, except SET/FILTER, which loads at 5A00H, and each command is entered at its own address, so one member can serve several commands:
- DATE (15H, 5200H) and TIME (16H, 522DH)
- DEBUG (14H, 5200H), CLOCK (17H, 5241H), TRACE (1AH, 5257H) and VERIFY (1BH, 5267H)
- APPEND (31H, 5200H) and COPY (32H, 5270H)
- LIST (41H, 5200H) and PRINT (42H, 5206H)
- SET (65H, 5A01H) and FILTER (66H, 5A00H)
- LOAD (81H, 5200H) and RUN (82H, 520DH)
- SPOOL (A2H) is entered at 5208H.
The sections below follow the order of the members in the file. Each gives the member's offset in the file, what it loads, and its code. Bytes that belong to a member's work areas but are not loaded from the file (FCBs, buffers, gaps between load blocks) are shown as DEFS rows without bytes.
About this disassembly
This page was rebuilt on 2026-09-25 from a byte-accurate listing of the 29 members of SYS6/SYS. Every row's bytes come from that listing, every loaded byte is on exactly one row, and the comments were written from the code. Branches to other VTOS modules link to the VTOS SYS0, SYS1 and SYS2 pages; calls into the ROM link to the Model I ROM (version 1.3) page.
Things worth knowing that the code shows:
- The SYSTEM option shown by earlier versions of this page as SLOWER is named LOWER in the parameter table (56B9H). It installs a display driver that goes straight to the ROM display routines.
- DATE accepts only years 80-87, and MEMORY only a value above 5200H and not above the current top of memory.
- ATTRIB: giving PROT also makes an invisible file visible, unless I is given as well.
- PROT pads a typed password one byte too far (5608H); PURGE, which has the same routine, does not.
- DUMP's output routine executes RST 30H (the DEBUG entry) when a write fails, before reporting the error.
- Several members contain code that nothing jumps to (for example PROT 520DH-5218H and XFER 52F0H-530DH); it is marked where it occurs.
How the SYS6 File Is Processed into ISAM Entries and PDS Members
SYS6/SYS is a Partitioned Data Set (PDS). The raw sys6.hex is not a flat binary — it is a structured container that begins with identification records, followed by a directory of commands (ISAM entries), and then the actual code for each command (the PDS members).
Here are the very first bytes from sys6.hex (shown exactly as they appear, grouped for readability):
05 06 53 59 53 36 20 20
1F 91 0D 2A 20 2A 20 2A 20 4E 20 4F 20 54 20 49 20 43 20 45 20 2A 20 2A 20 2A 0D ...
08 06 11 00 52 01 00 C9
08 06 15 00 52 02 00 1D
08 06 16 2D 52 02 00 1D
08 06 13 00 52 02 00 B2 ...
Step-by-Step Breakdown of the First Records
- Type 05H – Filename Header
05 06 53 59 53 36 20 20
- 05 = header record type
- 06 = length of data
- 53 59 53 36 20 20 = ASCII "SYS6 "
- Type 1FH – Copyright Block
1F 91 0D 2A 20 2A ...
This is a long informational block containing the copyright notice. The loader ignores this for normal execution.* * * N O T I C E * * *
* PROPRIETARY PROGRAM *
* COPYRIGHT (C) 1980 *
* BY RANDOLPH COOK *
* ALL RIGHTS RESERVED *
* * * N O T I C E * * * -
ISAM Directory Begins (Type 08H records)
After the copyright and some padding, the real directory starts. Here is a consecutive snippet containing the first few ISAM entries:08 06 11 00 52 01 00 C9 ← ISAM 11H (AUTO)
08 06 15 00 52 02 00 1D ← ISAM 15H (DATE)
08 06 16 2D 52 02 00 1D ← ISAM 16H (TIME)
08 06 13 00 52 02 00 B2 ← ISAM 13H (ALLOC)Take this real record from later in the directory:
08 06 31 00 52 1D 00 FD- 08 = ISAM directory entry type
- 06 = 6 data bytes follow
- 31 = ISAM number = 31H (APPEND main)
- 00 52 = Transfer / entry address = 5200H
-
1D 00 FD = Triad pointer = NRN 1DH 00H / RBO FDH — this tells the loader exactly where on disk (or in the hex file) the code for this member begins.
Since the TRS-80 uses 256 byte sectors, this math is easily shortcut to just the first byte and the last ... so this would be byte 1DFDH
Specifically, the formula is File Offset = (NRN × 256) + RBO where NRN (Next Record Number) is the 2 byte logical record (sector group) in the file where the PDS member starts in lower-endian format (for a TRS-80 generally, this will always be nnH) and a 1 byte RBO (Relative Byte Offset) which is the byte offset within that record where the first byte of the member's code is located.
The loader seeks to that byte offset in the file, then begins reading the load records (type 01H) that contain the actual Z80 code. It loads those bytes into memory starting at the address specified inside the load blocks (usually 5200H), and finally jumps to the transfer address from the ISAM record.
This structure allows VTOS to load only the needed command into the overlay area at 5200H+, keeping memory usage efficient, and By including a transfer address in this code, you can use the identical routine at the Triad Pointer for different purposes, because it is loaded elsewhere.
Examples:- AUTO triad
01 00 C9→ NRN=01 00 = 0001H (= go to record 1 of the SYS6 file), RBO=C9H (= 201 bytes to skip) → offset = (1 × 256) + 201 = 457 decimal (01C9H) - DATE/TIME triad
02 00 1D→ NRN=02 00 = 0002H (= go to record 2 of the SYS6 file), RBO=1DH (= 29 bytes to skip) → offset = (2 × 256) + 29 = 541 decimal (021DH) as the exact byte to start
- AUTO triad
Utility
Tim Mann has developed, as part of his XTRS emulator, some routines which can assist in processing ISAM and PDS files:
- LOADCMD - C routines that help in parsing TRS-80 cmd files including ISAM and PDS file. They can be found at https://github.com/TimothyPMann/xtrs/blob/master/load_cmd.c and https://github.com/TimothyPMann/xtrs/blob/master/load_cmd.h.
- CMDDUMP - C routine that displays information about TRS-80 DOS CMD (binary executable) files. It can be found at https://github.com/TimothyPMann/xtrs/blob/master/cmddump.c and https://github.com/TimothyPMann/xtrs/blob/master/cmddump.man.
SYS0 Routines Used by the Members
| Address | What the members use it for |
|---|---|
| 402DH | Exit to VTOS READY. |
| 4030H | Exit to VTOS READY after a message has been displayed. |
| 4300H | Called by SYSTEM (53A9H) as the SYS0 keyboard routine does. |
| 4409H | Error handler: displays the error in Register A (bit 6 set = the message only). |
| 4410H | Add a timer task: A = the slot, DE = the task block. |
| 4413H | Remove the timer task in slot A. |
| 4416H | Used by a timer task to wait for its next run: the address after the CALL becomes the task's vector. |
| 441CH | Read a filespec (or device name) from the command line at HL into the FCB at DE. |
| 4420H | Open a file, creating it if it does not exist (B = record length, HL = buffer). |
| 4424H | Open an existing file. |
| 4428H | Close a file. |
| 442CH | Kill a file. |
| 4430H | Load a program file. |
| 4436H | Read a record. |
| 4439H | Write a record. |
| 443FH | Position a file to record 0. |
| 4442H | Position a file to record BC. |
| 4448H | Position a file to its end. |
| 444EH | Write the ending record number into the file's directory entry. |
| 4454H | Position a file back one sector. |
| 4467H | Display the text at HL (ending with 03H or 0DH). |
| 446AH | Print the text at HL. |
| 4473H | Give the filespec in the FCB at DE the default extension at HL if it has none. |
| 4476H | Scan the parameters in parentheses with the table at DE (six-character names, each followed by the address that receives the value). |
| 4479H | Send the text at HL to the device whose control block is at DE. |
| 447BH | Display the text at HL and copy it to the job log device when that is active. |
| 447EH | Copy a line, with the time, to the job log device (used by CHAIN). |
| 44B8H | SYS2, request 40H: check that drive C is there and ready. |
| 44BBH | SYS3, request 30H: build the file name of directory entry B on drive C as text. |
| 4763H | Disk driver: write a sector (function 0DH). |
| 4768H | Disk driver: write a system sector (function 0EH). |
| 4772H | Disk driver: verify a sector (function 0AH); a system sector verifies with error 06H. |
| 4777H | Disk driver: read a sector (function 09H). |
| 478FH | Point IY to the drive control table of drive C. |
| 4797H | Fetch byte A of the drive control table of drive C. |
| 4B10H | Read the directory sector that holds entry B of drive C into 4200H; HL = the entry. |
| 4B1FH | Write that directory sector back. |
| 4B45H | Read sector E of track D of drive C into the buffer at HL. |
| 4B65H | Register D = the directory track of drive C. |
| 4B6CH | Multiply: A = A × E. |
| 4B8FH | Multiply DE by A (24-bit result). |
| 4DE7H | Put DE at HL as four hexadecimal digits. |
| 4DECH | Put A at HL as two hexadecimal digits. |
Full ISAM/PDS Breakdown
The directory follows the header record (05H, 0000H-0007H) and the copyright record (1FH, 91H bytes of data, 0008H-009AH). Each entry is eight bytes: type 08H, length 06H, the ISAM number, the entry address and the triad. The 37 entries run from 009BH to 01C2H.
| Offset Range | Library Command | Hex Bytes | Explanation |
|---|---|---|---|
| 009B-00A2 | AUTO | 08 06 11 00 52 01 00 C9 |
|
| 00A3-00AA | DATE | 08 06 15 00 52 02 00 1D |
|
| 00AB-00B2 | TIME | 08 06 16 2D 52 02 00 1D |
|
| 00B3-00BA | ALLOC | 08 06 13 00 52 02 00 B2 |
|
| 00BB-00C2 | KILL | 08 06 18 00 52 03 00 71 |
|
| 00C3-00CA | LIB | 08 06 19 00 52 03 00 B1 |
|
| 00CB-00D2 | DEBUG | 08 06 14 00 52 03 00 E8 |
|
| 00D3-00DA | CLOCK | 08 06 17 41 52 03 00 E8 |
|
| 00DB-00E2 | TRACE | 08 06 1A 57 52 03 00 E8 |
|
| 00E3-00EA | VERIFY | 08 06 1B 67 52 03 00 E8 |
|
| 00EB-00F2 | O! (Copyright Notice) | 08 06 1D 00 52 04 00 E2 |
|
| 00F3-00FA | MEMORY | 08 06 1E 00 52 05 00 35 |
|
| 00FB-0102 | SYSTEM's SYSGEN Command | 08 06 1C 00 52 05 00 C3 |
|
| 0103-010A | DIR | 08 06 21 00 52 08 00 27 |
|
| 010B-0112 | FREE | 08 06 22 00 52 0D 00 43 |
|
| 0113-011A | CHAIN | 08 06 91 00 52 0F 00 20 |
|
| 011B-0122 | SYSTEM | 08 06 A1 00 52 14 00 B9 |
|
| 0123-012A | SPOOL | 08 06 A2 08 52 19 00 D7 |
|
| 012B-0132 | APPEND | 08 06 31 00 52 1D 00 FD |
|
| 0133-013A | COPY | 08 06 32 70 52 1D 00 FD |
|
| 013B-0142 | BUILD | 08 06 33 00 52 20 00 A9 |
|
| 0143-014A | LIST | 08 06 41 00 52 21 00 7C |
|
| 014B-0152 | 08 06 42 06 52 21 00 7C |
| |
| 0153-015A | ATTRIB | 08 06 51 00 52 24 00 A7 |
|
| 015B-0162 | PROT | 08 06 52 00 52 26 00 8D |
|
| 0163-016A | RENAME | 08 06 53 00 52 29 00 BB |
|
| 016B-0172 | DEVICE | 08 06 61 00 52 2B 00 60 |
|
| 0173-017A | LINK | 08 06 62 00 52 2D 00 C7 |
|
| 017B-0182 | RESET | 08 06 63 00 52 2E 00 D6 |
|
| 0183-018A | ROUTE | 08 06 64 00 52 30 00 CA |
|
| 018B-0192 | SET | 08 06 65 01 5A 32 00 6C |
|
| 0193-019A | FILTER | 08 06 66 00 5A 32 00 6C |
|
| 019B-01A2 | DUMP | 08 06 71 00 52 33 00 91 |
|
| 01A3-01AA | PURGE | 08 06 72 00 52 35 00 26 |
|
| 01AB-01B2 | XFER | 08 06 73 00 52 37 00 81 |
|
| 01B3-01BA | LOAD | 08 06 81 00 52 3A 00 5E |
|
| 01BB-01C2 | RUN | 08 06 82 0D 52 3A 00 5E |
|
The six bytes 01C3H-01C8H between the directory and the first member (AUTO, 01C9H) are not in the listing this page was rebuilt from. The table of them on earlier versions of this page could not be checked and did not agree with the member offsets (it placed a record across 01C9H), so it has been removed.
ISAM 11H - AUTO - Offset 01C9
AUTO stores a command line that VTOS runs every time the system starts. The member loads at 5200H-524CH (77 bytes) and is entered at 5200H with HL pointing to the rest of the command line after AUTO. It copies 32 bytes from there into the GAT sector of drive 0 at offset E0H (42E0H while the sector is in the buffer at 4200H) and writes the sector back. AUTO with nothing after it stores just the carriage return, which leaves no command. Error codes returned: 14H (GAT read error) and 15H (GAT write error).
5200H - AUTO Command
Read the GAT of drive 0, put the command line into it at offset E0H and write it back.
521CH - Error Exit
Reached with the error code in Register A.
5221H - Read the GAT
Reads sector 0 of the directory track of the drive in Register C into 4200H. Returns Z if it was read, or NZ with Register A = 14H (GAT read error). DE and HL are preserved.
5234H - Write the GAT
Writes the buffer at 4200H back to sector 0 of the directory track of the drive in Register C, then reads it back to verify it. Returns Z if all went well, or NZ with Register A = 15H (GAT write error). DE and HL are preserved.
ISAM 15H (DATE) and 16H (TIME) - Offset 021D
One member serves both commands. It loads at 5200H-524BH and 524FH-528CH (138 bytes); the three bytes at 524CH-524EH are not in the file and hold the three numbers typed. DATE (ISAM 15H) enters at 5200H and TIME (ISAM 16H) at 522DH, both with HL pointing to what follows the command name. Each expects three fields of exactly two digits, separated by / for DATE (DATE MM/DD/YY) and : for TIME (TIME HH:MM:SS). The values are not range-checked. Anything else gives BAD FORMAT.
5200H - DATE Command (ISAM 15H)
Stores month, day and year in 4046H, 4045H and 4044H (the order in which the SYS0 routine at 4470H shows them as MM/DD/YY), and the packed form of the date in 4306H-4307H.
522DH - TIME Command (ISAM 16H)
Stores hours, minutes and seconds in 4043H, 4042H and 4041H, the clock that the interrupt routine advances.
5243H - BAD FORMAT Exit
Shared by DATE and TIME.
525AH - Read Three Two-Digit Fields
HL points to the text, Register C holds the separator. Stores the three values from 524EH downward. Returns Z if all three fields were two digits each and the first two were followed by the separator; otherwise returns NZ. What follows the third field is not checked.
526FH - Read a Two-Digit Number
Returns Z with the value (0-99) in Register A, or NZ if either of the next two characters is not a digit.
5286H - Read One Digit
Fetches the character at (HL) and moves HL past it. Returns Carry set with the digit value (0-9) in Register A if it was 0-9, or No Carry otherwise.
ISAM 13H - ALLOC - Offset 02B2
ALLOC (ALLOC filespec (SIZE=n)) opens the file, creating it if it does not exist, allocates disk space for it and marks it so that the space is kept when the file is closed. SIZE (or S) is the size in K: the program writes one sector of E5H at record n x 4 - 1, which makes the DOS allocate everything up to it, then puts back the file's old end of file. Without SIZE only the mark is set. The member loads at 5200H-52A2H and 52C3H-52D3H (180 bytes). 52A3H-52C2H (the FCB) is not in the file, and the 256-byte sector buffer at 52D4H lies past the end of the member.
5200H - ALLOC Command
HL points to the text after ALLOC.
5253H - Set the Keep-Space Flag
Sets bit 7 of byte 1 of the file's directory entry. The SYS3 close routine does not release unused space of a file with this bit set (4E97H in SYS3).
5269H - Error Exit
Register A holds the error code: from the open, the write, or the directory read or write.
526EH - Message Exits
Display a message and return to VTOS READY through 4030H.
52C3H - Parameter Table
Used by the SYS0 parameter scan at 4476H: 6-character names padded with spaces, each followed by the address that receives the value, ended by 00H.
ISAM 18H - KILL - Offset 0371
KILL (KILL filespec) deletes a file. The member loads at 5200H-5238H (57 bytes); the 32-byte FCB at 5239H lies just past its end.
5200H - KILL Command
HL points to the text after KILL.
5218H - Error Exit
Register A holds the error code from the open or the kill.
521DH - No Filespec
ISAM 19H - LIB - Offset 03B1
LIB lists the names of the library commands, four to a line. It reads them from the command table of SYS1 at 4EADH, which is still in memory because SYS1 has just dispatched the command. The table has 8-byte entries (six characters of name and a two-byte handler) and ends with 00H, so BOOT is listed as well. The member loads at 5200H-522FH (48 bytes).
5200H - LIB Command
The spaces are sent as the Model I space compression codes: a character from C0H to FFH displays (code - C0H) spaces.
DEBUG (14H) / CLOCK (17H) / TRACE (1AH) / VERIFY (1BH) - Offset 03E8
One member holds four commands, each switched on or off: DEBUG (ISAM 14H, entry 5200H), CLOCK (ISAM 17H, entry 5241H), TRACE (ISAM 1AH, entry 5257H) and VERIFY (ISAM 1BH, entry 5267H). Each command is on unless (OFF), (NO) or (N) is given; ON, YES and Y are accepted and have no further effect. DEBUG also takes (EXT) or (E), which loads the extended debugger in SYS9. The member loads at 5200H-52F2H (243 bytes).
5200H - DEBUG Command (ISAM 14H)
DEBUG ON sets bit 7 of the system flags at 430FH and arms the BREAK key: 4315H-4317H become JP 400FH, the DEBUG entry. DEBUG OFF clears bit 7 and puts a RET at 4315H.
523EH - Load the Extended Debugger
Called from 5215H when EXT was given.
5241H - CLOCK Command (ISAM 17H)
CLOCK ON adds a timer task in slot 6 whose task block at 4DABH points to the SYS0 routine at 4DAEH, which shows the time at the top right of the screen. CLOCK OFF removes it.
5257H - TRACE Command (ISAM 1AH)
TRACE ON adds a timer task in slot 11. Its task block is the two bytes at 4DDBH (DDH 4DH), which point to the SYS0 routine at 4DDDH: it fetches the interrupted program's address from the stack and shows it in hexadecimal at 3C2EH, at the top of the screen. TRACE OFF removes the task.
5267H - VERIFY Command (ISAM 1BH)
Changes the SYS0 jump vector for writing a record, JP 48C0H at 4439H. VERIFY ON makes it jump to 48DBH, the routine behind 443CH that writes and then verifies; VERIFY OFF puts back 48C0H.
5276H - Read the Parameters
Two entries: 5276H with the DEBUG table at 52B2H and 527BH with the ON/OFF table at 52C2H. The scan stores FFFFH (or the value given) at the address of each keyword it finds: OFF, NO and N go to 5290H, the operand of the LD BC at 528FH; ON, YES and Y go to the spare bytes at 5297H. Returns Z if OFF, NO or N was given, NZ otherwise.
5299H - PARAMETER ERROR
Reached from 528CH. The return address of the scan routine is left on the stack; 4030H resets the stack.
52B2H - Parameter Tables
6-character names padded with spaces, each followed by the address that receives the value. The DEBUG table starts at 52B2H and runs on into the ON/OFF table at 52C2H; both end at 52F2H.
ISAM 1DH - O! (Copyright Notice) - Offset 04E2
ISAM 1DH displays the copyright notice COPYRIGHT (C) 1980 BY RANDOLPH V. COOK, ALL RIGHTS RESERVED. The text is stored with 90H added to every character, so it cannot be read in a dump of the file. The member loads at 5200H-524BH (76 bytes).
5200H - Display the Copyright Notice
The first byte of the text block is the key; each following byte has the key subtracted and is displayed, until a 00H byte.
ISAM 1EH - MEMORY - Offset 0535
MEMORY shows or lowers the top of the memory available to programs, the address kept at 4049H-404AH. MEMORY alone displays it as HIGH = X'nnnn'. MEMORY (HIGH=n) or (H=n) sets it to n, which must be above 5200H and not above the current value; otherwise RANGE ERROR is displayed. The member loads at 5200H-5286H (135 bytes).
5200H - MEMORY Command
HL points to the text after MEMORY.
5239H - Message Exits
Display a message and return to VTOS READY through 4030H.
5267H - Parameter Table and Display Line
ISAM 1CH - SYSGEN (called by SYSTEM) - Offset 05C3
There is no SYSGEN command in the SYS1 table: this member is run by the SYSTEM member (ISAM A1H, 5622H there) when SYSTEM (SYSGEN) or SYSTEM (SYSGEN=NO) is given, with HL holding the value of the SYSGEN parameter. A non-zero value saves the current configuration in the file CONFIG/SYS.CCC:0; 0000H (NO or OFF) deletes the file. The file is written as a load module: every saved area of memory becomes a load record, so loading the file puts the areas back. The member loads at 5200H-53A2H and 53B2H-5464H (598 bytes). 53A3H-53B1H (the end of the FCB) is not in the file, and the file buffer at 5500H lies past the member.
5200H - SYSGEN Entry
HL = the SYSGEN value from SYSTEM.
520DH - Save the Configuration
Creates CONFIG/SYS.CCC:0 and writes: a 05H header record with the name CONFIG, a load record that shows *** CONFIGURING *** near the bottom of the screen, a load record that puts a RET at 4012H (the interrupt hook) while the rest loads, the system areas listed at 542FH, the memory above the top of memory, the real bytes of 4012H-4014H, a record that clears the banner again, and a transfer record.
52CEH - Save an Area of Memory
DE = the address of the area, BC = its length. Writes it as load records (type 01H) of at most 254 bytes each, with the same load address, to the file whose FCB is at 5392H.
5307H - Write a Load Record
B = number of bytes, DE = the load address, HL = where the data is now. Writes one load record (type 01H) to the file.
5329H - Delete the Configuration
Reached when the SYSGEN value is 0000H.
535DH - Message and Error Exits
5392H - FCB
The filespec is stored in the FCB itself; opening the file replaces it with the FCB data.
53B2H - Write a Byte to the File
Writes Register A to the file whose FCB is at DE. Errors end the command.
542FH - Table of Saved System Areas
Each entry is a length and an address; the table ends with a length of 0000H.
ISAM 21H - DIR - Offset 0827
DIR (DIR name/ext:d (A,I,S,P)) lists the files on one drive, or on every drive that is ready when no drive is given. The name and extension are a pattern: characters that are left out match anything, so DIR /CMD lists every file with the extension CMD. The entries are found through the hash index table (sector 1 of the directory track). Normally three names are shown on a line, each followed by S (system file), I (invisible), P (password protected) and + (updated) where they apply. System and invisible files are only listed with S and I. A adds the protection level, the number of records (EOF=), the space allocated in K (SIZ= or, for files marked by ALLOC, SIZ:) and the date, one file to a line. P also sends the listing to the printer. SHIFT and @ pause the listing, BREAK stops it. The member loads at 5200H-5701H (1,282 bytes) and uses 5800H-58FFH for the hash index table and 5900H-59FFH for extended directory entries.
5200H - DIR Command
HL points to the text after DIR.
5203H - Fetch the Ending Record Number
Entry: Register A = offset of the ending record number in the directory entry at 42xxH (entry+14H). Returns DE = the number of 256-byte sectors that hold data: the ending record number, minus 1 if the last sector is only partly used (the EOF byte at 5211H is not 00H). HL is left pointing to 5211H.
5213H - Read the Pattern and Drive
Copies up to eight name characters to 56F6H and up to three extension characters to 56FEH (both start as spaces, which match anything), then a drive number after :.
5268H - List One Drive
Register C = the drive. Displays the heading, then scans the hash index table.
52D2H - Next Entry of the Hash Index Table
The position in the table is the directory entry code: bits 0-4 give the directory sector (from sector 2 on) and bits 5-7 the entry within it. The table is walked in the order 00H, 20H, 40H ... E0H, 01H, 21H ..., so the entries are visited sector by sector.
52F6H - Drive Not Ready
5308H - Examine a Directory Entry
HL points into the hash index table at 5800H. An entry in use has a non-zero hash byte. Reads the directory sector that holds the entry, unless it is already in the buffer at 4200H, and decides whether the file is to be listed.
535DH - Show the Name and Flags
Each file takes a field of 20 characters (Register C counts what is left of it).
5410H - Output a Flag Character
Counts the character in the field (Register C) and outputs it.
5414H - Show the Details (A)
HL points to the directory entry. Fills in and displays prot / EOF=nnnnn / SIZ=nnnnn.n K DD-MMM-YY.
550AH - Count the Granules of a File
HL points to the directory entry. Adds up the granules of every extent (bits 0-4 of the second byte of each two-byte extent, plus 1) until an FFH byte. An FEH byte links to an extended entry, whose code is in the byte after it; that entry is read and its extents are added as well. Returns DE = the granules and BC = the number of extents.
556CH - Output Routines
556CH displays the text at HL; 5577H outputs the character in Register A. Both also send it to the printer when P was given.
5584H - Error Exits
55A2H - Write a Number in Decimal
HL = the number, DE = where the five characters go. Leading zeros are written as spaces.
55DDH - Divide a 24-Bit Number
HL points to a 24-bit number (high byte first), Register C = the divisor. Returns DE = the quotient (16 bits). A divisor of 0 stands for 256: then DE is simply the two high bytes.
5603H - Pause and BREAK Check
Returns NZ if BREAK is pressed. SHIFT and @ together pause until another key is pressed (BREAK still stops). Does nothing while a chain (DO) file is running (bit 5 of 430FH).
562FH - Parameter Table
5650H - Text
ISAM 22H - FREE - Offset 0D43
FREE shows, for every drive that is ready, one line: DRIVE n - diskname mm/dd/yy FILES=fff/ttt, SPACE=fffff/ttttt K. FILES gives the free directory entries and the directory's capacity, SPACE the free and total space in K. FREE (P) also prints the lines. The member loads at 5200H-53D1H (466 bytes).
5200H - FREE Command
HL points to the text after FREE.
5222H - One Drive
Register C = the drive.
530EH - Display a Line
Displays the text at HL and, if P was given, prints it.
5319H - Error Exits
5337H - Write a Number in Decimal
5337H writes HL as three digits (for numbers up to 999) and 533BH as five digits, at DE. Leading zeros become spaces.
5376H - Read the GAT
Reads sector 0 of the directory track of drive C into 4200H. Returns Z, or NZ with Register A = 14H (GAT read error). DE and HL are preserved.
5389H - Parameter Table and Display Line
ISAM 91H - CHAIN - Offset 0F20
CHAIN runs a job control (JCL) file. It first compiles the file into SYSTEM/JCL: symbols given on the command line or set in the file are substituted wherever #name# appears, the directives //IF, //ELSE, //END, //SET, //RESET, //ASSIGN, //INCLUDE and //QUIT are carried out, and lines in a false //IF block are dropped. Then it hands SYSTEM/JCL to SYS7, which feeds its lines to the system as if they were typed. The forms are CHAIN filespec (name, name=value, ...) (default extension JCL; a ; on the line asks for more parameters with ?), CHAIN $ filespec ... (compile only), CHAIN = filespec (run a file that is already compiled) and CHAIN * (run SYSTEM/JCL again). SYS1 also runs CHAIN for a command line that starts with !. The member loads at 5200H-56D1H, 571BH-57B3H, 58F4H-58F6H, 5916H-5919H and 5C00H (1,395 bytes). The areas between are its buffers; the symbol table starts at 5C00H and grows upward.
5200H - CHAIN Command
HL points to the text after CHAIN.
5251H - Read the Rest of the Command Line
Parameters in parentheses define symbols. A ; asks for another line from the keyboard.
527EH - End of a Source File
Reached when the file being read ends. If it was included by //INCLUDE, the file that included it is taken back from the stack at 57B4H and reading goes on there. Otherwise the compilation is finished.
52AEH - Run SYSTEM/JCL
Opens the file named in the FCB at 4358H and passes it to SYS7.
52E1H - Read the Parameters
Each parameter is a name, optionally followed by = and a value. A name that is already defined gives MULTIPLY DEFINED PARAMETER!.
530FH - Compile One Line
530FH writes the line just built; 5312H reads the next line of the source file into 5919H and builds the output line at 5959H, substituting symbols.
5340H - PAUSE Line
Called with HL just past a P at the start of the line. If AUSE follows, the whole line is moved up two bytes and // put in front of it; Register A is then /, so the caller treats it as a directive. Otherwise Register A is P again and HL is unchanged.
536FH - Substitute a Symbol
Called with HL just past a #. ## gives a single #. #name# is replaced by the value of the symbol; a symbol that is not defined, or has an empty value, is copied as it stands. A missing closing # is an error.
53A9H - Invalid JCL Format
Displays --> followed by the source line (the line buffer at 5919H follows the arrow directly), then INVALID JCL FORMAT, PROCESSING ABORTED!.
53B8H - A Directive Line
HL points to the second /. IF, ELSE and END are always carried out; SET, RESET, ASSIGN, INCLUDE and QUIT only outside a false //IF block. Any other // line (for example //PAUSE, or //. comments) is copied to SYSTEM/JCL like an ordinary line.
53E8H - Read a Source Line
Reads characters from the source file into 5919H up to a carriage return. Returns Z with the line, or NZ with Register A = 1CH at the end of the file. Other errors end the command.
5406H - Write the Output Line
Writes the line at 5959H to SYSTEM/JCL, unless the current //IF condition is false. A line that starts with //. is only displayed now, not written.
5435H - Directive Tables
Names padded with spaces, each followed by the address of its handler; each table ends with 00H.
5481H - //IF
//IF a.b,c: terms joined by . must all be true; alternatives are separated by commas. A term is a symbol name, true if it is defined. Pushes the result on the condition stack at 58F6H; inside a false block the result is always false.
54A2H - //ELSE
Inverts the current condition (it stays false if the enclosing block is false).
54BAH - //END
Drops the current condition.
54D0H - Evaluate One Alternative
Evaluates terms joined by .. Returns Z if they are all true; NZ, with Register A = the character after the false term, as soon as one is false.
54F6H - //SET, //RESET, //ASSIGN
//SET name defines a symbol with an empty value. //RESET name removes one (its first character is made a space, so it can no longer be found). //ASSIGN name=value defines it, or changes its value.
5539H - //INCLUDE and //QUIT
//INCLUDE filespec saves the FCB of the current source file on the stack at 57B4H and opens the named file (default extension JCL) in its place. //QUIT displays its line and stops: SYSTEM/JCL is closed and nothing is run.
5577H - Read a Name or a Value
5577H reads a name of up to eight characters into 56F2H, padded with spaces. 5582H reads a value of up to 32 characters into 56FBH (substituting #symbols#) and stores its length at 56FAH. Both return Register A = the character that ended the text and Z if it was not empty.
55C0H - Read Letters and Digits
Copies letters and digits from (HL) to (DE), lower case changed to capitals, up to B characters (extra ones are dropped), and pads the rest of the field with spaces. Stops at any other character, which is skipped unless it is 03H, a carriage return or (. Returns Register A = that character, Z if something was copied.
560BH - Symbol Table Routines
The table at 5C00H holds 41-byte entries: 8 characters of name, a length byte and 32 characters of value. It ends with a 00H byte.
5660H - Search a Table
HL = the table, DE = the name (ended by a space or carriage return), B = the length of the names in the table, C = the length of an entry. Returns Z with HL just after the matching name, or NZ with HL at the 00H that ends the table.
56A9H - Error Exits
571BH - Text
ISAM A1H - SYSTEM - Offset 14B9
SYSTEM (SYSTEM (option, option, ...)) changes system settings. The options are handled in this order: FAST and SLOW (CPU speed through port FEH), BASIC2 (leave the DOS for Level II BASIC), BREAK (BREAK key on or off; this ends the command), BLINK, SMALL and LARGE (blinking cursor), TYPE (type-ahead), LOWER (a display driver that goes straight to the ROM display routines, presumably for lower-case display), JKL with GRAPHIC (print the screen when J, K and L are pressed together), ALIVE (a changing character in the top right corner), DRIVE=n with ENABLE, DISABLE, STEP=n and DELAY, and SYSGEN (runs ISAM 1CH). BLINK, TYPE, LOWER, JKL and ALIVE copy a routine into memory below the top of memory, lower the top of memory (4049H) accordingly, and install it as a timer task or driver. TYPE, LOWER and JKL are refused while a program has taken over the DOS exit at 402DH. The member loads at 5200H-52C4H, 52CCH-53D6H, 53D9H-5523H and 5526H-5709H (1,279 bytes); 52C5H-52CBH, 53D7H-53D8H and 5524H-5525H belong to the routines that are copied and are filled in at run time.
5200H - SYSTEM Command: FAST and SLOW
HL points to the text after SYSTEM. The parameter scan stores each option's value straight into the operand of the LD BC (or LD HL) that tests it. Options that were not given keep the value in the file: 0000H, 0001H or FFFFH.
522EH - BASIC2
Leaves the DOS for the Level II BASIC in ROM, as if the computer had been started without disks: the ROM's initial values are copied to 4000H-4035H, 4036H-405CH is cleared and the ROM start-up at 0075H is entered (it asks MEMORY SIZE?).
524BH - BREAK
BREAK=NO puts C8H (RET Z) at 4C2DH in SYS0 and sets bit 4 of 430FH; BREAK alone puts back 00H (NOP) and clears bit 4. Either way the command ends here, so options that come after BREAK in the list above are not looked at.
526FH - BLINK
BLINK installs the blinking cursor routine at 52C7H as timer task 5; BLINK=NO removes the task. The cursor character is 8FH (a full block), 88H with SMALL, or the value given with BLINK=n. LARGE is accepted, but its value goes to 52C5H, which nothing reads.
52C7H - Blinking Cursor Task (copied)
This routine is copied below the top of memory and runs as timer task 5 with IX pointing to its first byte. It shows the cursor character at the cursor position (4020H) on one run and puts back the character underneath on the next, using the SYS0 routine at 4416H, which ends the task for this run and makes the next run continue after the CALL.
5305H - TYPE
TYPE installs type-ahead: a 256-byte key buffer and a new keyboard driver below the top of memory. A timer task (slot 10) reads the keyboard through the old driver and stores the keys in the buffer; the new driver hands them out in order. TYPE=NO removes the task.
53A9H - Type-Ahead Driver (copied)
The new keyboard driver. The buffer header is: busy flag, write index, read index, then 256 bytes of data. Each key takes two bytes: the character and the flags the old driver returned with it. If the buffer is empty, the old driver is called directly.
53D9H - Type-Ahead Task (copied)
Timer task 10. If the driver is not busy, reads the keyboard through the old driver and adds any key to the buffer. Key code C0H empties the buffer instead.
5426H - Key Decoder (copied)
Replaces the ROM key decoder (03FAH) through the CALL at 4BC0H. Entry: Register A = the bits of the key in its keyboard row, Register D = the row number. Works like the ROM routine; with the down arrow held, a letter gives a control code (01H-1AH). If the key is BREAK (01H), RST 28H is executed with A = 01H.
547FH - LOWER
Installs a display driver in high memory that goes straight to the ROM display routines (047DH, 04A6H, 0506H), and makes it the driver of the display control block at 401DH. The driver makes the tests for control codes and graphics itself and enters the ROM at 047DH for other characters, skipping the ROM's own handling of the character; the option's name suggests that this is for lower-case display.
54DDH - JKL and GRAPHIC
Installs a timer task (slot 4) that waits for J, K and L to be pressed together and then has the SYS0 interrupt routine print the screen. Characters 80H and above are printed as ., unless GRAPHIC is given as well.
5526H - JKL Task (copied)
Runs as timer task 4.
5572H - ALIVE
Installs a timer task (slot 3) that changes the character in the top right corner of the screen (3C3FH) between 86H and 89H each time it runs.
55B4H - DRIVE, ENABLE, DISABLE, STEP and DELAY
Change the drive control table of drive n (DRIVE=n). DISABLE puts a RET in place of the jump at the start of the table entry, so the drive can no longer be used; ENABLE puts the JP back. STEP=n (0-3) sets the stepping rate in bits 0-1 of DCT+03H. DELAY=NO sets bit 2 of DCT+03H, DELAY clears it. STEP and DELAY are refused (PARAMETER ERROR) if bit 3 of DCT+03H is set.
5619H - SYSGEN
SYSGEN or SYSGEN=NO runs the SYSGEN member (ISAM 1CH) with HL = the value.
5627H - Check the Command Level
If a program has put a jump (C3H) at 402DH, the DOS exit, the option is refused with CAN'T -- ONLY VALID AT VTOS COMMAND LEVEL.
5679H - Parameter Table
6-character names padded with spaces, each followed by the address that receives the value.
ISAM A2H - SPOOL - Offset 19D7
SPOOL (SPOOL *PR filespec (MEM=m, DISK=d)) puts a print spooler between a device (normally the printer) and the programs that use it. Characters sent to the device are stored in 256-byte buffers and printed by a timer task while the computer does other work. MEM (or M) is the memory to use, 1-32K (default 1K); DISK (or D) is the space in K to allocate in the spool file (default 4K; DISK=0 for none), which is used when the memory buffers are full. The spool file defaults to PR/SPL (the device name with the extension SPL); SPOOL *PR :d puts it on drive d. The spooler code (54D3H-5629H), its control block and FCB (562AH-5655H), a table of buffer descriptors and the buffers themselves are placed below the top of memory. It is entered at 5208H. The member loads at 5200H-548AH, 54ABH-5574H, 5577H-55B8H, 55BCH-5629H and 5654H-5655H (1,031 bytes).
5200H - Spare Bytes
The member is entered at 5208H.
5208H - SPOOL Command
HL points to the text after SPOOL.
52C8H - Build the Buffer Descriptor Table
One 4-byte descriptor for each 256-byte memory buffer and each disk record: link (2 bytes, 0000H when free), the page or record, and a flag byte (bit 7 = a disk record). The table ends with FFH FFH. The buffers take the MEM*1K just below the page above the top of memory; the table goes below them.
534EH - Install the Spooler
Copies the FCB and control block and the spooler code below the table, makes the code the device's driver, adds the output routine as timer task 9, and hooks the refill routine into 4300H.
53F6H - Find a Device Control Block
DE = the two letters of the name (E first). Searches the control blocks at 4015H-402CH and then from 43C0H. Returns Z with HL = the block, or NZ with Register A = 08H (device not available).
541CH - Error Exits
54ABH - Default Name and Parameter Table
54D3H - Spooler Driver (copied)
Everything from here to 5629H is copied below the top of memory and runs there. The addresses in the LD IX and CALL instructions shown as 0000H are filled in at 535EH-53B5H. This is the device's new driver: a character in Register C is stored in the current buffer; 00H is ignored.
5577H - Output Task (copied)
Timer task 9. Each run calls the print routine twice: once through the CALL and once by going on into it.
55B6H - Hook at 4300H (copied)
4300H jumps here. The refill routine runs, then the three bytes that were at 4300H (copied to 55B9H-55BBH) are executed.
55BCH - Start the Next Buffer (copied)
If nothing is being printed, takes the next full buffer from the queue: a memory buffer is printed where it is; a disk record is first read back into the page of the head descriptor.
562AH - FCB and Control Block
Copied below the top of memory at 535AH; the spooler code finds it through IX.
APPEND (31H) / COPY (32H) - Offset 1DFD
One member serves both commands. APPEND (ISAM 31H, entry 5200H; APPEND source destination) adds the source file to the end of the destination file. COPY (ISAM 32H, entry 5270H; COPY source destination) copies a file, or copies between a file and a device (*PR, *KI and so on) one byte at a time. Parts of the destination that are left out (for example COPY FILE/CMD :1) are taken from the source: name, extension and password. Files are copied a sector at a time through the memory from 5500H up to the top of memory. Between devices, SHIFT and @ pause and BREAK stops. The member loads at 5200H-549CH (669 bytes); the source FCB (549DH) and destination FCB (54BDH) lie just past it.
5200H - APPEND Command (ISAM 31H)
HL points to the text after APPEND.
5270H - COPY Command (ISAM 32H)
HL points to the text after COPY.
52DCH - Copy Sector by Sector
Reads source sectors into the pages from 5500H until the last buffer page, then writes them all to the destination, and repeats.
532CH - Write the Pages Read
H = the page after the last one read. Writes the pages from 5500H up to it.
5349H - Set the Last Buffer Page
The buffers run from 5500H up to the page below the one that holds the top of memory. The page number is stored in the three CP instructions that test for it.
535BH - Allocate the Destination
BC = a record number. Positions the destination to it and writes a sector of E5H, so that the DOS allocates all the space up to it.
5375H - Copy a Byte at a Time
Used when the source or the destination is a device, and by APPEND when the destination does not end on a sector boundary.
53CDH - Complete the Destination Filespec
HL = the source filespec, DE = the destination. If the destination has no name, the source's name is put in front; if it has no extension or password, the source's are inserted.
5428H - Pause and BREAK Check
Returns NZ if BREAK is pressed. SHIFT and @ pause until another key is pressed. Does nothing while a chain (DO) file is running.
5454H - Error Exits
ISAM 33H - BUILD - Offset 20A9
BUILD (BUILD filespec) creates a new text file from lines typed at the keyboard; it refuses a file that already exists. BREAK on an empty line ends the input. If the extension is KSM (a keystroke multiply file), each line is prompted with its letter, A=> to Z=>, and input ends after Z. The lines are collected from 5400H upward and written to the file at the end, each ending with a carriage return. The member loads at 5200H-52CBH (204 bytes); the FCB (52CCH), the file buffer (5300H) and the text (5400H) lie past it.
5200H - BUILD Command
HL points to the text after BUILD.
528EH - Error Exits
ISAM 41H - LIST and PRINT - Offset 217C
LIST (ISAM 41H, entry 5200H) shows a file on the display and PRINT (ISAM 42H, entry 5206H) sends it to the printer. A text file is shown line by line, starting at LINE=n; NUM puts a five-digit line number in front of each line. HEX shows the file in hexadecimal and ASCII, 16 bytes to a line, record by record, starting at record REC=n, with records of LRL=n bytes (default 256). The default extension is TXT, but a file without an extension is also found. SHIFT and @ pause and BREAK stops. The member loads at 5200H-5517H (792 bytes); the 16-byte hex line buffer (5518H), the FCB (5528H), a copy of the filespec (5548H) and the file buffer (5600H) lie past it.
5200H - LIST and PRINT Commands
HL points to the text after the command name.
5206H - PRINT Command (ISAM 42H)
The same as LIST, but the output goes to the printer.
5281H - List a Text File
530EH - Hexadecimal Listing
Each record starts with a line rrrrr:oo = (record number, offset in hex) followed by the bytes; each later line of the record starts with the next offset.
5402H - Output Routines
5402H sends Register A as a character, with anything other than 20H-5AH and 61H-7AH sent as .. 5417H sends it as two hexadecimal digits. Both send to the device DE.
542BH - Write a Five-Digit Number
HL = the number, BC = where the digits go. A zero digit stays a space if the character before it is a space; the character before the first digit is never a space here, so the numbers always have five digits with leading zeros.
5461H - Add 1 to a Five-Digit Number
HL points to the first of the five digits. Spaces count as zeros.
5472H - Pause and BREAK Check
Returns NZ if BREAK is pressed. SHIFT and @ pause until another key is pressed. Does nothing while a chain (DO) file is running.
549EH - Error Exits
54D8H - Text and Parameter Table
ISAM 51H - ATTRIB - Offset 24A7
ATTRIB (ATTRIB filespec (I, V, ACC=password, UPD=password, PROT=level)) changes a file's attributes in its directory entry: I makes it invisible, V visible, ACC and UPD set the access and update passwords, and PROT the protection level (ALL or FULL, KILL, NAME or RENAME, WRITE, READ, EXEC; only the first two letters are checked, and the third to tell RENAME from READ). The file must be opened with full access. Without parameters, -NOTHING DONE- is shown. The member uses routines and work bytes of SYS2, which is in memory after the file has been opened. The member loads at 5200H-53DAH (475 bytes); the FCB at 53DBH lies past it.
5200H - ATTRIB Command
HL points to the text after ATTRIB.
5237H - Read One Parameter
The first letter decides the parameter. Each one sets a bit in the operand at 532FH (bit 0 PROT, bit 1 ACC, bit 2 UPD, bit 3 I or V) to say what is to be changed.
52F4H - Parameter Helpers
52F4H computes the password hash of the eight characters at DE (SYS2, request 60H) and returns it in HL. 52F7H looks for = before the end of the parameter; if there is one, it reads the value (a letter followed by letters and digits, with an optional quote before it) into 51E0H, padded to eight characters with spaces, and returns NZ; otherwise it returns Z.
5323H - Change the Directory Entry
536BH - Error Exits
53BDH - Change to Capitals
Changes every character from 61H up to capitals by clearing bit 5, until a control character.
ISAM 52H - PROT - Offset 268D
PROT (PROT :d (MPW=password, PW=password, NAME=name, LOCK, UNLOCK)) changes the protection of a whole disk. The disk's master password must be given with MPW or typed in answer to MASTER PASSWORD ?. PW changes the master password, NAME the disk name, LOCK gives every ordinary file the master password as its access and update password, and UNLOCK removes them (the blank password). Values may be given in the command or typed in answer to a prompt. For a disk whose GAT byte CBH is below 30H (an older format), PROT also updates GAT byte CCH and, if necessary, the hash index entry of DIR/SYS, whose password it removes. Not allowed while a chain file is running. The member loads at 5200H-5393H and 5396H-551CH (795 bytes); it reads the GAT into 5700H and the hash index table into 5800H.
5200H - PROT Command
HL points to the text after PROT.
5300H - Set the Passwords of Every File
HL = the password hash to use. Goes through the hash index table sector by sector and gives each ordinary file (in use, and not a system, invisible or extended entry) this hash as its update and access password. The entries kept for system files (positions 00H-07H and 20H-27H) are skipped.
5364H - Check the Master Password
Reads the GAT of the drive into 5700H and compares the hash of the password given (MPW, or typed in) with the one in the GAT (CEH-CFH). The hash C294H is also accepted.
5396H - Get a Password or Name
5396H gets the text and returns the hash of its eight characters in HL (SYS2, request 60H). 539CH only gets the text into 5600H, padded with spaces, and returns DE = 5600H. DE = the value from the command: the text itself, or 0000H if none was given, in which case the prompt at HL is displayed and the text is typed in.
5408H - Read and Write the GAT
5408H reads the GAT of drive C into 5700H (NZ with A = 14H on error). 541BH writes it back and verifies it (NZ with A = 15H on error). DE and HL are preserved.
5434H - Error Exits
54F4H - Parameter Table
ISAM 53H - RENAME - Offset 29BB
RENAME (RENAME oldspec newspec) gives a file a new name and extension. Parts left out of the new filespec are taken from the old one: the name if the new one starts with /, . or :, and the extension and password if the new one has none. The drive must be the same; it is added to the new filespec if not given. The old file must be opened with at least RENAME access (level 2). The member changes the name in the directory entry and the entry's byte in the hash index table, using routines and buffers of SYS2, which is in memory after the files have been opened. It loads at 5200H-5399H (410 bytes); the FCB of the old file is at 539AH and that of the new one at 53BAH, past the member.
5200H - RENAME Command
HL points to the text after RENAME.
52BDH - Hash of a File Name
Computes the hash index byte of the eleven characters at HL (SYS2, request 50H) and returns it in Register A.
52C0H - Complete the New Filespec
HL points to the old filespec and DE to the new one (both as typed, ending with 03H or 0DH). A name part that the new filespec lacks is copied from the old one and inserted in the new one at the right place: the name, the extension (after /) and the password (after .).
531BH - Error Exits
ISAM 61H - DEVICE - Offset 2B60
DEVICE lists the disk drives and the devices. For each enabled drive (0-7) it shows the size (5 or 8 inch), floppy or rigid disk, the select address, the number of cylinders, and then either REMOVABLE or FIXED (rigid disks) or the density, sides, step rate and, for 5-inch drives, the head settling delay (floppies). The drive lines are displayed character by character through the ROM routine at 0033H. Then, for each device control block in use (the keyboard at 4015H, the display at 401DH, the printer at 4025H, and the eight blocks from 43C0H to 43F8H), it displays a line with the device name and where it goes: NIL, the driver address X'hhhh', the device or chain of devices it is routed or linked to, or the file it is routed to. The arrows < and > show whether the device does input and output. The member loads at 5200H-53F5H and 541EH-547FH (600 bytes); 53F6H-541DH is the line buffer.
5200H - DEVICE Command: Drives
Register C counts the drives from 0 to 7. For each drive whose drive control table starts with a JP instruction (C3H), a line is displayed. Bits of DCT+03H: bit 2 (floppy) half-second delay or (rigid) fixed disk, bit 3 rigid disk, bit 5 8-inch drive, bit 6 double density, bits 0-1 step rate. DCT+04H: bits 0-3 select address, bit 5 two sides. DCT+06H: the highest cylinder.
52FCH - DEVICE Command: Devices
Goes through the device control blocks, eight bytes each: 4015H, 401DH and 4025H, then 43C0H-43F8H. A block whose type byte (+00H) is 0 is not in use. Bits of the type byte: 0 input, 1 output, 3 NIL, 4 routed or linked (+01H-02H then point to the next block, or to the FCB of a file, whose byte 0 has bit 7 set), otherwise +01H-02H is the driver address. The name is at +06H-07H.
53A0H - Put the Arrows in the Line
HL points to a device control block and DE to the line. Puts <=> in the line, with < only if bit 0 (input) of the type byte is set and > only if bit 1 (output) is set; a space is put in the place of an arrow that is left out.
53BFH - Three-Digit Number
Puts the number in HL (0-999) at DE as three decimal digits, with leading zeros shown as spaces.
ISAM 62H - LINK - Offset 2DC7
LINK (LINK *d1 *d2) links two devices: whatever goes to device d1 also goes to d2, and when d1 has no character to give, d2 is asked for one. LINK lowers the top of memory (4049H) by 30 bytes, copies a small driver there with the addresses of d1's old driver and of d2's control block filled in, and makes it d1's driver. The type byte of d1 is not changed, so DEVICE shows the new driver address. Not allowed while a program has put a jump at 402DH. The member loads at 5200H-5303H (260 bytes); the two FCBs at 5304H and 5324H lie past it.
5200H - LINK Command
HL points to the text after LINK.
526AH - The Link Driver (Copied)
Copied below the top of memory and used as the driver of the first device. The Carry flag set means a request for input. Output goes to the old driver of the first device and then, through the ROM routine at 001BH, to the second device; the flags and Register A that the old driver returned are passed back. Input comes from the old driver, or, if that gives no character (A = 0), from the second device through the ROM routine at 0013H.
5288H - Find a Device Control Block
E and D hold the two letters of a device name. Looks through the device control blocks at 4015H, 401DH, 4025H and 43C0H-43F8H for one with that name at +06H-07H. Returns Z with HL = the block, or NZ with A = 08H (device not available).
52AEH - Error Exits
ISAM 63H - RESET - Offset 2ED6
RESET puts devices back to their start-up state. RESET *xx resets one device: a file it is routed to is closed; the keyboard (KI), display (DO) and printer (PR) get their original control block back, and any other device becomes NIL (type 08H). Without a device, every device is reset: all routed files are closed, the KI, DO and PR blocks are restored, the blocks at 43C0H-43D7H get their original contents (JL as NIL, SI routed to KI, LO routed to DO) and 43D8H-43FFH are cleared. RESET then also gives back the memory above the top of memory by setting 4049H to the top of RAM, unless a timer task still runs above the top of memory (CAN'T RESET MEMORY, FOREGROUND TASK(S) EXIST) or a program has put a jump at 402DH. The screen is cleared when the display was reset. The member loads at 5200H-530BH and 532CH-5404H (485 bytes); 530CH-532BH holds a copy of an FCB while a file is being closed.
5200H - RESET Command
HL points to the text after RESET.
52EAH - Close a Routed File
HL points to a device control block. The chain of routes and links (bit 4 of the type byte, with the next block at +01H-02H) is followed to its end; if that is an open file (bit 7 of byte 0 of its FCB), the FCB is copied to 530CH and the file is closed from the copy.
535CH - Find a Device Control Block
E and D hold the two letters of a device name. Looks through the device control blocks at 4015H, 401DH, 4025H and 43C0H-43F8H for one with that name at +06H-07H. Returns Z with HL = the block, or NZ with A = 08H (device not available).
5382H - Error Exits
ISAM 64H - ROUTE - Offset 30CA
ROUTE sends a device somewhere else: ROUTE *xx *yy routes device xx to device yy, ROUTE *xx filespec routes it to a file, and ROUTE *xx (NIL) makes it NIL. If device xx does not exist, a free device control block (one with no name) is given the name. A file that the device was routed to before is closed first. For a file, ROUTE opens it (creating it if necessary), positions it to its end so that output is added, and lowers the top of memory by 288 bytes for its 256-byte buffer and its FCB; this is not allowed while a program has put a jump at 402DH. The type byte of the block becomes 10H (routed) with +01H-02H pointing to the device block or FCB, or 08H (NIL). The member loads at 5200H-532CH, 534DH-5388H and 53C9H-53EEH (399 bytes); 532DH-534CH is the FCB copy used while closing a file and 5389H-53C8H are the two FCBs.
5200H - ROUTE Command
HL points to the text after ROUTE.
530EH - Close a Routed File
HL points to a device control block. The chain of routes and links (bit 4 of the type byte) is followed to its end; if that is an open file (bit 7 of byte 0 of its FCB), the FCB is copied to 532DH and the file is closed from the copy.
534DH - Error Exits
53C9H - Find a Device Control Block
E and D hold the two letters of a device name (0000H finds a free block). Looks through the device control blocks at 4015H, 401DH, 4025H and 43C0H-43F8H for one with that name at +06H-07H. Returns Z with HL = the block, or NZ with A = 08H (device not available).
ISAM 65H (SET) and 66H (FILTER) - Offset 326C
One member serves two commands that load a program for a device. SET (SET *xx filespec, ISAM 65H, entry 5A01H) loads a driver (default extension /DVR) for device xx; if the device does not exist, a free device control block is given its name. FILTER (FILTER *xx filespec, ISAM 66H, entry 5A00H) loads a filter (default extension /FLT) for an existing device. The loaded program is then started at its transfer address with HL pointing to the rest of the command line and DE to the device control block, so that it can install itself. Not allowed while a program has put a jump at 402DH. This member loads at 5A00H-5B19H (282 bytes), above the 5200H area where other members load; the two FCBs at 5B1AH and 5B3AH lie past it.
5A00H - FILTER and SET Commands
FILTER enters at 5A00H, where the OR AFH makes Register A non-zero; SET enters at 5A01H, the AFH byte, which is XOR A and makes it zero. HL points to the text after the command.
5A82H - Find a Device Control Block
E and D hold the two letters of a device name (0000H finds a free block). Looks through the device control blocks at 4015H, 401DH, 4025H and 43C0H-43F8H for one with that name at +06H-07H. Returns Z with HL = the block, or NZ with A = 08H (device not available).
5AA8H - Error Exits
ISAM 71H - DUMP - Offset 3391
DUMP (DUMP filespec (START=X'hhhh', END=X'hhhh', TRA=X'hhhh'), or S=, E= and T=) writes a block of memory to a file in load module format (default extension /CIM), so that it can be loaded or run again. The file starts with a header record (type 05H) holding the first six letters and digits of the file name, then the memory in load records (type 01H) of up to 254 bytes, each with its load address, and ends with a transfer record (type 02H). START and END default to 6000H and TRA to 402DH; START must not be below 6000H and END not below START. The member loads at 5200H-5389H (394 bytes); the name at 538AH, the FCB at 5390H and the buffer at 5400H lie past it.
5200H - DUMP Command
HL points to the text after DUMP.
52EAH - Error Exits
5359H - Parameter Table
ISAM 72H - PURGE - Offset 3526
PURGE (PURGE :d (MPW=password)) goes through the files of a disk and asks, for each one, PURGE FILE: name/ext ?; if the answer starts with Y, the file is killed and *** PURGED *** is shown. The disk's master password must be given with MPW or typed in answer to MASTER PASSWORD ? (the hash C294H is also accepted). All files in use are offered, including system and invisible files, except the first two positions of the hash index table and extended directory entries. Not allowed while a chain file is running. The member loads at 5200H-5343H, 5346H-5419H, 541EH-5440H and 544EH-5456H (580 bytes); the gaps are work areas, and it reads the GAT into 5600H, the hash index table into 5700H and a typed password into 5500H.
5200H - PURGE Command
HL points to the text after PURGE.
524FH - Offer Each File
HL goes through the hash index table at 5700H column by column: positions 00H, 20H, 40H ... E0H (the eight entries of directory sector 0), then 01H, 21H ... and so on to 1FH-FFH. A position holds the file's hash (0 if free) and is also its directory entry code. The directory sector holding the entry is read into 4200H only when it is not there already; its number is kept at 5277H.
5314H - Check the Master Password
Reads the GAT into 5600H and compares the hash of the password given (MPW, or typed in) with the one in the GAT (CEH-CFH). The hash C294H is also accepted.
5346H - Get a Password
5346H gets the text and returns the hash of its eight characters in HL (SYS2, request 60H). 534CH only gets the text into 5500H, padded with spaces, and returns DE = 5500H. DE = the value from the command: the text itself, or 0000H if none was given, in which case the prompt at HL is displayed and the text is typed in.
53B8H - Read the GAT
Reads the GAT of drive C into 5600H. Returns NZ with A = 14H (GAT read error) if that fails. DE and HL are preserved.
53CBH - Error Exits
544EH - Parameter Table
ISAM 73H - XFER - Offset 3781
XFER (XFER filespec) copies a file from one disk to another in the same drive, with the operator changing disks. The source disk is inserted and the file opened; then the destination disk is inserted and the file opened on it, or created. The file is copied through the memory from 5600H up to the top of memory, as many sectors at a time as fit, with a disk change for each load. Each disk is recognised by 18 bytes of its GAT (CEH-DFH: the master password hash, disk name and date), and XFER keeps asking for the right disk until it is inserted; if the two disks have the same bytes, SOURCE AND DESTINATION DISKS ARE THE SAME is shown. When drive 0 is used, the system disk is asked for whenever the DOS needs it, and the overlay needed next (SYS2, SYS8 or SYS3) is loaded in advance. Each prompt blinks until ENTER is pressed. Not allowed while a chain file is running. The member loads at 5200H-54CDH (718 bytes); the source FCB at 54CEH, the destination FCB at 54EEH and the two copies of GAT bytes at 550EH and 5520H lie past it.
5200H - XFER Command
HL points to the text after XFER.
52B5H - Copy Loop
5333H - Write the Rest
HL points past the last page read. If anything was read, the destination disk is asked for and the pages from 5600H up to HL are written.
5357H - Disk Prompts
5357H asks for the system disk when drive 0 is used. 5364H asks for the source disk and 5381H for the destination disk until the disk in the drive has the GAT bytes CEH-DFH kept at 550EH or 5520H. 539EH compares B bytes at DE and HL (Z if the same). 53A7H displays a prompt and waits for ENTER, blinking the prompt: it is erased and shown again about every half second (by the delay count).
53D4H - Load an Overlay
Each entry calls an overlay with request 00H, which does nothing but leaves the overlay in memory: 53D4H SYS2 (84H), 53D7H SYS8 (8AH), 53DAH SYS3 (85H). The overlay returns to the caller.
53DDH - Read the GAT
Reads the GAT of drive C into 4200H. Returns NZ with A = 14H (GAT read error) if that fails. DE and HL are preserved.
53F0H - Error Exits
ISAM 81H (LOAD) and 82H (RUN) - Offset 3A5E
One member serves two commands. LOAD (LOAD filespec (X), ISAM 81H, entry 5200H) loads a program file (default extension /CMD) into memory and returns to VTOS READY; RUN (ISAM 82H, entry 520DH) loads it and jumps to its transfer address. With X, the program is loaded from a disk that is not the system disk: SYS2 is loaded first, INSERT SOURCE DISK (ENTER) is shown, and after loading INSERT SYSTEM DISK (ENTER). The prompts blink until ENTER is pressed. The member loads at 5200H-52D1H and 52F2H-5324H (261 bytes); 52D2H-52F1H is the FCB.
5200H - LOAD Command
HL points to the text after LOAD.
520DH - RUN Command
HL points to the text after RUN.
5216H - Read the Filespec
Reads the filespec into the FCB with the default extension /CMD and scans the parameters. With X, SYS2 is loaded and the source disk asked for.
5245H - Prompt and Wait for ENTER
Displays the prompt at HL and waits for ENTER, blinking the prompt: it is erased and shown again after a delay.
5272H - Error Messages
52F2H - Load the File
DE points to the FCB. For LOAD, 402DH is on the stack; for RUN, the transfer address is pushed. With X, the system disk is asked for after loading.