Fact-checked by Grok 2 weeks ago

TRSDOS

TRSDOS, or , was the official developed by for its series of Z80-based microcomputers sold through stores. It provided core functionality for file management, input/output operations, and program loading from floppy disks, serving as the foundational software layer that enabled disk-based computing on these early personal computers. First introduced in 1978 alongside the TRS-80 Model I's disk expansion, TRSDOS evolved through multiple versions to support subsequent models, incorporating features like double-density and extended commands while addressing the limitations of 1970s hardware such as unreliable floppy drives. The origins of TRSDOS trace back to 1978, when commissioned software engineer Randy Cook to develop a for the Model I, paying him $3,000 for the project after recommendations from floppy drive manufacturer . Cook's initial release, TRSDOS , arrived bundled with the Model I's Expansion and disk drives but suffered from significant bugs, including directory corruption issues often exacerbated by hardware flaws. A revised TRSDOS 2.1 followed shortly thereafter with major fixes, introducing innovative elements like password protection, program overlays for memory efficiency, and hashed access for faster retrieval—features that were advanced for the era and influenced later operating systems such as LDOS and NEWDOS/80. For the TRS-80 Model III, launched on July 30, 1980, Tandy developed a new iteration of TRSDOS in-house, drawing partial inspiration from the more business-oriented Model II version. This Model III TRSDOS, starting with version 1.0 and culminating in 1.3 by early 1981, supported 180K double-density disks on 40-track drives, included a HELP command for user assistance, and integrated Disk BASIC with Model I compatibility, though it limited file dating to month and year only. Minor updates continued until 1984, enhancing reliability but without a planned 1.4 release materializing. The most advanced variant, TRSDOS 6.x, debuted with the TRS-80 Model 4 in 1983 and was essentially a rebranded, licensed edition of Logical Systems' LDOS, optimized for all-RAM configurations on Z80 processors. Version 6.2, the standard for the Model 4, offered hardware independence, support for hard drives, a wide array of peripherals, and commands like CONV for converting between TRSDOS formats, making it compatible with earlier systems while introducing device drivers, redirection, and filtering capabilities. TRSDOS 6.x represented a pinnacle of TRS-80 software evolution, providing a portable and robust environment that extended the platform's viability into the mid-1980s amid competition from more advanced systems.

Overview

Description

TRSDOS, or Tandy Radio Shack , served as the primary disk operating system for the line of eight-bit microcomputers powered by the processor. It was a single-user, single-tasking environment designed to manage disk-based storage and operations on these machines sold through stores. As the official operating system from , TRSDOS was the primary OS for disk-equipped systems in the line. Pronounced "triss-doss," TRSDOS was initially developed to enable expansion for the Model I, allowing users to move beyond storage for faster and more reliable data handling. The system operated through a with no or multitasking capabilities, reflecting the hardware constraints of the era. Originally closed-source , TRSDOS achieved greater memory efficiency through an overlay architecture, where system routines loaded into a area as needed, conserving limited resources. In 1984, Logical Systems published the commented assembler for TRSDOS 6.2.0 in a three-volume set titled "," making it accessible for study and modification by developers.

Supported Platforms

TRSDOS was primarily designed for the microcomputer, introduced in 1977, which served as the initial platform with its Z80 CPU running at 1.77 MHz. The operating system was later adapted for the , released in 1980, featuring an upgraded Z80 CPU at 2 MHz and integrated hardware. Compatibility extended to the in 1983, equipped with a faster 4 MHz Z80A CPU and enhanced expandability, while a distinct variant of TRSDOS existed separately for the business-oriented Model II and Model 12 systems. All supported platforms shared core hardware requirements centered on the Z80 processor family, enabling TRSDOS to manage disk-based operations efficiently. Systems required at least one 5¼-inch single-sided double-density (SSDD) drive, with support for up to four such drives; these drives typically featured 35 to 40 tracks per side, providing approximately 180 KB of storage capacity per side through 18 sectors of 256 bytes each. Optional hard disk support was introduced in later versions, particularly TRSDOS 6.x for the Model 4, accommodating drives with up to eight partitions for expanded storage. Memory requirements varied by version and model but started at a minimum of 16 KB for basic TRSDOS functionality on the Model I, including support for Disk , though later iterations like version 2.3 mandated 32 KB. The Model III supported configurations from 16 KB up to 48 KB, while the Model 4 allowed up to 128 KB, including 64 KB of that could be configured as a virtual MemDisk drive under TRSDOS 6 for rapid access akin to a RAM-based disk. Standard peripherals included a monitor for display output, an integrated keyboard for input, and an serial port for external device connectivity, all of which were built into the Model III and Model 4 chassis. Earlier Model I systems relied on an external Expansion Interface for disk controllers and additional peripherals, but TRSDOS versions from 6.x onward introduced greater device independence, allowing flexible mapping of logical drives to physical hardware like printers or modems without fixed port dependencies.

