TRS-80 DOS - NEWDOS/80 v2.0 for the Model I - Disassembled

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

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.

The A Register value is interpreted as: xxx yy zzz

Bits Label Value
Range
Purpose
7-5xxx0 to 7 (8 functions)Function Number (Specific routine to execute within the target SYS file).
4-3yy0 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-0zzz0 to 7 (8 sectors)Directory Sector Index (The track/sector pair where the file's entry resides).

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/SYS00010 (2)$xx0 \ 00 \ 010$ (xx2H)4
SYS1/SYS00011 (3)$xx0 \ 00 \ 011$ (xx3H)5
SYS2/SYS00100 (4)$xx0 \ 00 \ 100$ (xx4H)6
SYS3/SYS00101 (5)$xx0 \ 00 \ 101$ (xx5H)7
SYS4/SYS00110 (6)$xx0 \ 00 \ 110$ (xx6H)8
SYS5/SYS00111 (7)$xx0 \ 00 \ 111$ (xx7H)9
SYS6/SYS01010 (2)$xx0 \ 01 \ 010$ (xxAH)4
SYS7/SYS01011 (3)$xx0 \ 01 \ 011$ (xxBH)5
SYS8/SYS01100 (4)$xx0 \ 01 \ 100$ (xxCH)6
SYS9/SYS01101 (5)$xx0 \ 01 \ 101$ (xxDH)7
SYS10/SYS01110 (6)$xx0 \ 01 \ 110$ (xxEH)8
SYS11/SYS01111 (7)$xx0 \ 01 \ 111$ (xxFH)9
SYS12/SYS10010 (2)$xx1 \ 00 \ 010$ (x12H)4
SYS13/SYS10011 (3)$xx1 \ 00 \ 011$ (x13H)5
SYS14/SYS10100 (4)$xx1 \ 00 \ 100$ (x14H)6
SYS15/SYS10101 (5)$xx1 \ 00 \ 101$ (x15H)7
SYS16/SYS10110 (6)$xx1 \ 00 \ 110$ (x16H)8
SYS17/SYS10111 (7)$xx1 \ 00 \ 111$ (x17H)9
SYS18/SYS11010 (2)$xx1 \ 10 \ 010$ (x22H)4
SYS19/SYS11011 (3)$xx1 \ 10 \ 011$ (x23H)5
SYS20/SYS11100 (4)$xx1 \ 10 \ 100$ (x24H)6
SYS21/SYS11101 (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/SVCFunctionCalled By
400CH (Jump)Character OutputAll transient commands (e.g., DIR, LIST, DEBUG) for displaying messages, prompts, and file content.
402DH (Jump)DOS Ready/Error ExitThe 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 ServicesCommands 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 ManagementUsed 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:

This transient module provides the complete implementation of the powerful Z80 DEBUGGER program. It is loaded by the command parser (SYS1/SYS) when the user types the DEBUG command. It overlays other transient DOS commands in the area starting around 4D00H.

SYS5/SYS provides the routines for all standard debugger functions, allowing the user to inspect and modify memory and registers for advanced troubleshooting. Key commands implemented in this overlay include:

  • D (Display memory)
  • S (Set memory)
  • R (Register display/set)
  • B (Set Breakpoints)
  • T (Trace/Single-step)
  • G (Go/Execute)
  • F (Find/Search memory pattern)

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:

This module provides execution routines for several key file maintenance commands, including the primary routines for deleting and printing files. It is a transient overlay, loaded by the command parser (SYS1/SYS) into the overlay area (starting around 4D00H) when one of its supported commands is executed.

SYS7/SYS implements the following commands:

  • KILL: The routine responsible for deleting (unlinking and marking as free) a file or a set of files on the disk. This involves updating the disk directory structure.
  • LIST: The routine for displaying the content of an ASCII text file to the console or other output device.
  • CMD: This command allows the user to execute another program or batch file from within the DOS environment, providing a sub-shell like capability.
  • MEMSIZE: The routine for displaying or adjusting the high memory pointer (the top of available RAM), typically used to reserve space for machine code programs.

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:

This module implements the DIR DOS command for NEWDOS/80 v2.0 on the TRS-80 Model I. The DIR command displays directory information for files on a diskette, with extensive filtering and display options.

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:

This module contains the routines associated with BASIC2, BOOT, CHAIN and DO, CHNON, MDCOPY, PAUSE, and STMT

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 module responsible for handling GET and PUT, and must be on the system diskette if either statement is to be executed.

SVC Interface:

Routines within SYS10/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS10/SYS is located in Directory Sector 8 and is the second system file (file 1) in that sector.

Disassembly:

A disassembly of SYS10/SYS can be found here.

SYS11/SYS aka OVERLAY 11

Purpose:

SYS11/SYS executes BASIC direct command RENUM. Must be on the system diskette if RENUM will be executed

SVC Interface:

Routines within SYS11/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS11/SYS is located in Directory Sector 9 and is the second system file (file 1) in that sector.

Disassembly:

A disassembly of SYS11/SYS can be found here.

SYS12/SYS

Purpose:

SYS12/SYS executes BASIC direct command REF. Must be on the system diskette if REF will be executed.

SVC Interface:

Routines within SYS12/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS12/SYS is located in Directory Sector 4 and is the third system file (file 2) in that sector.

Disassembly:

A disassembly of SYS12/SYS can be found here.

SYS13/SYS

Purpose:

SYS13/SYS displays BASIC's error messages and executes 1st part of RENUM. Must be on the system diskette whenever BASIC is active.

SVC Interface:

Routines within SYS13/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS13/SYS is located in Directory Sector 5 and is the third system file (file 2) in that sector.

Disassembly:

A disassembly of SYS13/SYS can be found here.

SYS14/SYS

Purpose:

This module is the executor for the DOS commands CLEAR, CREATE, ERROR, LIST, PRINT and ROUTE..

SVC Interface:

Routines within SYS14/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS14/SYS is located in Directory Sector 6 and is the third system file (file 2) in that sector.

Disassembly:

A disassembly of SYS14/SYS can be found here.

SYS15/SYS

Purpose:

This module is the executor for the DOS commands FORMS and SETCOM..

SVC Interface:

Routines within SYS15/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS15/SYS is located in Directory Sector 7 and is the third system file (file 2) in that sector.

Disassembly:

A disassembly of SYS15/SYS can be found here.

SYS16/SYS

Purpose:

This module is the executor for most of PDRIVE.

SVC Interface:

Routines within SYS16/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS16/SYS is located in Directory Sector 8 and is the third system file (file 2) in that sector.

Disassembly:

A disassembly of SYS16/SYS can be found here.

SYS17/SYS

Purpose:

This module is the executor for WRDIRP and most of SYSTEM.

SVC Interface:

Routines within SYS17/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS17/SYS is located in Directory Sector 9 and is the third system file (file 2) in that sector.

Disassembly:

A disassembly of SYS17/SYS can be found here.

SYS18/SYS

Purpose:

SYS18/SYS is the BASIC direct statement executor. Must be on the system diskette whenever BASIC is active.

SVC Interface:

Routines within SYS18/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS18/SYS is located in Directory Sector 4 and is the fourth system file (file 3) in that sector.

Disassembly:

A disassembly of SYS18/SYS can be found here.

SYS19/SYS

Purpose:

This module is the executor for the core BASIC statements that handle file loading and execution: `LOAD`, `RUN`, `MERGE`, `SAVE`, and a version of the command `CMD"F"DELETE`. It must be on the system diskette whenever BASIC is active.

SVC Interface:

Routines within SYS19/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS19/SYS is located in Directory Sector 5 and is the fourth system file (file 3) in that sector.

Disassembly:

A disassembly of SYS19/SYS can be found here.

SYS20/SYS

Purpose:

This module is the executor for a number of disk BASIC statements and is typically the module resident when a BASIC program is actively executing. It must be on the system diskette whenever BASIC is active.

SVC Interface:

Routines within SYS20/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS20/SYS is located in Directory Sector 6 and is the fourth system file (file 3) in that sector.

Disassembly:

A disassembly of SYS20/SYS can be found here.

SYS21/SYS

Purpose:

SYS21/SYS is the executor for CMD"O" and must be on the system diskette if CMD"O" will be executed.

SVC Interface:

Routines within SYS21/SYS are accessed via the Supervisor Call Interface (RST 28H). SYS21/SYS is located in Directory Sector 7 and is the fourth system file (file 3) in that sector.

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.