Turbo C
Turbo C is a discontinued integrated development environment (IDE) and compiler for the C programming language, developed by Borland International and first released in May 1987 for MS-DOS systems.[1] It provided a compact, all-in-one programming suite that included an editor, compiler, linker, and debugger, targeted at both hobbyists and professional developers on personal computers.[2] Notable for its exceptionally fast compilation and linking speeds—often significantly quicker than competitors like Microsoft C—as well as its small memory footprint and generation of compact executable files, Turbo C revolutionized C development accessibility in the late 1980s.[3] The initial version 1.0 was based on an acquisition and adaptation of the Wizard C compiler, with subsequent updates addressing early bugs and enhancing functionality.[1] A major revision, Turbo C 2.0, arrived in 1988, introducing improved stability, a make utility, and better documentation, including comprehensive user and reference guides.[4][1] The software's low price point, intuitive interface, and high performance contributed to its widespread adoption, ranking Turbo C 2.0 among the top-selling programs shortly after launch and building on the success of Borland's earlier tools like Turbo Pascal.[1] However, it was succeeded and effectively discontinued by Turbo C++ 1.0 in 1990, as Borland shifted focus to support for the emerging C++ standard.[5] In later years, Embarcadero Technologies (which acquired Borland's assets) made older versions freely available for historical and educational use, and as of 2025, they remain accessible via Embarcadero's museum site.[6][7]Development and History
Origins and Launch
Borland International was founded in 1983 by Philippe Kahn in Scotts Valley, California, with an initial emphasis on creating affordable, high-performance software development tools for personal computers. The company's debut product, Turbo Pascal, was released in November 1983 and quickly gained popularity for its speed and low cost, establishing Borland's "Turbo" branding strategy for integrated development tools targeted at the emerging IBM PC market.[8] Building on Turbo Pascal's success, Borland decided to expand into the C programming language compiler market in the mid-1980s, aiming to appeal to hobbyists, students, and professional developers working on IBM PC compatibles under MS-DOS. This move was driven by the growing demand for accessible C tools, as C was becoming the dominant language for systems and application programming on DOS-based systems.[1] Turbo C version 1.0 was launched in May 1987 at a price of $99, a fraction of the cost of established competitors like Microsoft C (around $195) and Lattice C (over $400), making it accessible to a broader audience.[9][10] In the competitive landscape of the time, compilers such as Microsoft C operated primarily through command-line interfaces without an integrated development environment, while alternatives like early Watcom offerings emphasized code optimization but lacked user-friendly integration. Turbo C stood out by providing a cohesive integrated environment that streamlined editing, compilation, and debugging, appealing to users frustrated by fragmented workflows.[1][11] The product's initial system requirements were designed for widespread compatibility with early PC hardware: a minimum of 384 KB RAM, MS-DOS 2.0 or later, and support for 8086 or 8088 processors.[4]Evolution and Discontinuation
Following its successful launch in 1987, Turbo C underwent rapid iteration to address market feedback, with version 1.5 released in January 1988 as an incremental update.[12] Version 2.0 followed in November 1988, introducing significant enhancements including bundling with Turbo Assembler and Turbo Debugger in the professional edition to streamline debugging and assembly tasks.[12][13] A minor patch, version 2.01, arrived in May 1989 to fix specific issues.[12] These developments were shaped by advancing hardware capabilities, particularly the Intel 80286 processor, which enabled Turbo C 2.0 to optionally utilize 80286 opcodes and protected mode for improved performance on newer systems.[14] Concurrently, the rising popularity of C++ during the late 1980s, driven by its object-oriented features, influenced Borland's product roadmap as developers increasingly sought tools for more complex programming paradigms.[15] In May 1990, Borland released Turbo C++ 1.0 as the official successor, integrating C++ compilation capabilities atop the Turbo C foundation and effectively ending development of standalone Turbo C.[12] This transition reflected Borland's broader strategy to prioritize object-oriented languages and expand support for graphical user interfaces, including early Windows compatibility in subsequent iterations.[16] Commercial support for Turbo C concluded in the early 1990s, with no additional standalone updates beyond version 2.0, as Borland redirected resources toward its evolving compiler lineup.[13][16]Versions
Turbo C 1.0 and 1.5
Turbo C 1.0, released on May 13, 1987, by Borland International, marked the introduction of the first integrated development environment (IDE) for the C programming language on IBM PCs.[17] It combined an editor, compiler, linker, and basic debugger into a cohesive interface using pull-down menus and windows, enabling users to edit, compile, and run programs seamlessly within the same environment.[18] The full-screen editor supported features like auto-indentation, line deletion commands (e.g., Ctrl-Y), and automatic positioning to syntax errors upon compilation, facilitating efficient code development. The compiler generated native 8086 assembly code in a single pass, achieving speeds exceeding 7000 lines per minute on a standard PC, which significantly reduced development time compared to contemporary alternatives.[18] A key innovation in Turbo C 1.0 was its support for multiple memory models—tiny, small, compact, medium, large, and huge—to accommodate varying program sizes and addressing needs under the constraints of 16-bit MS-DOS. These models allowed developers to optimize for near or far pointers, with the tiny model limiting programs to 64 KB total and the huge model supporting up to 1 MB of data. Inline assembly integration was also provided, enabling the embedding of 8086 opcodes directly within C code using theasm keyword, compatible with MASM 4.0 syntax, which was essential for performance-critical applications. Bundled utilities included a basic debugger for stepping through code and inspecting variables, as well as a MAKE utility for automating builds in multi-file projects via project files (e.g., .PRJ extensions). However, these early versions lacked overlay support for managing large executables, and all models enforced a 64 KB limit per code segment, potentially requiring workarounds for bigger modules.[18]
Turbo C 1.5, released in January 1988, built upon the foundation of version 1.0 with targeted enhancements to improve usability and functionality for console-based and graphical programming. A major addition was the <conio.h> library, which provided over a dozen functions for direct console input/output, such as clrscr() for clearing the screen, gotoxy() for cursor positioning, cprintf() for formatted output, and textattr() for setting text attributes like color and intensity, streamlining screen manipulation in text-mode applications. This library was particularly useful for IBM PC-compatible systems, though it required full hardware compatibility for direct video operations. Additionally, a new graphics library (<graphics.h> and GRAPHICS.LIB) offered more than 70 functions for 2D drawing, including line(), circle(), bar3d(), floodfill(), and image handling with getimage() and putimage(), supporting adapters like CGA, EGA, and VGA (with VGA recommended for accurate pixel scaling).[19][20]
The release expanded the collection of sample programs to demonstrate these new libraries, covering console I/O examples and graphics routines like arcs and 3D bars, which helped users quickly prototype applications. Documentation was improved through an addendum to the original User's Guide and Reference Guide, providing detailed function prototypes, usage examples, and corrections to prior materials, along with updates to installation utilities like TCINST.EXE for custom configuration. The bundled utilities from 1.0, including the basic debugger and MAKE tool, remained integral, with added support for library management via TLIB.EXE and file searching with GREP.COM. Limitations persisted, such as the absence of overlay support and the 64 KB code segment constraint, alongside graphics functions' dependency on specific hardware for optimal performance. Turbo C's launch pricing, starting at around $99.95, made it accessible to hobbyists and students seeking an affordable entry into C development.[19][21]
Turbo C 2.0
Turbo C 2.0 was released by Borland International in late 1988 as the final major iteration of the Turbo C compiler series, introducing refinements that enhanced its usability and performance on MS-DOS systems.[22] This version debuted the characteristic blue-screen interface for its integrated development environment (IDE), featuring a main menu, edit window, message window, and quick-reference line, with support for color attributes and toggleable windows via function keys like F6.[22] The IDE operated in both text and graphics modes, allowing customizable window coordinates and high-performance direct video output to RAM for faster screen updates.[22] The professional edition of Turbo C 2.0 bundled Turbo Assembler (TASM) version 1.0 and Turbo Debugger, enabling seamless inline assembly integration via theasm keyword and source-level debugging with features such as breakpoints, watch expressions, stepping (F7 for trace-into, F8 for step-over), and call stack display.[23] These tools supported command-line compilation of .ASM files and debugging options like the -zi switch, streamlining workflows for low-level programming and error resolution without leaving the IDE.[22]
Libraries in Turbo C 2.0 saw significant expansion, including an enhanced Borland Graphics Interface (BGI) with over 70 functions for graphics programming, such as initgraph for adapter initialization (supporting CGA, EGA, and VGA) and bar3d for 3D visualizations, along with installable drivers and fonts in GRAPHICS.LIB.[22] Mathematical routines were improved with faster floating-point emulation, long double support, new signal/raise functions, and dedicated libraries like MATHL.LIB for real arithmetic and FP87.LIB for 8087/80287 coprocessor acceleration, building briefly on the console I/O enhancements from version 1.5 for more robust input/output handling.[22]
Performance optimizations in Turbo C 2.0 delivered a 20-30% faster compiler and linker compared to version 1.5, achieving compilation speeds exceeding 16,000 lines per minute,[24] alongside tweaks for smaller executables through code generation options like register variables, jump optimization, and model-specific libraries (e.g., tiny model .COM files).[22] Benchmarks against Microsoft QuickC 2.0 showed Turbo C producing smaller executables in most tests—for instance, 9,692 bytes versus 11,405 bytes for the Dhrystone benchmark—and significantly faster linking times, often about twice as quick (e.g., 5.28 seconds versus 9.56 seconds for Dhrystone).[25] These improvements prioritized efficiency for resource-constrained DOS environments, recommending functions like puts over printf for reduced code size and quicker execution.[22]
While primarily targeted at IBM PC compatibles running DOS 2.0 or higher with at least 448K RAM, Turbo C 2.0 was adapted for the Atari ST platform and distributed in Europe under the name Pure C, though Borland did not maintain subsequent development for that version.[12] This release marked the culmination of Turbo C's evolution as a standalone C compiler, paving the way for its integration with C++ features in Borland's Turbo C++ 1.0 the following year.[22]
Features
Integrated Development Environment
The Integrated Development Environment (IDE) of Turbo C provided a unified platform for editing, compiling, linking, and executing C programs, designed to streamline development without requiring separate tools. At its core, the IDE featured a full-screen editor supporting auto-indentation (toggled via Ctrl-O I), syntax checking through integrated error tracking, and block operations such as marking (Ctrl-K B/K), moving (Ctrl-K V), copying (Ctrl-K C), and deleting (Ctrl-K Y) text blocks. The editor handled lines up to 248 characters in a 77-column width and used a command structure similar to SideKick's Notepad and Turbo Pascal's editor. Project and workspace management enabled multi-file builds through the Project menu, where users could create .PRJ files specifying dependencies (e.g., MYMAIN.C including MYFUNCS.H) and utilize the Make utility for automatic recompilation of modified files.[26] The user interface evolved from a monochrome text-based design in version 1.0, featuring pull-down menus and split-screen views (Edit and Message windows with zoom toggles), to a graphical blue-screen interface in version 2.0 that incorporated dialog boxes for enhanced navigation and configuration. This blue-screen layout included a main menu bar accessible via F10 or Alt-key shortcuts, an Edit window for code, a Message window for outputs, and a Quick-Ref line for command summaries, supporting text and graphics modes across adapters like CGA, EGA, and VGA.[26][22] Integrated tools enhanced usability, including a context-sensitive help system invoked by F1 for hyperlinked manual access and summaries, a sample code browser with examples like HELLO.C and WORDCNT.C, and an error navigator that highlighted issues in the source while listing them in the Message window, navigable via F7/F8 or Alt-F7/F8. Workflow efficiency was prioritized with one-key operations such as F9 for compilation and linking to EXE, Alt-F9 for object file compilation, and Alt-R or Ctrl-F9 for execution, achieving speeds over 7,000 lines per minute. Support for custom key bindings (e.g., via TCINST.EXE or TCCONFIG.TC files) and macros (defined in the Defines menu or TURBOC.CFG) allowed personalization, while the IDE's error-tracking feature simultaneously displayed warnings in the Message window and positioned the cursor at the fault in the Edit window.[26][22] Hardware adaptation focused on low-memory environments, requiring a minimum of 384 KB RAM in version 1.0 and 448 KB in version 2.0 (512 KB recommended for full functionality) and supporting efficient memory models like the tiny model limited to 64 KB total size. The IDE optimized for floppy or hard disk setups with subdirectory support and EMS for the edit buffer in version 2.0, ensuring accessibility on resource-constrained IBM PC compatibles.[26][22]Compiler and Libraries
The Turbo C compiler offered partial compliance with the draft-proposed ANSI C standard in versions 1.0 and 1.5, supporting core features like function prototypes while incorporating K&R C elements, with fuller ANSI alignment in version 2.0 through keywords such asvoid, const, and volatile, and the _STDC_ macro definition.[18][27] It targeted Intel 8086 and 80286 processors, generating 16-bit native code optimized for MS-DOS systems with a one-pass compilation process exceeding 7,000 lines per minute on a 6 MHz IBM AT.[28][27]
Optimization capabilities centered on a peephole optimizer that scanned small code windows to eliminate redundant jumps, reorganize loops and switch statements, and suppress unnecessary loads, enabled via the -O flag for jump optimization or -G for speed bias.[28][27] Trade-offs between code size and execution speed were adjustable, with register variables allocated by default (-r option) to leverage CPU registers for frequent accesses.[18] To manage large programs within the 1 MB address space limit of 8086/8088 systems, the compiler supported overlays through #pragma overlay directives and runtime functions like farmalloc() for dynamic segment loading, though the TLINK linker imposed restrictions on overlay implementation.[28][27]
The standard C library, distributed as CL.LIB and related modules like MATHL.LIB, provided over 300 routines implementing ANSI draft functions such as printf(), malloc(), and fopen(), alongside Borland extensions for MS-DOS integration.[28] The <graphics.h> header exposed the Borland Graphics Interface (BGI) for 2D graphics on adapters like CGA, EGA, and Hercules, with functions including initgraph() for mode initialization, circle() and line() for drawing primitives, setcolor() for palette control, and putimage() for bitmap handling, linked via graphics.lib.[27] Complementing this, the <dos.h> header supplied low-level DOS and 8086 interfacing via functions like geninterrupt() for software interrupts, bdos() for DOS calls, inport() and outport() for I/O port access, and _dos_getdate() for system time retrieval, enabling direct hardware manipulation without assembly.[28][27]
Inline assembly integration allowed embedding x86 instructions directly in C code using the asm keyword (e.g., asm { mov ax, bx }) or __asm statements, with a limit of 480 bytes per block and compatibility with MASM 4.0+ syntax, activated by the -B compiler option.[18][27] Pragmas provided additional control, such as #pragma inline to force assembly expansion, #pragma overlay for segment alignment and loading in memory models like large or huge, and #pragma warn to enable or suppress specific diagnostic messages (e.g., #pragma warn +voi for void expression warnings).[28][27]
Output primarily consisted of MS-DOS EXE executables, generated by default across memory models, with COM files supported exclusively in the tiny model using the -t option for compact, single-segment programs under 64 KB.[18][27] Supporting utilities included TLINK for linking .OBJ files into EXE or COM formats while resolving symbols and incorporating libraries, and TLIB for creating and maintaining custom .LIB files from object modules.[18] The integrated development environment invoked the compiler seamlessly during project builds, streamlining the transition from source to executable.[18]