History

Origins

TRSDOS, the Tandy Radio Shack , was developed by programmer Randy Cook under contract with in 1978 to serve as the first official for the TRS-80 Model I's disk expansion interface. Cook, recommended by —the supplier of the TRS-80's floppy drives—for his expertise in disk systems, was paid $3,000 for the work, which integrated closely with the system's Level II ROM and the forthcoming Disk extension. The operating system was initially referred to simply as "" during early development phases before being officially named TRSDOS to reflect its ties to Tandy and . The primary motivation behind TRSDOS's creation was to overcome the limitations of the TRS-80 Model I's original storage, which was slow and unreliable for loading and saving programs, by enabling faster and more capacious operations. This allowed users to store and access larger programs, data files, and utilities efficiently, supporting up to four 85 single-sided, single-density drives per system and facilitating the growth of third-party software ecosystems. Development occurred amid the rapid evolution of the platform, launched in August 1977, with TRSDOS ready for public release alongside the disk expansion hardware in July 1978. TRSDOS was tailored specifically to the Zilog Z80 microprocessor architecture of the , ensuring tight integration with the system's but limiting portability to other platforms. Early versions faced significant challenges, including numerous bugs in the initial TRSDOS 2.0 release, which was not intended for widespread distribution and caused issues like unreliable file handling. These problems prompted a quick revision to TRSDOS 2.1, which addressed major flaws but still suffered from occasional directory corruption, often exacerbated by hardware inconsistencies such as faulty floppy drive cables or power fluctuations. Cook's solo authorship contributed to these initial hurdles, though the system laid the groundwork for subsequent improvements.

Versions and Evolution

TRSDOS for the Model I began with , released in July 1978 as the initial public version supporting granule-based disk organization. This release, developed by Randy Cook, introduced core disk operations but suffered from significant bugs, such as on full disks. 2.1 followed in September 1978, primarily addressing major bugs from 2.0 while adding essential commands and features for improved stability. By 1979, TRSDOS 2.3 emerged as the final single-density iteration for the Model I, incorporating minor bug fixes and enhanced utilities to refine without introducing double-density support. Later versions like 2.7 and 2.8 in added double-density support via the Double-Density Disk Kit. The Model III, launched on July 30, 1980, came with TRSDOS 1.0, which Tandy developed in-house, drawing partial inspiration from the more business-oriented Model II version. This version supported 180K double-density disks on 40-track drives, included a HELP command for user assistance, and integrated Disk with Model I compatibility, though it limited file dating to month and year only. Version 1.3 followed in May 1981, with optimizations for the Model III's hardware, including support for its faster processing capabilities in certain configurations and password protection inherited from earlier Model I versions. Minor updates continued until 1984, enhancing reliability but without a planned 1.4 release materializing. For the Model 4 series, TRSDOS evolved from LDOS, originally developed by Logical Systems, Inc. TRSDOS 6.0 debuted in April 1983 alongside the Model 4, emphasizing device independence through abstract hardware interfaces that allowed flexible peripheral handling. Version 6.2, released in 1984, added the MemDisk feature, enabling expanded memory to function as a high-speed disk . Logical Systems then rebranded and updated it as LS-DOS 6.3 in 1986, introducing subdirectory support to organize files hierarchically beyond flat structures. The final release, LS-DOS 6.4, arrived in 1987, consolidating refinements for the aging platform. Key advancements across the 6.x series included a shift to comprehensive hardware abstraction via device control blocks and supervisor calls, facilitating easier adaptation to varied storage media. In 1984, Logical Systems released the full commented source code for TRSDOS 6.2 in a three-volume set titled The Source, enabling developer customization. Official support ended by 1987 as Tandy prioritized MS-DOS for its emerging PC-compatible lines.

Architecture

Core Components

