Turbo Pascal
Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the programming language Pascal running on the operating systems CP/M, CP/M-86, and MS-DOS. It was originally developed by Anders Hejlsberg at Borland, and was notable for its very fast compiling. Turbo Pascal, and the later but similar Turbo C, made Borland a leader in PC-based development tools. For versions 6 and 7 (the last two versions), both a lower-priced Turbo Pascal and more expensive Borland Pascal were produced; Borland Pascal was oriented more toward professional software development, with more libraries and standard library source code. The name Borland... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the programming language Pascal running on the operating systems CP/M, CP/M-86, and MS-DOS. It was originally developed by Anders Hejlsberg at Borland, and was notable for its very fast compiling. Turbo Pascal, and the later but similar Turbo C, made Borland a leader in PC-based development tools. For versions 6 and 7 (the last two versions), both a lower-priced Turbo Pascal and more expensive Borland Pascal were produced; Borland Pascal was oriented more toward professional software development, with more libraries and standard library source code. The name Borland Pascal is also used more generically for Borland's dialect of the language Pascal, significantly different from Standard Pascal. Borland has released three old versions of Turbo Pascal free of charge because of their historical interest: the original Turbo Pascal (now known as 1.0), and versions 3.02 and 5.5 for DOS, while Borland's French office released version 7.01 on its FTP. ==Features== ===Assembly language=== While all versions of Turbo Pascal could include inline machine code, starting with version 6 it was possible to integrate assembly language within Pascal source code. Support for the various x86 memory models was provided by inline assembly, compiler options, and language extensions such as the "absolute" keyword. The Turbo Assembler, TASM, a standard x86 assembler independent of TP, and source-compatible with the widely used Microsoft Macro Assembler MASM, was supplied with the enhanced "Borland Pascal" versions. ===Debugging and profiling=== The IDE provided several debugging facilities, including single stepping, examination and changing of variables, and conditional breakpoints. In later versions assembly-language blocks could be stepped through. The user could add breakpoints on variables and registers in an IDE window. Programs using IBM PC graphics mode could flip between graphics and text mode automatically or manually, or display both on two screens. For cases where the relatively simple debugging facilities of the IDE were insufficient, Turbopower Software produced a more powerful debugger, T-Debug. The same company produced Turbo Analyst and Overlay Manager for Turbo Pascal. T-Debug was later updated for Turbo Pascal 4, but discontinued with the release of Borland's Turbo Debugger (TD), which also allowed some hardware intervention on computers equipped with the new 80386 processor. TD was usually supplied in conjunction with the Turbo Assembler and the Turbo Profiler, a code profiler that reported on the time spent in each part of the program to assist program optimisation by finding bottlenecks. The books included with Borland Pascal had detailed descriptions of the Intel assembler language, including the number of clock cycles required by each instruction. Development and debugging could be carried out entirely within the IDE unless the advanced debugging facilities of Turbopower T-Debug, and later TD, were required. Later versions also supported remote debugging via an RS-232 communication cable. ===Units=== Over the years, Borland enhanced not only the IDE, but also extended the programming language. A development system based on ISO standard Pascal requires implementation-specific extensions for the development of real-world applications on the platforms they target. Standard Pascal is designed to be platform-independent, so prescribes no low-level access to hardware- or operating system-dependent facilities. Standard Pascal also does not prescribe how a large program should be split into separate compiling units. From version 4, Turbo Pascal adopted the concept of units from UCSD Pascal. Units were used as external function libraries, like the object files used in other languages such as FORTRAN or C. For example, the line uses crt; in a program included the unit called crt; the uses is the mechanism for using other compiling units. interface and implementation were the keywords used to specify, within the unit, what was (and what was not) visible outside the unit. This is similar to the public and private keywords in other languages such as C++ and Java. Units in Borland's Pascal were similar to Modula-2's separate compiling system. In 1987, when Turbo Pascal 4 was released, Modula-2 was making inroads as an educational language which could replace Pascal. Borland, in fact, had a Turbo Modula-2 compiler, but only released it on CP/M (its user interface was almost identical to that of Turbo Pascal 1–3) with little marketing. A much improved DOS version was developed, but as Borland was unwilling to publish the results, the authors including Niels Jensen bought the rights and formed Jensen & Partners International to publish it as JPI TopSpeed Modula-2. Instead Borland chose to implement separate compiling in their established Pascal product. Separate compiling was not part of the standard Pascal language, but was already available in UCSD Pascal, which was very popular on 8-bit machines. Turbo Pascal syntax for units appears to have been borrowed from UCSD Pascal. Earlier versions of Turbo Pascal, designed for computers with limited resources, supported a "chain and execute" system of dynamic linking for separately compiled objects, similar to the system widely used in BASIC. Also, the language had a statement to include separate source code in a program when necessary, and overlaying was supported from TP3, but, as with overlays, chained objects had to fit into the original (limited) program memory space. As computing and storage facilities advanced, the ability to generate large EXE files was added to Turbo Pascal, with the ability to statically link and collectively load separately compiled objects. The .TPU files output by compiling a Turbo Pascal unit are tightly linked to the internal structures of the compiler, rather than standard .OBJ linkable files. This improved compiling and linking times, but meant that .TPU files could not be linked with the output of other languages or even used with different releases of Turbo Pascal unless recompiled from source. ===Object-oriented programming=== From version 5.5 some object-oriented programming features were introduced: classes, inheritance, constructors and destructors. The IDE was already augmented with an object browser interface showing relations between objects and methods and allowing programmers to navigate the modules easily. Borland called its language Object Pascal, which was greatly extended to become the language underlying Delphi (which has two separate OOP systems). The name "Object Pascal" originated with the Pascal extensions developed by Apple Computer to program its Lisa and Macintosh computers. Pascal originator Niklaus Wirth consulted in developing these extensions, which built upon the record type already present in Pascal. === Issue with CRT unit on fast processors=== Several versions of Turbo Pascal, including the last version 7, include a unit named CRT, which was used by many fullscreen text-mode applications on a CRT. This unit contains code in its initialization section to determine the CPU speed and calibrate delay loops. This code fails on processors with a speed greater than about 200 MHz and aborts immediately with a "Runtime Error 200" message. (the error code 200 had nothing to do with the CPU speed 200 MHz). This is caused because a loop runs to count the number of times it can iterate in a fixed time, as measured by the real-time clock. When Turbo Pascal was developed it ran on machines with CPUs running at 2.5 to 8 MHz, and little thought was given to the possibility of vastly higher speeds, so from about 200 MHz enough iterations can be run to overflow the 16-bit counter. A patch was produced when machines became too fast for the original method, but failed as processor speeds increased yet further, and was superseded by others. Programs subject to this error can be recompiled from source code with a compiler patched to eliminate the error (using a TURBO.TPL compiled with a corrected CRT unit) or, if source code is unavailable, executables can be patched by a tool named TPPATCH or equivalent, or by loading a terminate-and-stay-resident program before running the faulty program. There are also patches to the TP7 compiler, thus if the Pascal source is available, a new compiling's code will work without the compiled code needing a patch. If the source code is available, porting to libraries without CPU clock speed dependency is a solution too. ===Floating-point arithmetic=== There were several floating-point types, including single (the 4-byte [IEEE 754] representation) double (the 8-byte IEEE 754 representation), extended (a 10-byte IEEE 754 representation used mostly internally by numeric coprocessors) and Real (a 6-byte representation). In the early days, Real was the most popular. Most PCs of the era did not have a floating-point coprocessor so all floating-point arithmetic had to be done in software. Borland's own floating-point algorithms on Real were quicker than using the other types, though its library also emulated the other types in software. ==Versions== ===CP/M and DOS versions=== ====Version 1==== Version 1, released on 20 November 1983, was a basic all-in-one system, working in memory and producing .COM executable files for DOS and CP/M, and equivalent .CMD executables for CP/M-86 (different from .CMD batch files later used in 32-bit Microsoft Windows). Source code files were limited to 64 KB to simplify the IDE, and DOS .COM files were limited to 64 KB each of code, stack and global (static) variables. Program source code could be extended by using the include facility if the source code exceeded the memory limit of the editor. There were different versions of Turbo Pascal for computers running DOS, CP/M, or CP/M-86 with 64 KB of memory and at least one floppy disk drive. The CP/M version could run on the many CP/M machines of the time with Z80 processors, or an Apple II with Z80 card. The DOS and CP/M-86 versions ran on the many 8086 and 8088 machines which became available, including the IBM PC. The installer, lister, and compiler with its IDE, and the source code for a simple spreadsheet program called MicroCalc written by Philippe Kahn as a demonstration, would fit on a single floppy disc. A disc copy without MicroCalc would accommodate the source code and compiled executable of a reasonable-sized program—as it was common at the time for users to have only a single floppy drive as mass storage, it was a great convenience to be able to fit both the compiler and the program being written on a single disc, avoiding endless disc swapping. The architecture of the various machines running MS-DOS additionally limited the maximum user memory to under 1 MB (e.g., machines hardware-compatible with the IBM PC were limited to 640 KB). The Turbo Pascal IDE was advanced for its day. It was able to perform well and compile quickly with the amount of RAM on a typical home computer. The IDE was simple and intuitive to use, and had a well-organized system of menus. Early versions of the editor used WordStar key functions, which was the de facto standard at the time. Later versions of the IDE, designed for PCs with more disk space and memory, could display the definitions of the keywords of the language by putting the cursor over a keyword and pressing the F1 key (conventionally used to display help). Many definitions included example code. In addition to standard executable programs, the compiler could generate terminate-and-stay-resident (TSR) programs, small utilities that stayed in memory and let the computer do other tasks—running several programs at the same time, multitasking, was not otherwise available. Borland produced a small application suite called Sidekick that was a TSR letting the user keep a diary, notes, and so forth. ===Turbo Pascal for Windows=== Two versions named "Turbo Pascal for Windows" (TPW), for Windows 3.x, were released: TPW 1.0, based on Turbo Pascal 6 but released about 2 years later, and 1.5, released after Turbo Pascal 7; they were succeeded by Borland Pascal 7, which had Windows support. The Windows compiler in Pascal 7 was titled Borland Pascal for Windows. Both versions built Windows-compatible programs, and featured a Windows-based IDE, as opposed to the DOS-based IDE in Turbo Pascal. The IDE and editor commands conformed to the Microsoft Windows user interface guidelines instead of the classic TP user interface. The support for Windows programs required the Object Windows Library (OWL), similar but not identical to that for the first release of Borland C++, and radically different from the earlier DOS Turbo Vision environment. Turbo Pascal was superseded for the Windows platform by Delphi; the Delphi compiler can produce console programs and graphical user interface (GUI) applications, so that using Turbo and Borland Pascal became unnecessary. ===Turbo Pascal for Macintosh=== Borland released Turbo Pascal for Macintosh in 1986. Much like versions 1 to 3 for other operating systems, it was written in compact assembly language and had a very powerful IDE, but no good debugger. Borland did not support this product very well, although they issued a version 1.1, patched to run on the 32-bit Macintosh II. Macintosh support was dropped soon after. ===Freeware releases=== Borland released several versions of Turbo Pascal as freeware after they became "antique software", with 1.0 for DOS on 1 February 2000, 3.02 on 10 February 2000, 5.5 on 21 February 2002, Turbo Pascal 7.01 French version in year 2000. Most of the downloads are still available on the successor website of Embarcadero Technologies. ==See also== Borland Graphics Interface Free Pascal ==References== ==External links== Borland International, Inc. Turbo Pascal page: DOS 7.0, Windows 1.5 Inspire Corporation Turbo Pascal page: DOS 7.0, Windows 1.5 Borland Software Corporation Turbo Pascal page: DOS 7.0 Turbo Pascal 3 Code Generation, a description of the Turbo Pascal 3.0 compiler Turbo Pascal Compiler Internals , complete source code of a Turbo Pascal 7.0-compatible compiler Borland/Inprise Pascal versions
References
- Turbo Pascal. https://en.wikipedia.org/w/index.php?oldid=1377931925 · 1795438144.7002156
Cite this
"Turbo Pascal". 1790895261. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1377931925 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy