Turbo Pascal
| Company type | Software |
|---|---|
| Industry | Software development tools |
| Founded | November 20, 1983 |
| Founder | Anders Hejlsberg |
Area served | CP/M, CP/M-86, MS-DOS platforms |
| Products | Compiler, Integrated Development Environment (IDE) |
| Owner | Borland |
Turbo Pascal is an integrated software development suite that combines both a compiler and an integrated development environment (IDE) designed for the Pascal programming language, compatible with CP/M, CP/M-86, and MS-DOS platforms. Created by Anders Hejlsberg at Borland, it gained recognition for its remarkably swift compilation speed. Alongside its counterpart Turbo C, Turbo Pascal played a crucial role in establishing Borland's prominence in the PC development tools market.
The 6th and 7th editions of Turbo Pascal offered two versions: a more affordable Turbo Pascal and a premium Borland Pascal edition tailored for professional developers, featuring expanded libraries and access to source code. The term Borland Pascal also denotes Borland's specific Pascal dialect, which diverges significantly from Standard Pascal.
Borland has released three landmark Turbo Pascal editions at no cost: the original version 1.0, as well as versions 3.02 and 5.5 for DOS. Additionally, the French branch of Borland distributed version 7.01 via FTP.
History
Philippe Kahn recognized a niche in programming tools by creating an all-in-one package that integrated editing, compiling, and linking with enhanced performance and resource efficiency compared to existing professional software. This comprehensive toolkit included a custom text editor, compiler, and all necessary components for generating executables, sold directly through mail order at an affordable price of , bypassing traditional retail outlets.
The foundation of the Turbo Pascal compiler traces back to Anders Hejlsberg’s Blue Label Pascal compiler developed in 1981 for the NasSys cassette operating system on the Nascom microcomputer. Borland licensed Hejlsberg’s "PolyPascal" core, adding its own user interface and editor enhancements. Hejlsberg subsequently joined Borland as the lead architect responsible for Turbo Pascal and the early versions of Borland Delphi.
Originally launched as Compas Pascal for CP/M, Turbo Pascal was officially released on November 20, 1983, supporting CP/M (including Apple II with Z-80 SoftCard), CP/M-86, and DOS platforms. Priced at $49.99 in the United States, it was considerably less expensive than rival compilers while maintaining high standards.
The "Turbo" branding emphasized its rapid compilation speeds and efficient runtime performance. Its one-pass compiler, implemented in assembly language, stored all build information in RAM, allowing significantly quicker edit/compile/run cycles compared to other Pascal or C compilers available at the time. The output COM-format executables outperformed interpreted languages such as BASIC or p-code-based UCSD Pascal.
Disks containing Turbo Pascal were distributed without copy protection under a "Book License," permitting multiple users to operate the software freely as long as it was not used concurrently at separate locations.
Reception
Within two years, Borland sold approximately 250,000 copies of Turbo Pascal—a figure Bruce F. Webster of Byte magazine described as "an astonishing number for a computer language." Half a year later, sales surpassed 400,000 units in a market estimated to have only about 30,000 potential customers.
In 1984, Jerry Pournelle commended Turbo Pascal as a well-documented and feature-rich product offered at an attractive price point, despite his reservations about an additional license fee for binary distribution. He estimated its value around $150 and noted that it met or exceeded competitors in both speed and capabilities. Pournelle also highlighted Turbo 2.0’s overlay support for large programs and criticized IBM’s refusal to resell it below $200 despite Turbo Pascal’s superior compatibility and performance relative to IBM’s own Pascal offerings.
Three reviewers from Byte praised Turbo Pascal as a practical, well-designed, and fast tool, labeling it a bargain especially on DOS and CP/M systems. In July 1984, Creative Computing favorably compared Turbo Pascal against more expensive alternatives from UCSD, IBM, and Microsoft, emphasizing its speed and adherence to language standards. The review lauded its documentation but expressed concern that its low price might diminish perceived value.
Computer Language magazine (September 1984) recommended version 2.0 for both novice and experienced programmers due to its rapid compilation times, PC graphics and sound extensions, comprehensive documentation, overlay support, and compliance with standard syntax. PC Magazine (November 1984) praised Turbo Pascal 2.0’s affordability, speed, stability, overlay capabilities, quality documentation, and rich ecosystem of third-party utilities. Its IDE facilitated programming even for beginners.
By August 1985, Pournelle regarded version 3.0 as an improvement while applauding Borland’s commitment to delivering value-driven products. Webster noted that despite a price increase to $69.95, Turbo Pascal stood out due to its compact size, fast compile times, and execution speed. Although some bugs persisted along with reduced compatibility on certain PC clones, Byte magazine (February 1986) strongly endorsed Turbo Pascal for Pascal development.
With version 4.0, Turbo Pascal introduced support for applications exceeding 64 KB alongside faster compilation and execution speeds; upgrading from earlier versions was straightforward. Reviews consistently recommended it as an indispensable tool for programmers.
In 1989, Byte awarded both Turbo C and Turbo Pascal with "Distinction" honors for their user-friendly interfaces and rapid performance—ideal characteristics for quick prototyping tasks. Pournelle praised versions 4.0 and 5.0 for enabling complex projects such as Anacreon, supported by extensive libraries from Borland and third parties.
Microsoft executive Scott MacGregor recalled Bill Gates' frustration over Microsoft’s slower development tools compared to Turbo Pascal's efficiency—highlighting how Borland’s small startup managed to outperform industry giants like Microsoft.
Successors
By the year 1995, Borland had transitioned from Turbo/Borland Pascal to the rapid application development (RAD) platform known as Borland Delphi, which is grounded in Object Pascal. Both the 32-bit and 64-bit editions of Delphi preserve compatibility with earlier portable Pascal improvements, including the static object model. This ensures that a significant amount of legacy Turbo Pascal source code can still be compiled and executed in contemporary environments.
Additionally, other developers have produced tools compatible with Turbo Pascal, most notably Free Pascal and Virtual Pascal.
Syntax
- Pascal does not distinguish between uppercase and lowercase letters.
- Traditional comment blocks are enclosed within
{ }or(* *), allowing multi-line annotations. Later iterations of Borland Pascal also introduced support for C++-style//comments that terminate at the end of the line. - The syntax for the
casestatement offers greater flexibility compared to standard Pascal. - Sets are restricted to a maximum of 256 (28) elements.
- The original Pascal
Stringtype, featuring a length byte with fixed storage, remains supported; newer versions introduced a null-terminated string variant, designating the original as "short string." Legacy programs that manipulate string length bytes directly must either declare strings as short strings or be modified accordingly.
A classic Turbo Pascal "Hello, World!" program:
<syntaxhighlight lang="Pascal"> program HelloWorld; begin
WriteLn('Hello World')
end. </syntaxhighlight>
An example prompting the user for their name and printing it 100 times:
<syntaxhighlight lang="Pascal"> program WriteName; var
i : Integer; Name : String;
begin
Write('Please tell me your name: ');
ReadLn(Name);
for i := 1 to 100 do
WriteLn('Hello ', Name);
ReadLn;
end. </syntaxhighlight>
Assembly language
Inline machine code was supported by all versions of Turbo Pascal; however, starting from version 6, embedding assembly language directly within Pascal source files became possible.
Support for different x86 memory models was provided through inline assembly instructions, compiler switches, and language enhancements such as the "absolute" keyword. The Turbo Assembler (TASM), compatible with the Microsoft Macro Assembler (MASM), was included with advanced editions of "Borland Pascal."
Debugging and profiling
The integrated development environment (IDE) offered debugging capabilities including single stepping, examination and modification of variables, and conditional breakpoints. Later releases enabled stepping through assembly code segments as well. Breakpoints could be established on specific variables and registers via the IDE interface. Programs utilizing IBM PC graphics modes had the ability to switch between graphics and text displays or show both simultaneously. For more sophisticated debugging needs, Turbopower Software created T-Debug, a robust debugger updated for Turbo Pascal 4 but discontinued when Borland introduced Turbo Debugger (TD), which supported hardware-level debugging on Intel 80386 processors.
Turbo Debugger was commonly packaged alongside Turbo Assembler and Turbo Profiler—a performance analysis tool that pinpointed slow sections by reporting execution times per code segment. Borland Pascal's manuals included comprehensive Intel assembler instruction timing data to assist developers in optimization efforts. Typically, development and debugging were conducted within the IDE unless advanced tools like T-Debug or TD were required.
Subsequent versions also incorporated support for remote debugging via RS-232 serial connections.
Units
Starting with version 4, Borland expanded Turbo Pascal beyond the traditional ISO Pascal by introducing units, which facilitated modular programming through separately compiled modules akin to libraries in FORTRAN or C. The uses directive allowed the inclusion of units such as crt, while the division into interface and implementation sections regulated symbol visibility, functioning similarly to public and private access specifiers found in languages like C++ and Java.
Borland’s approach to units mirrored the separate compilation model found in Modula-2. Although Borland created a Turbo Modula-2 compiler for CP/M, it saw limited promotion; a DOS variant was later released externally under the name JPI TopSpeed Modula-2. Instead, Borland chose to embed separate compilation directly into Turbo Pascal to preserve its competitive edge.
Separate compilation was not originally part of standard Pascal but was present in UCSD Pascal, which was widely used on 8-bit platforms; Turbo Pascal's unit syntax appears influenced by UCSD Pascal’s design. Prior versions of Turbo Pascal employed a "chain and execute" method for dynamic linking of separately compiled objects, similar to BASIC, alongside source inclusion directives and overlay support introduced in version 3. These mechanisms had to operate within stringent memory limits. As hardware capabilities improved, Turbo Pascal incorporated support for large executable files by statically linking separately compiled modules.
The compilation of units results in .TPU files that are closely tied to the compiler’s internal architecture, which enhances compilation and linking speed but restricts compatibility with other programming languages or different Turbo Pascal versions unless units are recompiled.
Object-oriented programming
Beginning with version 5.5, Turbo Pascal integrated fundamental object-oriented programming features including classes, inheritance, as well as constructors and destructors. The integrated development environment (IDE) provided an object browser for examining object hierarchies and methods. Borland marketed these enhancements under the name Object Pascal, which later served as the basis for the Delphi language, encompassing two separate OOP paradigms. The term "Object Pascal" traces back to Apple’s object-oriented extensions to Pascal for the Lisa and Macintosh, developed with input from Niklaus Wirth, the original creator of Pascal.
Problem with CRT unit on high-speed CPUs
Several editions of Turbo Pascal, including version 7, feature a CRT unit used primarily for fullscreen text-mode programs. During initialization, this unit calibrates delay loops by measuring processor speed; however, it malfunctions on CPUs running faster than approximately 200 MHz, triggering a "Runtime Error 200". This issue occurs because the calibration loop causes an overflow of a 16-bit counter at high clock rates—a limitation inherited from an era when CPUs operated between roughly 2.5 and 8 MHz.
Although fixes were issued to mitigate this problem, rapid increases in processor speeds soon made them ineffective. Affected applications can be corrected either by recompiling their source code with an updated CRT unit or by applying binary patches using utilities such as TPPATCH. Another workaround involves loading a terminate-and-stay-resident (TSR) program before starting the problematic application to prevent the error.
There are also compiler patches available for Turbo Pascal 7 that allow recompilation without encountering runtime errors. When source code is accessible, transitioning to libraries that do not rely on CPU speed measurements provides a more durable solution.
Floating-point calculations
Multiple floating point formats were supported, such as single (4-byte IEEE 754), double (8-byte IEEE 754), extended (10-byte IEEE 754, primarily utilized internally by numeric coprocessors), and Real (6-byte). Initially, the Real type was the most widely used because most personal computers lacked floating-point coprocessors, necessitating software-based computation. Borland’s implementation of the Real arithmetic routines was notably faster than alternatives, although emulation for other floating-point types was also available.
Version 1
Launched on 20 November 1983, Version 1 was a compact, integrated system generating .COM executables for DOS and CP/M, as well as .CMD files for CP/M-86 (which differed from later Windows batch scripts). Source files were confined to a 64 KB size limit to streamline the IDE; DOS .COM files restricted code, stack, and global variables each to 64 KB. When programs surpassed the editor’s memory constraints, include files could be employed.
Various Turbo Pascal editions catered to DOS, CP/M, or CP/M-86 environments on machines with 64 KB of memory and at least one floppy disk drive. The CP/M edition operated on Z80-based systems and Apple II computers equipped with Z80 cards. Versions for DOS and CP/M-86 targeted Intel 8086/8088 processors, including IBM PC compatibles. The installer package, IDE, compiler, and a demonstration spreadsheet application (MicroCalc by Philippe Kahn) all fit onto a single floppy disk—an essential feature since many users had only one floppy drive, minimizing disk swapping.
System hardware architecture restricted available user memory to less than 1 MB (for example, IBM PC compatibles were limited to 640 KB).
The Turbo Pascal IDE was sophisticated for its era: it offered rapid compilation within typical home computer RAM limits, featured an intuitive layout with well-organized menus, and initially used WordStar keybindings—the prevalent standard at that time. Subsequent releases expanded capabilities by utilizing increased disk capacity and memory to provide keyword definitions and sample code accessible through the F1 key.
Besides producing conventional executables, the compiler could also create terminate-and-stay-resident (TSR) programs—small utilities that remained resident in memory to facilitate basic multitasking before such features were natively supported by operating systems. Borland’s Sidekick suite was an example of TSR software offering functionalities like a diary and note-taking tools.
Version 2
Released on 17 April 1984, Version 2 represented an evolutionary enhancement over the initial Turbo Pascal release. The reference manual initially remained consistent with Version 1’s documentation but was supplemented by an "Addendum to Reference Manual: Version 2.0 and 8087 Supplement." Notable improvements included an overlay mechanism that allowed overlay procedures to be dynamically loaded from disk into designated memory areas within the fixed 64kB program code space. These overlay procedures could themselves contain nested overlays; however, frequent disk swapping could degrade performance unless a RAM disk was employed. Version 2 also introduced the Dispose procedure for managing the heap, enabling selective freeing of dynamic variables beyond the existing 'Mark/Release' approach. Compatibility enhancements included better support for WordStar commands and numeric keypad input on IBM PC compatibles.[1] Additional features encompassed a new text window interface and commands for CGA graphics mode, along with PC speaker tone generation capabilities. Furthermore, systems running DOS or CP/M-86 equipped with an 8087 math coprocessor could optionally utilize the TURBO-87 compiler variant, which supported the 8087's long real data types offering greater precision and faster execution than software-based real types; however, these data formats were not binary-compatible.[1]
The CP/M-80 version of Turbo Pascal 2 operated solely on Z80-based CP/M platforms.[2]
Version 3
Introduced on 17 September 1986, Turbo Pascal 3 brought in capabilities for turtle graphics. Alongside the inclusion of software real number support and a version for the 8087 coprocessor, Borland also released a variant using binary-coded decimal (BCD) arithmetic called TURBOBCD. This version matched the numeric range of real types but offered precision up to 18 significant digits.
Version 4
Launched on 20 November 1987, Version 4 represented a thorough overhaul, altering both its appearance and internal mechanics. The compiler began producing .EXE files for DOS, moving away from the simpler .COM format. Support for CP/M and CP/M-86 platforms was discontinued. This edition introduced units and featured a full-screen text interface with drop-down menus, replacing the previous text-based menu system and separate editor. Additionally, an optional add-on named the Turbo Pascal Graphix Toolbox was made available.
Version 5.0
Released on 24 August 1988, Version 5.0 set blue as the default background color in the editor—a characteristic maintained in Borland’s DOS compilers until the mid-1990s. It incorporated debugger functionalities such as breakpoints and watch variables. Subsequent releases offered two editions: a cost-effective "Turbo" version and a more feature-rich "Borland" version with additional tools.
Version 5.5
Available from 2 May 1989, Version 5.5 introduced object-oriented programming constructs to Pascal, including classes, static and dynamic objects, constructors, destructors, and inheritance—forming the basis of Object Pascal in Borland Delphi. The integrated development environment adopted the blue color scheme that became standard in later Borland products and added context-sensitive help displaying descriptions of built-in functions along with the option to copy code snippets directly into the editor.
Version 6.0
Released on 23 October 1990, Version 6 incorporated support for inline assembly language, introduced the Turbo Vision library, enabled mouse interaction, facilitated clipboard text operations, and implemented a multiple document interface capable of handling up to nine simultaneous edit windows.
Version 7.0
Version 7 debuted on 27 October 1992. Enhancements over Version 6 included the ability to generate executables for both DOS and Windows platforms, create Windows DLLs, and utilize syntax highlighting within the editor.
Turbo Pascal for Windows
Two editions of "Turbo Pascal for Windows" (TPW) targeting Windows 3.x were released: TPW 1.0, which was based on Turbo Pascal 6 but launched approximately two years later, followed by version 1.5 after Turbo Pascal 7's release. Both were eventually superseded by Borland Pascal 7, which integrated Windows support. The Windows compiler within Pascal 7 was known as Borland Pascal for Windows.
These versions compiled programs compatible with Windows and featured a Windows-native IDE that replaced the earlier DOS-based interface of Turbo Pascal. This new IDE conformed to Microsoft Windows user interface standards rather than retaining the traditional Turbo Pascal design. Support for Windows applications relied on the Object Windows Library (OWL), differentiating it from earlier DOS-based Turbo Vision environments. Ultimately, Turbo Pascal was replaced on Windows platforms by Delphi (software), whose compiler supports both console and graphical user interface applications, rendering Turbo Pascal and Borland Pascal obsolete for Windows development purposes.
Turbo Pascal for Macintosh
In 1986, Borland introduced Turbo Pascal for Macintosh. This edition, akin to its early counterparts on different systems, was developed in highly optimized assembly language and included a feature-rich integrated development environment. However, it did not offer an advanced debugging tool. The support was rather limited; an update to version 1.1 added compatibility with the 32-bit Macintosh II model, but eventually, Borland ceased Macintosh platform support.
Freeware releases
After Turbo Pascal versions reached legacy status, Borland released several editions as freeware. These included the DOS version 1.0 (2000), 3.02 (2000), 5.5 (2002), and the French-language Turbo Pascal 7.01 (2000). Most of these remain available for download through the website maintained by Embarcadero Technologies, Borland’s successor.
See also
External links
- Borland International, Inc. Turbo Pascal pages: DOS 7.0, Windows 1.5
- Inspire Corporation Turbo Pascal pages: DOS 7.0, Windows 1.5
- Borland Software Corporation Turbo Pascal page: DOS 7.0
- Turbo Pascal 3 Code Generation, an overview of the Turbo Pascal 3.0 compiler
- Turbo Pascal Compiler Internals, full source code of a compiler compatible with Turbo Pascal 7.0
- Borland/Inprise Pascal versions
- Articles with short description
- 1983 software
- Borland software
- CP/M software
- DOS software
- Classic Mac OS software
- Integrated development environments
- Object-oriented programming languages
- Pascal (programming language) compilers
- Assembly language software
- Articles with example Pascal code
- Pages with reference errors