TRSDOS employs a architecture, where the core operating resides as a single, integrated unit in , augmented by an overlay to handle functionality within the severe constraints of 16 to 64 KB RAM typical of . In early versions for Models I and III, the , often referred to as the or , includes essential services such as an overlay loader, disk routines, device drivers, and initialization code, loading initially into low addresses like 0x4000 to 0x4E00. This design allows non-resident modules to be dynamically loaded from disk into designated overlay regions, such as 0x4E00 to 0x5200, ensuring efficient use of limited resources without requiring permanent allocation for infrequently used components. Central to the system's structure are key modules that form the resident and overlay portions. SYS0/SYS serves as the bootstrap and core nucleus, handling initial loading and basic I/O services, while in later versions, SYSRES represents the persistent resident system, encompassing file access routines, supervisor call () processing, and management, typically occupying 0.5 KB (512 bytes). Device handlers, managed through tables like the device address and mnemonic tables, enable I/O redirection across peripherals such as keyboards, video displays, and printers, supporting device-independent operations via SVCs for reading, writing, and channel I/O. Overlays like 1/SYS (command interpreter) and SYS2/SYS (file control) are loaded on demand, with libraries such as SYS6 to SYS8 providing indexed methods (ISAM) for advanced file handling. The process underscores the 's and lack of built-in multitasking, operating as a single-user environment without concurrent process support. During a boot in early versions, the ROM routine reads from track 0, sector 0 of drive 0 to load the BOOT/SYS module (1 sector) into 0x4200-0x42FF, followed by SYS0/SYS for full initialization; in TRSDOS 6, it loads 16 sectors into 0x0800-0x1FFF. A warm boot, triggered by system reset or equivalent mechanisms like the *CLEAR command in earlier versions, reloads necessary components without a full disk access if the resident is intact, checking for user input to proceed. Security features, including password protection for files and directories introduced in early versions like TRSDOS 2.1, evolved across versions, with later iterations like TRSDOS 6 using up to eight-character OWNER and passwords to enforce access levels such as READ or FULL via blocks (FCBs). This protection is integrated into modules like SYS2/SYS, denying access if security criteria are unmet. TRSDOS remained closed-source software until 1984, when Logical Systems, Inc. published the commented for version 6.2 in "".

Memory Organization

TRSDOS organizes memory on systems to balance resident operating system requirements with available space for user programs and data, typically allocating low memory addresses for core components while reserving higher addresses for applications. On Models I and III, which support up to 48 KB of , the system area occupies the lower portion of , approximately 8 KB dedicated to buffers, device control blocks, and resident code, starting from address 0x4000 and extending upward. This leaves the user program space below 0xE000 available for interpreters, applications, and , with the exact boundary adjustable based on total and configuration. Buffer management in TRSDOS prioritizes efficient I/O handling with a fixed 2 KB buffer to cache disk tracks in , enabling quick lookups without repeated disk . I/O operations use variable-sized buffers for logical ranging from 1 to 256 bytes per record, configurable at open to match application needs and minimize overhead; each buffer includes a 34-byte control block (DCB) for like pointers and status flags. These buffers are dynamically allocated within the system area, with up to 15 supported depending on the "HOW MANY FILES?" prompt during initialization, ensuring compatibility with limited while supporting concurrent access. Overlay handling allows TRSDOS to maintain a minimal resident footprint of approximately 12 by dynamically loading non-essential modules from disk into designated overlay zones as needed, swapping them out to free space for subsequent operations. In early versions, the core , including the command interpreter and I/O routines, resides permanently in low memory (e.g., 0x4000 to 0x4E00 on Model I), while overlays such as file management utilities load into addresses like 0x4E00 to 0x5200, and larger utilities occupy 0x5200 upward, overwriting prior contents only when safe. This approach, referenced in overlay mechanisms, optimizes performance on resource-constrained systems by reducing constant disk I/O for infrequently used code. In TRSDOS Version 6 for the Model 4, memory organization introduces significant enhancements, supporting up to 128 of total through bank-switching across two 64 banks ( base plus optional expansion), with the system area expanded to include 0.5 for SYSRES and 1.5 for system overlays and buffers in low (0x1300 to 0x1DFF for SYSRES; 0x1E00 to 0x23FF for SOR) alongside a 0.25 library overlay region (0x2400 to 0x25FF). User program space begins at 0x3000 and extends dynamically to the HIGH$ pointer, adjustable via supervisor calls for flexible allocation. A key feature is MemDisk, which repurposes unused high (up to in the extended bank) as a disk for rapid file storage and retrieval, emulating disk sectors in to accelerate operations like program loading and data caching without physical media access.

File and Disk Management

