TL;DR

NMH BASIC is a compact BASIC interpreter written in the early 1990s and distributed with source and binaries for several platforms. The package includes small programs (notably a text-mode mine sweeper), documentation of an unusual stackless floodfill, and multiple builds including BASYL-II, 8086 assembly and a T3X/0 Unix port.

What happened

The author revived and packaged a small BASIC interpreter called NMH BASIC that they originally developed in the early 1990s. The interpreter was compact — the 8086 assembly build was about 4.7K bytes — and the full system uses roughly 12 KB of memory for variables, program text, stacks and interpreter code. The downloadable archive contains several variants: the original BASYL-II prototype, the assembly-language executable, a T3X/0 translation for Unix, and a CP/M build (BASICS.COM) that requires a 32K TPA. Included programs range from simple demos (prime sieve, Hangman, Nim, banner printer) to a text-mode mine sweeper clone that demonstrates a stackless floodfill; the author also published a short paper describing that floodfill algorithm and bundled a demo animation. The package provides precompiled COM and Tcode binaries and instructions to recompile the T3X and 8086 versions with T3X/0, TASM or MASM.

Why it matters

  • Demonstrates how useful tools can be extremely compact — the interpreter and demos fit into kilobytes.
  • Includes a documented stackless floodfill algorithm that avoids dynamic memory, which may interest algorithm researchers and retrocomputing hobbyists.
  • Provides multiple historical builds (BASYL-II, 8086 assembly, CP/M) and a Unix port, useful for study, porting and archival purposes.
  • Highlights implementation and language design tradeoffs (variable packing, I/O model, conditional semantics) that differ from mainstream BASIC dialects.

Key facts

  • Downloads available: nmhbas23c.zip (version 1.2, 74KB) and nmhbas25c.zip (version 2.1, 90KB).
  • The original assembly executable measured about 4,700 bytes; the interpreter uses roughly 12 KB total at run time.
  • Archive contains the BASYL-II prototype, the 8086 assembly version, a T3X/0 translation, precompiled COM and Tcode binaries, and a Tcode machine for Unix.
  • A CP/M-compatible simplified interpreter (BASICS.COM) is included; it requires 32 KB of transient program area to run.
  • The package includes a text-mode mine sweeper clone that uses a stackless floodfill stored in the playing field and a PDF paper (34 KB) describing that algorithm.
  • NMH BASIC has no built-in RNG; a 15-bit linear-feedback shift register is implemented in BASIC within the package to provide pseudo-random numbers.
  • Variables use single-character names or a character plus digit; numeric indexing maps across letters so arrays overlap unless managed deliberately.
  • I/O is performed on fixed 'units' assigned at interpreter start; programs cannot open or close files but can redirect input/output between units.
  • Maximum line/string length is 64 bytes; longer input triggers an error. LIST output formatting can expand lines and occasionally make a saved program un-loadable without editing.
  • IF statements execute the remainder of the line conditionally (no THEN/ELSE); logical NOT (#) and AND are supported but there is no OR operator.

What to watch next

  • Recompilation and use of the included T3X/0 and 8086 toolchains to run or modify the code on modern hosts (instructions and sources are in the archive).
  • not confirmed in the source
  • not confirmed in the source

Quick glossary

  • BASIC interpreter: A program that reads and executes code written in the BASIC programming language rather than compiling it to native machine code.
  • COM file: A simple binary executable format used by DOS and compatible environments that contains raw machine code loaded at a fixed memory address.
  • CP/M: An early operating system for microcomputers; programs often required a transient program area (TPA) to run.
  • Stackless floodfill: A floodfill approach that avoids using an explicit stack or dynamic memory by encoding state directly into the workspace or data structure.
  • Linear-feedback shift register (LFSR): A simple pseudo-random number generator implemented with bit-shift and feedback operations, often used where full RNG libraries are unavailable.

Reader FAQ

Is the NMH BASIC source code available in the package?
Yes. The archive includes the original BASYL-II code, the 8086 assembly sources, and the T3X translation.

Can I run NMH BASIC on Unix?
A Tcode machine for Unix and a T3X/0 translation are included; the archive also provides instructions to recompile the T3X version.

Does NMH BASIC provide random numbers?
NMH BASIC itself lacks a built-in RNG; the package supplies a 15-bit LFSR implemented in BASIC for pseudo-random numbers.

How much memory does NMH BASIC need?
The interpreter executable was about 4.7K in the 8086 build and the full system uses roughly 12 KB; the CP/M variant needs 32 KB of TPA.

http://t3x.org/nmhbasic/   (light|dark) NMH BASIC Download: nmhbas23c.zip (version 1.2, 74KB)  |  nmhbas25c.zip (version 2.1, 90KB)  |  man page This is a small BASIC interpreter that I wrote in the early 1990s. For some reason I think…

Sources

Related posts

By

Leave a Reply

Your email address will not be published. Required fields are marked *