TRS-80 DOS - NEWDOS/80 v2.0 for the Model I - Disassembled
Page Index
Overview
NEWDOS/80 v2.0 for the Model I is a Disk Operating System originally written by Cliff Ide and sold by Apparat, Inc..
The system is comprised of 14 DOS overlay modules (SYS0/SYS through SYS13/SYS) and 8 BASIC overlay modules (SYS14/SYS through SYS21/SYS), in addition to the bootstrap loader, BOOT/SYS. Depending on the user's needs, unneeded overlays can be deleted to free up disk space.
For Model I, the DOS uses memory-mapped I/O for the Floppy Disk Controller (FDC) access, requiring only a single Z80 opcode to test and manipulate the controller, making I/O operations more efficient.
The system files do not have corresponding directory entries in the same way as user files, but are instead loaded sequentially via the bootstrap routine.
Disassembly Highlights
This page serves as the index for the commented disassembly of the NEWDOS/80 v2.0 system files. Over time, this section will be populated with summary highlights for each system file/overlay.
How Service Calls Work
In NEWDOS/80, the RST 28H (Restart 28 Hex) instruction serves as the central API for system services and overlay management. It is a single-byte Z80 instruction that functions as a high-speed "trap" to the operating system's kernel (SYSO/SYS). This mechanism allows user programs to invoke complex disk operations, error handling, and system extensions without needing to know the specific memory addresses of those routines, which may shift between different versions of the OS.
The Z80 instruction RST 28H is the gateway to all DOS services. The specific service requested is encoded in the A Register using a 3-part structure, allowing the system to address and call routines within any of the 22 system files.
When an RST 28H is executed, the CPU jumps to memory address 0028H. The system then performs the following steps:
- Request Code Evaluation: The value currently held in the Accumulator (A register) is treated as a Request Code.
- Overlay Management: If the requested function resides in an external system file (SYS1/SYS through SYS21/SYS), the kernel checks if that module is already in the system overlay area. If not, it is loaded from the system disk.
- Context Switching: The system preserves the caller's environment, loads any required parameters from registers (often HL for pointers or C for entry sub-indices), and transfers control to the module.
- BREAK Key Polling: A primary internal use of
RST 28His to poll the keyboard for the BREAK key. If BREAK is pressed, the system can interrupt the current process and return to the DOS prompt (DOSRDY).
The A Register value is interpreted as: xxx yy zzz
| Bits | Label | Value Range |
Purpose |
|---|---|---|---|
| 7-5 | xxx | 0 to 7 (8 functions) | Function Number (Specific routine to execute within the target SYS file). |
| 4-3 | yy | 0 to 3 (4 files) | File Number (Index of the file within its Directory Sector). Note: The NEWDOS/80 format typically only uses 3 files per sector, limiting this to 0-2. |
| 2-0 | zzz | 0 to 7 (8 sectors) | Directory Sector Index (The track/sector pair where the file's entry resides). |
| Request Code (A) | Primary Function | Technical Description |
|---|---|---|
| 23H | Command Processing | Invokes the CCP (Console Command Processor) in SYS1/SYS to interpret a command string. |
| 24H | File Open/Create | Calls SYS2/SYS to initialize a File Control Block (FCB) and locate/create a file on disk. |
| 25H | File Close | Calls SYS3/SYS to flush buffers and update the Directory Entry (FDE/GAT) for an open file. |
| 26H | Error Messaging | Loads SYS4/SYS (DOSERR) to display an error message corresponding to the code in A. |
| 27H | System Debugger | Loads SYS5/SYS to enter the interactive DEBUG/MONITOR environment. |
| 45H | File Deletion | Calls SYS3/SYS (KILL) to remove a file and release its assigned sectors (GRANs). |
| E5H | Utility Entry | Generic entry point for various system utilities located in SYS3/SYS (e.g., Clock, V+). |
he total number of addressable files is 8 (sectors)×3 (files per sector)=24 slots. Since NEWDOS/80 uses SYS0/SYS to SYS21/SYS (22 files), almost all slots are used.
The system files are loaded based on their location on the disk, not their sequential number (e.g., SYS6/SYS is file 1 of Sector 2).
| File Name | SVC File Index ($yy$) | SVC Sector Index ($zzz$) | Register A Base Value (Binary/Hex) | Directory Sector (on Disk) |
|---|---|---|---|---|
| SYS0/SYS | 00 | 010 (2) | $xx0 \ 00 \ 010$ (xx2H) | 4 |
| SYS1/SYS | 00 | 011 (3) | $xx0 \ 00 \ 011$ (xx3H) | 5 |
| SYS2/SYS | 00 | 100 (4) | $xx0 \ 00 \ 100$ (xx4H) | 6 |
| SYS3/SYS | 00 | 101 (5) | $xx0 \ 00 \ 101$ (xx5H) | 7 |
| SYS4/SYS | 00 | 110 (6) | $xx0 \ 00 \ 110$ (xx6H) | 8 |
| SYS5/SYS | 00 | 111 (7) | $xx0 \ 00 \ 111$ (xx7H) | 9 |
| SYS6/SYS | 01 | 010 (2) | $xx0 \ 01 \ 010$ (xxAH) | 4 |
| SYS7/SYS | 01 | 011 (3) | $xx0 \ 01 \ 011$ (xxBH) | 5 |
| SYS8/SYS | 01 | 100 (4) | $xx0 \ 01 \ 100$ (xxCH) | 6 |
| SYS9/SYS | 01 | 101 (5) | $xx0 \ 01 \ 101$ (xxDH) | 7 |
| SYS10/SYS | 01 | 110 (6) | $xx0 \ 01 \ 110$ (xxEH) | 8 |
| SYS11/SYS | 01 | 111 (7) | $xx0 \ 01 \ 111$ (xxFH) | 9 |
| SYS12/SYS | 10 | 010 (2) | $xx1 \ 00 \ 010$ (x12H) | 4 |
| SYS13/SYS | 10 | 011 (3) | $xx1 \ 00 \ 011$ (x13H) | 5 |
| SYS14/SYS | 10 | 100 (4) | $xx1 \ 00 \ 100$ (x14H) | 6 |
| SYS15/SYS | 10 | 101 (5) | $xx1 \ 00 \ 101$ (x15H) | 7 |
| SYS16/SYS | 10 | 110 (6) | $xx1 \ 00 \ 110$ (x16H) | 8 |
| SYS17/SYS | 10 | 111 (7) | $xx1 \ 00 \ 111$ (x17H) | 9 |
| SYS18/SYS | 11 | 010 (2) | $xx1 \ 10 \ 010$ (x22H) | 4 |
| SYS19/SYS | 11 | 011 (3) | $xx1 \ 10 \ 011$ (x23H) | 5 |
| SYS20/SYS | 11 | 100 (4) | $xx1 \ 10 \ 100$ (x24H) | 6 |
| SYS21/SYS | 11 | 101 (5) | $xx1 \ 10 \ 101$ (x25H) | 7 |
BOOT/SYS
Purpose:
The BOOT/SYS module is the initial loader for the NEWDOS/80 v2.0 Disk Operating System on the TRS-80 Model I. Its primary purpose is to load and execute the next stage of the DOS, SYS0/SYS, from the floppy disk into RAM.
This module operates by using the Z80's alternate register set (BC', DE', HL') to efficiently manage pointers for both Floppy Disk Controller (FDC) operations and the RAM load location.
Disassembly:
A disassembly of BOOT/SYS can be found here.
SYS0/SYS
Purpose:
This is the core resident module of NEWDOS/80. It is loaded by the bootstrap routine (BOOT/SYS) and occupies memory from 4000H to 4CFFH, remaining permanently in main memory. It contains the DOS Jump Table (starting at 400CH) for fixed system service entry points.
The module is responsible for essential functions:
- DOS Initialization: Performs RAM detection, cold/warm boot checking, and sets up drive parameters (the main init code starts at 4D00H in the overlay area).
- Core I/O: Provides the fundamental Disk I/O routines (sector read/write) and manages the Device Driver Chain.
- System Services: Handles Clock Interrupts, manages system variables (Date/Time), and implements the Keyboard Intercept routines.
Role:
Provides all the fundamental, non-changing operating system services:
- Low-level disk I/O (reading and writing raw sectors).
- Basic file system primitives (e.g., searching the directory, opening/closing files).
- Interrupt handling (for the clock and disk controller).
- Fixed entry points for character output and program exit/error handling via the DOS Jump Table (starting at 400CH).
Calling Mechanism (SVC Target): SYS0/SYS routines are called constantly by the transient command modules (SYS1-SYS7) for essential services that must be immediately available.
SVC Interface:
The routines within this module, and all other system files, are primarily accessed using the Supervisor Call Interface (SVC) via the Z80 instruction RST 28H.
SYS0/SYS is located in Directory Sector 4 and is the first file (file 0) in that sector.
Popular Called Routines:
Transient command overlays (SYS1-SYS7) rely heavily on SYS0/SYS for basic I/O and file system services. The most frequently accessed resident entry points are:
| Address/SVC | Function | Called By |
| 400CH (Jump) | Character Output | All transient commands (e.g., DIR, LIST, DEBUG) for displaying messages, prompts, and file content. |
| 402DH (Jump) | DOS Ready/Error Exit | The standardized address where all transient commands return upon successful completion or error to re-enter the main DOS command loop. |
| RST 28H (SVC Call) | Disk/File I/O Services | Commands performing disk operations (COPY, KILL, BACKUP, FORMAT). This includes high-level functions like Open File, Close File, Directory Search, and low-level Read/Write Sector. |
| 4809H-49FBH (Internal) | FCB Management | Used by file-manipulation commands (e.g., RENAME, KILL, COPY) to manipulate File Control Blocks and search the disk directory. |
Disassembly:
A detailed, commented disassembly of SYS0/SYS can be found here.
SYS1/SYS
Purpose:
This module functions as the Command Interpreter or Parser for the Disk Operating System. It is loaded into the transient DOS overlay area (starting around 5000H) when required, overwriting the initialization code of SYS0/SYS.
Its primary responsibility is to:
- Interrogate and interpret the command line input entered by the user.
- Tokenize the command and parse any subsequent file or drive parameters.
- Determine which subsequent DOS overlay module (like SYS2/SYS, SYS5/SYS, etc.) is needed to execute the requested command.
- Dispatch control to the appropriate execution routine via the SVC mechanism.
SVC Interface:
Routines within SYS1/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS1/SYS is located in Directory Sector 5 and is the first system file (file 0) in that sector.
Disassembly:
A detailed, commented disassembly of SYS1/SYS can be found here.
SYS2/SYS
Purpose:
This module contains the primary execution routines for a large block of Disk Operating System (DOS) commands. It is a transient overlay, loaded by SYS1/SYS into the overlay area (starting around 5000H) when a supported command is identified.
SYS2/SYS executes the following DOS commands:
- JCL (Job Control Language)
- PATCH
- ATTRIB (Attribute)
- PROT (Protect)
- PURGE
- VERIFY
- SCOPY (Sector Copy)
- FCOPY (File Copy - an alternate copy routine)
Note that common commands like DIR, COPY, RENAME, and KILL are handled by later, separate DOS overlays (SYS4/SYS through SYS9/SYS), while the BASIC-related commands (LOAD, RUN, SAVE) are handled by the BASIC overlays (SYS19/SYS).
SVC Interface:
Routines within SYS2/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS2/SYS is located in Directory Sector 6 and is the first system file (file 0) in that sector.
Disassembly:
A detailed, commented disassembly of SYS2/SYS can be found here.
SYS3/SYS
Purpose:
This transient module contains utilities and file handling routines primarily centered on the File Control Block (FCB). It is loaded by SYS1/SYS into the overlay area (starting around 5000H) when needed to perform its specific functions.
SYS3/SYS provides the code for the following functions:
- DATE/TIME Setting: Routines to prompt the user and set the current system date and time, which is stored in SYS0/SYS resident variables.
- FCB Management: Lower-level routines for file record positioning and handling within the context of an open FCB.
- Command Execution: It executes the PRINT command, which in this context is likely used for direct console output or simple device I/O, as well as the CLOCK command.
- File Utility Routines: Includes the code for the FORMAT command, the core utility for initializing diskettes.
SVC Interface:
Routines within SYS3/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS3/SYS is located in Directory Sector 7 and is the first system file (file 0) in that sector.
Disassembly:
A detailed, commented disassembly of SYS3/SYS can be found here.
SYS4/SYS
Purpose:
This module provides essential file management routines and utility commands focused on system configuration and disk/file verification. It is a transient overlay, loaded by the command parser (SYS1/SYS) when required.
SYS4/SYS executes the following DOS commands and functions:
- BACKUP: The primary routine used to create a backup copy of an entire diskette.
- FREE: Reports the amount of free space (in granules or sectors) remaining on a specified disk drive.
- TDISK (Tape Disk): This command allows file transfer between diskettes and cassette tapes.
- System Message Strings: A significant portion of this file is dedicated to storing error and informational message strings used by the system during command execution (e.g., "MISMATCH", "INSUFFICIENT", "COMPATIBLE").
SVC Interface:
Routines within SYS4/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS4/SYS is located in Directory Sector 8 and is the first system file (file 0) in that sector.
Disassembly:
A detailed, commented disassembly of SYS4/SYS can be found here.
SYS5/SYS
Purpose:
SYS5/SYS is DEBUG, the machine language monitor. SYS0 loads it with RST 28H code 27H from 4609H, the target of RST 30H (a breakpoint) and of the DEBUG vector 440DH: after a breakpoint, the 1-2-3 key combination, or a program loaded and run after the DEBUG command. It overlays the area 4D00H-51E7H.
Commands (one line at the bottom of the screen; numbers in hexadecimal):
- X and S (register display with three memory windows, or a full screen of memory)
- D (set a window's address), ; and - (move a window)
- M (change memory with a cursor)
- R (change a register)
- G (resume the program, with up to two breakpoints)
- I and C (single step; C runs a CALL to its end)
- F (find a byte string)
- L and WR (read or write a diskette sector through 4200H)
- Q (abandon the program, DOS READY)
SVC Interface:
Routines within SYS5/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS5/SYS is located in Directory Sector 9 and is the first system file (file 0) in that sector.
Disassembly:
A detailed, commented disassembly of SYS5/SYS can be found here.
SYS6/SYS
Purpose:
This transient module provides the core execution routines for the most frequently used file management commands. It is loaded by the command parser (SYS1/SYS) into the overlay area (starting around 4D00H) when one of its supported commands is entered.
SYS6/SYS implements the following critical DOS commands:
- COPY: The main routine for copying files from one location to another, supporting various options and drive specifications. The command syntax parsing for the "TO" keyword is contained within this module.
- RENAME: The routine for changing the name of an existing file on the disk.
- DIR (Directory): The code responsible for reading the disk directory sectors and displaying the file list, typically in a formatted, multi-column output.
In the overall system file structure, this module provides the heavy-lifting file manipulation and directory listing capabilities that were not included in the resident SYS0/SYS.
SVC Interface:
Routines within SYS6/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS6/SYS is located in Directory Sector 2 and is the second system file (file 1) in that sector.
Disassembly:
A detailed, commented disassembly of SYS6/SYS can be found here.
SYS7/SYS
Purpose:
SYS7/SYS is a transient overlay (4D00H-51E7H) called by SYS1 with RST 28H code E9H and the sub-function in Register C. It implements the following library commands:
- SYSTEM, PDRIVE and PURGE: reads the drive (and checks a diskette password), then passes the command on to SYS17, SYS16 or SYS3.
- HIMEM: displays or sets the top of memory for programs (4049H).
- AUTO: stores the command to be run at reset in the GAT of drive 0.
- ATTRIB: changes a file's attributes (INV, VIS, PROT=, ACC=, UPD=, ASE=, ASC=, UDF=, LRL=).
- PROT: changes a diskette's password, name and date, and LOCKs or UNLOCKs its files (RUF resets their updated flags).
- DUMP: writes memory to a file in load module format.
- TIME and DATE: display or set the clock and the date.
SVC Interface:
Routines within SYS7/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS7/SYS is located in Directory Sector 3 and is the second system file (file 1) in that sector.
Disassembly:
A detailed, commented disassembly of SYS7/SYS can be found here.
SYS8/SYS
Purpose:
SYS8/SYS is a transient overlay (4D00H-51E7H) that implements the DIR command (RST 28H code 2AH), with the options A, S, I, U, P, /ext and $, and the FREE command (code 4AH), which shows the free FDEs and granules of every drive.
SVC Interface:
Routines within SYS8/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS8/SYS is located in Directory Sector 6 and is the second system file (file 1) in that sector.
Disassembly:
A disassembly of SYS8/SYS can be found here.
SYS9/SYS
Purpose:
SYS9/SYS is a transient overlay (4D00H-51DFH). It runs chain files for CHAIN and DO (the SYS0 keyboard driver asks it for each key with code CBH), with CHNON and the control codes 80H-85H; keeps the list of *name routines (4461H and 4464H, codes 2BH and 4BH) and runs them for commands starting with *; and holds MDCOPY, BASIC2, BOOT, PAUSE and STMT, plus the DOS FATAL ERROR and 'RUN ONLY' STOPPED stops used by SYS1's exit code.
SVC Interface:
Routines within SYS9/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS9/SYS is located in Directory Sector 7 and is the second system file (file 1) in that sector.
Disassembly:
A disassembly of SYS9/SYS can be found here.
SYS10/SYS
Purpose:
SYS10/SYS is a BASIC overlay: the GET and PUT statements for random files, with record numbers, the position characters * # $ % & ! and the item lists (IGEL) of the marked and fixed item file types. It must be on the system diskette if either statement is to be executed.
SVC Interface:
BASIC loads SYS10/SYS with RST 28H code 2CH (directory slot 0CH, BASIC 6131H) and then jumps to 4D03H; it reloads it the same way after every DOS call made during the statement.
Disassembly:
A disassembly of SYS10/SYS can be found here.
SYS11/SYS aka OVERLAY 11
Purpose:
SYS11/SYS is a BASIC overlay: the second part of RENUM (SYS13 does the first). It builds a table of line addresses, scans the program twice (first to check every line number reference and list errors, then to rewrite them), moves the renumbered lines into place and puts the new numbers into the lines. It must be on the system diskette if RENUM will be executed.
SVC Interface:
SYS13 loads SYS11/SYS with RST 28H code 2DH (directory slot 0DH). It loads at 4D0CH so that SYS13's RENUM parameters at 4D00H-4D0BH are kept.
Disassembly:
A disassembly of SYS11/SYS can be found here.
SYS12/SYS
Purpose:
SYS12/SYS is a BASIC overlay: the REF command, a cross reference of the line numbers, variable names and text used in the program (REF, REF @n, REF name, REF number, REF "text, REF =text, REF * and REF $, with $ also printing). It must be on the system diskette if REF will be executed.
SVC Interface:
SYS12/SYS is called through RST 28H by BASIC's direct statement code in SYS18 (555DH). It stays in the overlay area afterwards, which lets a plain REF continue the last search.
Disassembly:
A disassembly of SYS12/SYS can be found here.
SYS13/SYS
Purpose:
SYS13/SYS holds the texts of all BASIC error messages, which BASIC shows through the ROM's error link at 41A6H (so it must be on the system diskette whenever BASIC is active), and the first part of RENUM (parameters, new numbers in the link fields, line count), after which it loads SYS11.
SVC Interface:
The ROM's error routine calls 41A6H, where BASIC has put LD A,2FH / RST 28H (code 2FH, directory slot 0FH, function 1); RENUM uses code 4FH (function 2) from SYS18. The transfer address is 4D0CH; 4D00H-4D0BH hold the RENUM parameters.
Disassembly:
A disassembly of SYS13/SYS can be found here.
SYS14/SYS
Purpose:
SYS14/SYS holds the DOS commands ROUTE (device routing, including routes to a driver in memory with MM=), CREATE (with LRL=, REC= pre-allocation and zero fill, ASE= and ASC=), CLEAR (routes, *name list, timer chain, HIMEM, memory fill), LIST and PRINT (text files) and ERROR (DOS error messages).
SVC Interface:
SYS1 calls SYS14/SYS with RST 28H code F0H (function 7 of directory slot 10H) and the sub-function in Register C: 1 ROUTE, 2 CREATE, 4 CLEAR, 5 LIST, 6 PRINT, 7 ERROR; 3 is the return path after another overlay has run.
Disassembly:
A disassembly of SYS14/SYS can be found here.
SYS15/SYS
Purpose:
In NEWDOS/80 v2.0 for the Model I, SYS15/SYS is an empty module: XOR A / RET at 4D00H and 1,254 zero bytes. It holds no commands (the FORMS and SETCOM claimed here before are not in the file), and no part of the Model I system calls it.
SVC Interface:
Directory slot 11H (RST 28H codes 31H, 51H ... F1H); no module or command table entry uses it.
Disassembly:
A disassembly of SYS15/SYS can be found here.
SYS16/SYS
Purpose:
SYS16/SYS finishes the PDRIVE command: it reads a diskette's system data sector, changes (TI=, TD=, TC=, SPT=, TSR=, GPL=, DDSL=, DDGA=) or copies drive records 0-9, computes each record's derived bytes and checks them, writes the sector back and shows the table; for drive 0 the options A and B also (or only) update the in-memory table at 4371H.
SVC Interface:
SYS7 calls SYS16/SYS with RST 28H code 32H (function 1 of directory slot 12H), Register B = the drive and HL = the rest of the command line.
Disassembly:
A disassembly of SYS16/SYS can be found here.
SYS17/SYS
Purpose:
SYS17/SYS holds the SYSTEM command (setting and showing the options in a diskette's system data sector, table at 4F24H), the WRDIRP command (rewriting the directory sectors with the directory data mark; needs option BK) and, since zap 057, the end of a diskette COPY (verify the rest of the destination, update its GAT), which SYS6 calls at 501CH.
SVC Interface:
SYSTEM comes from SYS7 with RST 28H code 33H and Register B = the drive; WRDIRP is code 53H from SYS1's command table; SYS6 loads SYS17 with code F3H (C = FFH) and jumps to 501CH.
Disassembly:
A disassembly of SYS17/SYS can be found here.
SYS18/SYS
Purpose:
SYS18/SYS is a BASIC overlay (loaded at 5200H) for the command line: it reads the line with single-key listing (@ : . / ; up and down arrow) and a comma for EDIT, expands the abbreviations A, D, E, L, carries out DU and DI (duplicate or move a line), RENEW, and starts RENUM (SYS13) and REF (SYS12). It must be on the system diskette whenever BASIC is active.
SVC Interface:
BASIC loads SYS18/SYS with RST 28H code 34H (directory slot 14H) through its loader at 576CH, from the ROM's links 41AFH (line input, entry 5202H) and 41B2H (after tokenizing, entry 54FFH).
Disassembly:
A disassembly of SYS18/SYS can be found here.
SYS19/SYS
Purpose:
SYS19/SYS is a BASIC overlay (loaded at 5200H) that moves programs between memory and the diskette: LOAD and RUN with a file name (R keeps files open, V keeps the variables), MERGE, SAVE (memory image, or text with A) and CMD"F",DELETE (delete lines in a running program, keeping the variables). It keeps string variables valid when the lines holding their text move or go.
SVC Interface:
BASIC loads SYS19/SYS with RST 28H code 35H (directory slot 15H) through its loader at 576CH and enters it at 5202H (LOAD, RUN), 5334H (MERGE), 559CH (CMD"F") or 55C5H (SAVE).
Disassembly:
A disassembly of SYS19/SYS can be found here.
SYS20/SYS
Purpose:
SYS20/SYS carries the less used BASIC statements and functions: CMD"command" (a DOS command, run as a MINI-DOS command or, if needed, as a full DOS command with BASIC swapped out of 5200H-70FFH), CMD"S=" and CMD"F=" (the functions POPS, POPR and POPN are here), user functions (FN), INSTR, MID$ on the left side of an assignment, &H and &O constants, OPEN, the reading of INPUT# and READ items from a file, and LINE INPUT. It loads at 5200H-56E7H, like SYS18 and SYS19.
SVC Interface:
BASIC/CMD loads SYS20/SYS through its overlay loader at 576CH with RST 28H code 36H (function 1 of directory slot 16H), then jumps to the entry for the statement: 5202H CMD, 534AH FN, 53F2H INSTR, 5462H MID$=, 54C5H &H/&O, 5504H OPEN, 55D4H INPUT# and READ items, 55E8H LINE INPUT.
Disassembly:
A disassembly of SYS20/SYS can be found here.
SYS21/SYS
Purpose:
SYS21/SYS sorts BASIC arrays for CMD"O" (one or more arrays as the rows of a table, several sort keys, descending keys, parts of string keys, and an index sort that sorts only an integer array of element numbers) and deletes variables for CMD"F=ERASE" and CMD"F=KEEP". It loads into the overlay area at 4D00H-51E7H and uses 4200H and the BASIC overlay area 5200H-56FFH as work space.
SVC Interface:
BASIC/CMD calls SYS21/SYS with RST 28H: code 37H (function 1 of directory slot 17H) for CMD"O" from 57B3H, code 57H (function 2) for ERASE (Register B = 28H, from 57AAH) and KEEP (B = 20H, from 57AEH). Any other code gives DOS error 2AH.
Disassembly:
A disassembly of SYS21/SYS can be found here.
BASIC/CMD
Purpose:
BASIC extension module that handles disk BASIC operations.
Disassembly:
A disassembly of BASIC/CMD can be found here.