Disk Structure

TRSDOS organizes disks using a granule-based , where the fundamental unit of allocation is a . Granule size varies by : 1.25 (5 sectors of 256 bytes each) for single- (SD) and 0.75 (3 sectors) for double- (DSDD) in Model III versions. Disks are divided into granules, with configurations yielding 70 granules for a 35- single- disk (~87.5 KB raw capacity) or 240 granules for a 40- double- disk (~184 KB raw). This structure applies to 5¼-inch floppy disks formatted in single- (SSDD) or double- (DSDD) modes, where each holds multiple granules depending on the —such as 2 granules per in SSDD (5 sectors each) or 6 granules per in DSDD (3 sectors each for TRSDOS). Hard disks, supported in later versions like TRSDOS 6, are partitioned into up to 8 logical drives to manage larger capacities, each following a similar granule but with configurable sector counts per granule (e.g., 8 or 16 sectors). The directory is a fixed structure allocated on track 17 for single-sided floppy disks to optimize access times (cylinders for double-sided or hard drives). It supports 48 file entries for Model I TRSDOS 2.x or 80 for Model III TRSDOS 1.x, stored across multiple sectors: the first sector contains essential including the disk name, , and command, while subsequent sectors hold the file entries (e.g., 5 entries per sector, totaling the slots). A fixed allocation , known as the Granule Allocation Table (GAT), resides in the directory's initial sector and uses a bit-per- mapping to track usage—typically one bit per granule across bytes representing each track, with values indicating free (e.g., 00), allocated (e.g., 11), or locked (e.g., FF for flawed tracks). During formatting, TRSDOS initializes the disk by writing the boot sectors, establishing the directory , and populating the GAT with all granules marked as free, while verifying integrity through read/write . Allocation occurs via a first-fit , scanning the GAT sequentially to find and claim the lowest-numbered free (s) for a file's extents, without any built-in —leading to potential scattering over time but ensuring simple, efficient space management. For version-specific enhancements, such as expanded 40- support in TRSDOS 2.3, capacities align with these counts while maintaining the core -driven approach.

File System Operations

TRSDOS employs an 8.3 , consisting of up to eight alphanumeric characters for the primary name followed by a three-character extension, such as PROGRAM.BAS or /. File names are case-insensitive, allowing users to reference files without regard to uppercase or lowercase letters. Wildcards facilitate in file specifications, with the (*) representing multiple characters and the (?) standing for a single character, enabling operations like selecting all files via *.BAS. Files in TRSDOS support two primary access modes: sequential and . Sequential record input/output processes data in order from the beginning of the file, with each ranging from 1 to 256 bytes in size. allows direct positioning to specific using (GRAN) and (REC) parameters, where represent allocation units on disk, though the system lacks support for or other advanced data flows. Basic file operations in TRSDOS include creation, deletion, renaming, and . Files are created during output operations or via system calls, while deletion and renaming are handled through dedicated mechanisms that update entries. Protection features allow setting access levels and s on a per-file basis, with —using up to eight-character strings—introduced in version 2.1 to control read, write, execute, rename, and delete permissions. The imposes certain limitations, including a maximum of 48 files per for Model I or 80 for Model III, enforced by the fixed 48-byte size of each entry. Subdirectories are not supported in core TRSDOS versions, maintaining a flat until the introduction of this capability in LS-DOS 6.3.

Command-Line Mechanics

