PromptZone - AI Prompts, Guides and Tools for Builders

Cover image for Borland Reborn: Reverse-Engineering Classic DOS Compilers for Modern Devs
Samir Arellano
Samir Arellano

Posted on

Borland Reborn: Reverse-Engineering Classic DOS Compilers for Modern Devs

The source code for Borland’s legendary DOS compilers has been lost for decades, but a new project called Borland Reborn has successfully reconstructed it. The project, flagged on a Hacker News thread with 137 points, uses advanced reverse-engineering to rebuild working compilers from the original binary executables.

Project: Borland Reborn | Compilers: Turbo C 2.01, Turbo Pascal 7.0 | Method: Binary Decompilation & Reconstruction
License: GNU GPL v3 | Status: Actively developed on GitHub

How the Reverse-Engineering Works

The project does not have original source code. Instead, it uses the Ghidra software reverse engineering suite to disassemble the original TCC.EXE and TPC.EXE compiler binaries. The team then manually translates the resulting assembly code into readable, compilable C code.

This process is more than a simple decompilation. It involves reconstructing data structures, inferring original variable names, and replicating the exact behavior of the 16-bit, real-mode compilers. The final output is a source tree that can be compiled with modern tools like Open Watcom to produce a byte-identical compiler.

Borland Reborn: Reverse-Engineering Classic DOS Compilers for Modern Devs

Benchmarks and Specs

The current release includes two fully rebuilt compilers. Performance is measured against the original 1990s binaries running in a period-accurate emulator.

Compiler Original Binary Size Rebuilt Binary Size Output Match
Turbo C 2.01 146,736 bytes 146,736 bytes 100% identical
Turbo Pascal 7.0 195,584 bytes 195,584 bytes 100% identical

The "Output Match" is critical: for any given source file, the rebuilt compiler generates bit-for-bit identical .OBJ and .EXE files as the original Borland compiler. This proves functional correctness, not just superficial similarity.

Get the daily AI digest
One email each morning — what shipped in AI, and the prompts we tested. No filler.

How to Try It

Getting the compilers running requires a 16-bit development environment or DOS emulation. The most straightforward path is using DOSBox-X.

  1. Clone the repository: git clone https://github.com/abedegno/borland-reborn
  2. Follow the build instructions in the /src directory to compile the C source using Open Watcom. Pre-built binaries are also available in the releases.
  3. Mount a directory in DOSBox-X and copy the tcc.exe or tpc.exe binary there, along with the necessary library files (*.lib, *.bgi).
  4. Compile a test .c or .pas file using the exact command-line syntax of the early 90s.

"Full DOSBox-X Configuration Snippet"
[dosbox]
machine=svga_s3
[cpu]
cycles=max
[autoexec]
mount c /path/to/your/dev
c:
SET PATH=C:\BIN;%PATH%
Enter fullscreen mode Exit fullscreen mode

This sets up a period-appropriate SVGA machine with maximum cycles and mounts your development folder as the C: drive.


Pros and Cons

Advantages:

  • Historical Accuracy: Provides a perfectly accurate, modifiable reference for how these industry-standard tools worked internally.
  • Educational Value: An unparalleled case study in compiler design and reverse-engineering for low-level developers.
  • Preservation: Ensures these tools are not lost to bit rot, living on as open-source software.
  • Niche Utility: Can compile legacy codebases with absolute certainty of compatibility.

Limitations:

  • No Modern Features: These are strictly 16-bit DOS compilers. They cannot target 32/64-bit systems, create Windows GUI apps, or understand modern C/C++ standards.
  • Not for Production: The primary value is academic and preservational. For compiling old projects, the original binaries in DOSBox are simpler.
  • Complex Setup: Requires comfort with command-line build tools and emulator configuration.

Alternatives and Comparisons

For developers interacting with legacy Borland code, you have three main options.

Feature Borland Reborn Original Binaries + DOSBox Modern Compiler (GCC/Clang)
Target 16-bit DOS 16-bit DOS Modern OS (Linux, Windows, macOS)
Source Access Full, modifiable C None (binary only) Full, modifiable C++
Builds Legacy Code Yes, perfectly Yes, perfectly Rarely, requires major porting
Primary Use Study, modification Preservation, compilation New development
Learning Curve High (build system) Low Medium

Bottom line: Borland Reborn is for studying the compiler itself; original binaries are for compiling old code; modern compilers are for writing new code.

Who Should Use This

This project serves specific, narrow audiences. Use it if you are: a computer science educator teaching compiler construction, a low-level software historian, or a developer fascinated by reverse-engineering techniques. The HN discussion noted strong interest from developers who used these tools professionally in the 80s and 90s.

Skip it if you simply need to compile an old Turbo C project for maintenance. You will have a much easier time using the readily available original binaries inside a standard DOSBox setup.

The Bottom Line on Software Preservation

Borland Reborn is a remarkable technical achievement in software archaeology, not a practical new dev tool. It demonstrates that with enough skill and patience, even "lost" software can be resurrected as true open source. This project sets a precedent for preserving other critical, closed-source tools from computing's early eras before they become unrecoverable.

The clean-room, binary-derived approach also provides a legally sound model for such preservation, avoiding copyright issues by not copying original source code. As one HN commenter noted, it’s a blueprint for saving the digital foundations that modern software rests upon.

Get the daily AI digest

One email each morning — what shipped in AI, and the prompts we tested. No filler.

Top comments (0)