The TRSDOS (CLI) is a text-based system that accepts line-buffered input from the or redirected devices, processing commands entered at a such as 'DOS READY' or 'TRSDOS READY', depending on the model and version. Users type commands followed by parameters, pressing Enter to execute; the interface supports up to 80 characters of lookahead buffering for efficient input. This design emphasizes simplicity, with case-insensitive parsing that converts inputs to uppercase for validation. Parsing begins with the command interpreter scanning the input line for the primary command keyword, ignoring optional "noise words" such as "TO" or "FROM" that enhance readability but do not affect functionality—for instance, "COPY FILEA TO FILEB" is equivalent to "COPY FILEA FILEB". The system first checks for internal (resident) commands handled directly by the DOS kernel, then searches for external commands across available drives (typically 0-3 or 0-7 depending on the version), loading them as overlays from disk files with a default .CMD extension if no extension is specified in TRSDOS 6.x. File specifications (filespecs) follow a structured format: up to 8-character name, 3-character extension, optional password, and drive specifier (e.g., ARTICLE/TXT:0), validated via system service calls (SVCs) like @FSPEC, which terminate parsing at end-of-text or carriage return markers. Parameters, if enclosed in parentheses, are parsed separately using @PARAM SVC, supporting formats like hexadecimal (X'hhhh'), decimal numbers, quoted strings, or toggles (ON/OFF), with abbreviations allowed (e.g., "L" for "LENGTH"). Execution differentiates between internal commands, executed in resident memory below address X'2800' via routines like @CMNDI, and external commands, loaded and run using @RUN or @LOAD SVCs, which allocate memory dynamically and pass the command buffer address in the HL register. Device redirection integrates seamlessly, allowing output or input reassignment—such as "ROUTE *PR TO FILE/TXT:3" to send printer output to a file—managed through logical device control blocks (DCBs) and options like {PRT} for printer routing or SPOOL for buffering to disk. Input can originate from the keyboard (*KI device), serial ports via configured channels, or redirected files/devices, but TRSDOS lacks native scripting; batch processing occurs via manually chained commands or automated startup lines stored with the AUTO command. Error handling during parsing and execution returns specific codes in the accumulator , triggering messages like "", "FILE NOT FOUND", "ILLEGAL DRIVE NUMBER" (code 32), or "PARAMETER ERROR" (code 44), displayed via the @ERROR from a . The non-zero (NZ) flag indicates failure, enabling programs to recover or prompt retries, while successful operations set the zero (. This mechanism ensures robust user interaction without halting the abruptly.

Key Commands

TRSDOS provides a set of built-in commands for managing files, disks, and system operations, accessible via the . Commands vary by version; the following describes common ones with version-specific notes where applicable. These commands are essential for everyday tasks such as listing files, deleting data, copying content, and configuring hardware. The syntax generally follows a simple format where commands are typed followed by parameters like filenames or drive specifiers (e.g., :0 for the first drive), and options in parentheses for advanced control.

Directory Commands

The directory commands allow users to view, manage space, and remove files on a disk.
  • DIR: This command displays a list of files on the specified drive, including filenames, extensions, and attributes like file size or type. Syntax: DIR [:d] [(options)], where options such as S (system files), I (invisible files), or A (allocation details) can be added for filtered output. For example, DIR :0 lists files on drive 0, while DIR (S) includes hidden system files. It supports wildcard characters for partial matches.
  • FREE: Displays the available space on all or a specific drive, showing the number of free granules (allocation units) and maximum file slots. Syntax: FREE [:d] [(P)], where P prints the output to a printer. On a standard 35-track disk, it might report up to 67 free granules for data storage. This helps users assess disk capacity before operations.
  • KILL: Deletes one or more files from a drive, freeing their allocated space; it supports wildcards for batch deletion (e.g., KILL *.BAS removes all BASIC files). Syntax: KILL filespec [:d]. In later versions like TRSDOS 6.x, the equivalent is REMOVE filespec, which also handles device removal but requires confirmation for safety. Users must have write access, and it cannot delete open files.

Copy and Backup Commands

These facilitate data transfer and disk duplication, often with built-in to ensure .
  • COPY: Transfers files from one location to another, either between drives or within the same disk (in versions supporting single-drive mode). Syntax: COPY filespec1 [TO] filespec2 [:d] [(options)], where options like V () or L (record length) control behavior. For instance, COPY FILE/TXT:0 TO FILE/TXT:1 duplicates a across drives, preserving attributes. It requires sufficient space on the destination.
  • BACKUP/RESTORE: Performs full by copying all tracks and sectors from a source to a destination drive, automatically formatting the target if needed. Syntax for : BACKUP :s TO :d [(options)], with options like Query (prompt for each file) or Sys (include system files). reverses this process to recover from a disk. This is particularly useful for or , though it requires two drives and can take several minutes for a full 80-track disk.

Disk Utilities

Commands in this category prepare and maintain disk media, including surface integrity checks.
  • FORMAT: Initializes a blank diskette by creating tracks, sectors, and a , optionally locking out bad sectors. Syntax: FORMAT [:d] [(options)], such as Name (disk label) or Sides (for double-sided drives in later versions). For example, FORMAT :1 prepares drive 1 as a data disk with default 35 tracks (single-density). It erases all data, so backups are recommended beforehand.
  • TEST/VERIFY: TEST performs diagnostic checks on , while VERIFY toggles read-after-write confirmation during file operations to detect errors. Syntax for VERIFY: VERIFY (ON|OFF). Enabling VERIFY (default off) slows operations by about 50% but ensures accuracy, especially on older media. TEST is often used in system utilities for memory scanning.

System Commands

These handle basic system reconfiguration and output routing.

Programming and Utilities

System Interfaces

TRSDOS provides programming interfaces primarily through SuperVisor Calls (SVCs), which enable developers to access system functions such as file operations and device control. These SVCs are invoked using the Z80 restart instruction RST 40H or equivalent mechanisms, with function codes ranging from 0 to 127. Parameters for SVCs are passed via CPU , following a standardized where, for instance, B holds the function code (e.g., 1 for GET, 2 for PUT, 4 for CTL), HL points to the I/O , and DE references the Device Control Block (DCB) or (FCB). Return values include error codes in A and a set indicating success. Key SVCs for file and disk management include @OPEN (SVC 59) to open files or devices, @CLOSE (SVC 60, often via @REMOV SVC 57) to close them, @READ (SVC 67) and @WRITE (SVC 75) for sequential I/O, and @POSN (SVC 66) for positioning in random-access files. The following table outlines the register protocol for common disk I/O SVCs, such as @RDSEC (SVC 49) for reading sectors:
RegisterPurposeExample Usage
BFunction Code1 (GET), 2 (PUT), 4 (CTL)
C Number0-255
D NumberDisk geometry-specific
ESector NumberDisk geometry-specific
HLBuffer PointerMemory address for data
DEDCB/FCB PointerStructure for file/device info
IYDrive Control Table PtrPointer to DCT fields like CURCYL
This protocol ensures efficient, low-level access without stack overhead, supporting operations like sector verification (@VRSEC) and directory sector writing (@WRSSC). TRSDOS includes utilities tailored for and disk preparation. The command connects devices for I/O redirection and chaining, such as linking input/output streams between logical devices (e.g., LINK *KI TO *CL). In the , granules—typically groups of 3 to 5 sectors depending on media density—serve as the minimum allocation unit, managed via the Granule Allocation Table (GAT) for efficient file storage and . These features streamline the development process, allowing programmers to build and deploy applications directly on TRSDOS media. Device drivers in TRSDOS support customization for non-standard peripherals through Device Control Blocks (DCBs) and Drive Control Tables (DCTs), which define up to 31 handler entries for I/O routing. Custom handlers are registered via DCB TYPE bits, enabling tailored responses to device-specific requests. I/O redirection is handled by the @CHNIO SVC (20), which chains or filters data streams, such as linking logical devices or applying modifications like the TRAP or SLASH0 filters in high memory. DCT fields, including CURCYL and MAXCYL, manage physical disk parameters for these drivers, ensuring compatibility with varied hardware configurations. Documentation for these interfaces is comprehensively covered in the Programmer's Guide to TRSDOS Version 6.x, which details usage, register protocols, and driver implementation across chapters on system calls and device management. In 1984, Logical Systems published a three-volume set of commented assembler for TRSDOS 6.2 (also known as LS-DOS 6.2); Volume 1 covers core OS code, Volume 2 library commands, and Volume 3 utilities (excluding ), with some proprietary sections blanked but opcodes preserved. This resource, originally priced at $99 per volume, aids in-depth study and modification of the system.

Example Usage

One practical example of using TRSDOS involves the DIR command to list files matching a specific pattern, such as BASIC program files. Entering DIR *.BAS displays all files with the .BAS extension on the current drive, showing details including the filename, file type (e.g., BAS), protection level (0-6, where 0 is read/write and 6 is read-only), logical record length, file size in kilobytes, last modification date, and the number of granules allocated to the file. The output is formatted in columns for readability, with each line representing one file, and the display pauses if it exceeds the screen capacity to allow user review. TRSDOS integrates seamlessly with Disk BASIC for file operations, allowing programs to access files using built-in statements that invoke underlying DOS calls, often via low-level memory manipulation with POKE and PEEK for custom control. For instance, to open a data file for random input access, the statement OPEN #1,"FILE.DAT,RI" assigns file number 1 to FILE.DAT in random input mode (), enabling direct record addressing with subsequent FIELD or GET statements. This mode supports fixed-length records, where the file's logical record length (set during creation) determines the buffer size; PEEK can then inspect the file control block at a known location (e.g., PEEK(16512) for flags) to verify open success or handle errors like file-not-found. File access modes such as are defined for efficient I/O without delving into sector-level details. For lower-level programming in , TRSDOS provides SuperVisor Calls (s) accessible via Z80 instructions to interact with system features like reading. A sample snippet to read a specific entry using the @DIRRD (number 87 ) sets up registers for the drive and entry , then invokes the call; here's the Z80 :
    LD   C, 0          ; Logical drive 0
    LD   B, 5          ; Directory Entry Code (DEC) example: entry 5
    LD   HL, [BUFFER](/page/Buffer)    ; HL points to 16-byte buffer for entry data
    LD   A, 87         ; Load @DIRRD SVC number
    RST  40H           ; Invoke SVC
    JP   NZ, [ERROR](/page/Error)     ; Jump if error (NZ flag set, A holds error [code](/page/Code))
    ; Buffer now contains [filename](/page/Filename), extent, granules, etc.
[ERROR](/page/Error):
    ; Handle error, e.g., RET or display [code](/page/Code) in A
This call retrieves the fixed-page directory entry (FPDE) into the buffer, including allocation details like granule map; success sets the Z flag, while failure returns an error code in A (e.g., 12 for invalid DEC). The RST 40H instruction dispatches to the SVC handler in low memory, preserving registers except as specified. A common scenario for disk management is backing up an entire disk using the BACKUP command, which copies files while preserving directory structure and attributes. The sequence begins with BACKUP :0 TO :1 to mirror drive 0 to drive 1, prompting for source and target disk insertion if needed; for selective backups, use BACKUP *.BAS:0 TO :2 to copy only BASIC files. Error handling is crucial: if the target drive is write-protected or full, TRSDOS halts with an error code (e.g., 9 for disk full) displayed via the last-error mechanism, requiring the user to verify drive status with FREE or reformat the target; always run VERIFY afterward to confirm integrity.

References

  1. [1]
    TRSDOS - ArchiveOS
    Dec 30, 2024 · TRSDOS (Tandy Radio Shack Disk Operating System) – a disk operating system offered for the TRS-80 line of home computers manufactured by Tandy Corporation
  2. [2]
    TRSDOS for the Model III - Matthew Reed's TRS-80.org
    The TRSDOS operating system includes the software and input/output functions needed to operate the TRS-80 Disk System. TRSDOS allows vast storage space ...Features · Versions · Compatibility
  3. [3]
    TRSDOS for the Model I - Matthew Reed's TRS-80.org
    Other features, such as interrupt tasks, device drivers, redirection, and filtering, were present in the original version but only documented later. Many of ...Missing: history | Show results with:history
  4. [4]
    TRS-80 Software Page - Disk Operating Systems
    With support for hard drives and compatibility with the Model 4's TRSDOS 6x (licensed version of LS-DOS) this operating system gave users a true taste of ...
  5. [5]
    DOS Tips and Tricks – Ira Goldklang's TRS-80 Revived Site
    TRSDOS 6.x is an advanced version of the LDOS operating system designed for use on all-RAM computers using the Z80 processor. TRSDOS 6.x supports a variety ...<|control11|><|separator|>
  6. [6]
    [PDF] Introduction to your TRS-80 model 4 disk system
    The Model 4 s disk operating system is. TRSDOS Version 6.2 (or any later version). This is called simply "TRSDOS" ("Triss Doss") throughout this manual. TRSDOS ...
  7. [7]
    [PDF] TRSDOS v2.1 Reference Manual (1979)(Tandy)
    TRSDOS - DISK OPERATING SYSTEM - VER 2. 1. DOS READY. Type: B8COT HEED. The system will then display: TRSDOS DISK BACKUP UTILITY VER 2. 1. If you have only 1.
  8. [8]
    LS-DOS 6.3.1 Source Code Restoration Project - Index of /
    In 1984, Logical Systems published most of the source code to TRSDOS 6.2.0 in a three-volume set entitled "The Source". For that publication, the operating ...
  9. [9]
    TRS-80 Computers: TRS-80 Model I
    TRSDOS allows vast file storage space, expanded file manipulations, and much quicker access time than you get with tape storage. Disk BASIC allows you to access ...
  10. [10]
    TRS-80 Computers: TRS-80 Model III
    The software group were making plans on how to alter Model III TRSDOS to support hard disk drives. ... Hardware Requirements: RS-232 port and a modem.
  11. [11]
    TRS-80 Revived Site - Ira Goldklang's TRS-80 Archive
    ### Hardware Specs for TRS-80 Model 4 (Focus on TRSDOS 6 Compatibility)
  12. [12]
    TRSDOS v2.3 - Ira Goldklang's TRS-80
    Oct 31, 2025 · It required a minimum of 32K of RAM and at least one disk drive, although four disk drives were supported. TRSDOS v2.3 is broken into two types ...Missing: based efficiency<|separator|>
  13. [13]
    [PDF] The Expanding World of TRS-80, 1970
    The TRS-80's programs are written in easy-to-learn, plain-English BASIC programming language (BASIC stands for "Beginner's All-purpose Symbolic Instruction.
  14. [14]
    The TRS-80 Home Page - TRSDOS/LS-DOS 6.x Command Reference
    Converts files from Model III TRSDOS 1.3 to Model 4 TRSDOS/LS-DOS 6.X ... Question 4 is only asked for the first hard drive in the entire system.
  15. [15]
    The Tandy Corporation, Part 1 - by Bradford Morgan White
    May 18, 2025 · Along with the drives, in July of 1978, Radio Shack released TRSDOS written by Randy Cook. The initial versions of TRSDOS provided the ...Missing: origins | Show results with:origins
  16. [16]
    The Story of Tandy – 10 years after the TRS-80 Model 1, Vintage is ...
    At the time Cook was writing TRSDOS in 1977. Charles Tandy died, and the company was being run by committee, Pennington says. The company kept changing what it ...
  17. [17]
    Randy Cook and the Thorny Path that Began with TRSDOS 2.0
    It began with Radio Shack and TRSDOS 2.0, the first DOS they released. After TRSDOS 2.1, Cook brought out a more sophisticated operating system, VTOS, under ...
  18. [18]
    Model I TRSDOS Versions - Matthew Reed's TRS-80.org
    TRSDOS 2.7 (Released 1982). Startup screen for TRSDOS 2.7. TRSDOS 2.7 was an oddity; a Model I operating system that resembled TRSDOS for the Model III.Trsdos 2.0 (released July... · Trsdos 2.1 (released... · Trsdos 2.7 (released 1982)
  19. [19]
    The TRS-80 Model 4
    Apr 26, 1983 · a 4Mhz clock speed (double that of the Model III) · a full 64K of RAM plus support for another 64K of extended memory · an 80 by 24 screen with ...
  20. [20]
    [PDF] The Programmer's Guide to TRSDOS Version 6 - Tim Mann
    Apr 5, 2011 · Each comes equipped more or less with the following features: CRT monitor, keyboard, one or more 5-1/4" or 8" floppy disk drives (usually 5 ...Missing: history | Show results with:history<|control11|><|separator|>
  21. [21]
    RAM Addresses and Routines - Ira Goldklang's TRS-80
    TRS-80 Revived Site by Ira Goldklang's is an archive of everything related to the Tandy Radio Shack TRS-80 microcomputer lines. Site contains emulators ...
  22. [22]
    TRS-80 DOS – TRSDOS v1.3 – Internals
    The TRSDOS v1.3 directory is located on Track #17 (11H), and occupies the entire track. Because of the Model-III's double density format, this amounts to 18 ...
  23. [23]
    [PDF] Tandy Model 2 Disk Operating System Reference Manual
    Note: TRSDOS always verifies directory writes. User writes (writing data into a file) are only verified when VERIFY is ON. TRSDOS starts up with VERIFY ON.
  24. [24]
    Model I TRSDOS v2.3 FORMAT/CMD Explained
    Nov 2, 2025 · The FORMAT process is mostly about building a directory track, so an understanding of the TRSDOS v2.3 directory structure is important.
  25. [25]
    Model I TRSDOS Commands - Matthew Reed's TRS-80.org
    The Model I TRSDOS command shell supported a number of internal commands, as documented by the TRSDOS 2.3 Reference Manual. Most of the commands were also ...Missing: interface mechanics syntax
  26. [26]
    [PDF] TRS-80
    When you create a disk file, you need to give it a name. The name is just one part of a file specification filespec for short. The filespec is the standard ...
  27. [27]
    The Source - Matthew Reed's TRS-80.org
    The Source was a three volume set containing the complete source code of TRSDOS 6.2 (also LS-DOS 6.2). Each volume cost $99; later prices were discounted.
  28. [28]
    TRSDOS & Disk BASIC Reference Manual : Radio Shack
    Jul 17, 2017 · TRSDOS & Disk BASIC Reference Manual ; Publication date: 1979 ; Topics: trsdos, basic, trs80, radio shack, manual, enf-trs80 ; Collection ...