Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Turbo Pascal
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer programming language}} {{Use dmy dates|date=April 2019|cs1-dates=y}} {{Infobox software | name = Turbo Pascal | logo = | screenshot = | caption = | author = [[Anders Hejlsberg]] (at Borland) | developer = [[Borland]] | released = {{Start date and age|1983|11|20|df=yes}}<ref name="initrel">{{cite web |url=https://www.thoughtco.com/history-of-delphi-1056847 |title=Delphi history: from Pascal to Embarcadero Delphi XE 2 |last=Gajic |first=Zarko |date=17 March 2017 |website=ThoughtCo |publisher=Dotdash<!--Was About.com--> |access-date=2021-02-18 |url-status=live |archive-url=https://web.archive.org/web/20110707074831/http://delphi.about.com/cs/azindex/a/dhistory.htm |archive-date=7 July 2011}}</ref><ref name=releasedates/> | latest release version = | latest release date = | latest preview version = | latest preview date = | operating system = [[CP/M]], [[CP/M-86]], [[MS-DOS]], [[Windows 3.x]], [[Classic Mac OS]] | platform = [[Z80]], [[x86]], [[Motorola 68000 series|68000]], [[PC-98]] | language = English | genre = [[Integrated development environment]] | license = | website = }} '''Turbo Pascal''' is a software development system that includes a [[compiler]] and an [[integrated development environment]] (IDE) for the programming language [[Pascal (programming language)|Pascal]] running on the [[operating system]]s [[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 [[Library (computing)|libraries]] and standard library [[source code]].<!--I think the BP licence was for developing software for sale, while TP was more restrictive, but don't remember for sure and have no source. pol098--> 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. <ref name=tp10/><ref name="tp302">{{cite web |url=http://edn.embarcadero.com/article/20792 |title=Antique Software: Turbo Pascal v3.02 |last=Intersimone |first=David |date=2000-02-10 |publisher=Embarcadero Technologies |access-date=2010-11-09 |archive-url=https://web.archive.org/web/20101124092418/http://edn.embarcadero.com/article/20792 |archive-date=2010-11-24 |url-status=dead}}</ref><ref name=tp55/> == History == [[Philippe Kahn]] first saw an opportunity for Borland, his newly formed software company, in the field of programming tools. Historically, the vast majority of programmers saw their workflow in terms of the edit/compile/link cycle, with separate tools dedicated to each task. Programmers wrote [[source code]] using a [[text editor]]; the source code was then compiled into [[object code]] (often requiring multiple passes), and a [[linker (computing)|linker]] combined object code with runtime libraries to produce an executable program. In the early IBM PC market (1981–1983) the major [[programming tool]] vendors all made compilers that worked in a similar fashion. For example, the [[Microsoft Pascal]] system consisted of two compiler passes and a final linking pass (which could take minutes on systems with only floppy disks for secondary storage, even though programs were very much smaller than they are today). This process was less resource-intensive than the later [[integrated development environment]] (IDE). Vendors of software development tools aimed their products at professional developers, and the price for these basic tools plus ancillary tools like [[Profiling (computer programming)|profiler]]s ran into the hundreds of dollars. Kahn's idea was to package all these functions in an integrated programming toolkit designed to have much better performance and resource utilization than the usual professional development tools, and charge a low price for a package integrating a custom text editor, compiler, and all functionality needed to produce executable programs. The program was sold by direct mail order for {{US$|link=yes|49.95}}, without going through established sales channels (retailers or resellers).<ref>{{cite web|url=https://archive.org/details/micro-cornucopia-magazine-1984-12/page/n63|title=Micro Cornucopia (December 1984)|date=December 1984}}</ref> The Turbo Pascal compiler was based on the Blue Label Pascal compiler originally produced for the NasSys cassette-based operating system of the [[Nascom]] microcomputer in 1981 by [[Anders Hejlsberg]]. Borland licensed Hejlsberg's "PolyPascal" compiler core (''Poly Data'' was the name of Hejlsberg's company in Denmark), and added the user interface and editor. Anders Hejlsberg joined the company as an employee and was the architect for all versions of the Turbo Pascal compiler and the first three versions of Borland [[Delphi (software)|Delphi]].<ref name="tp10">{{cite web |url=http://edn.embarcadero.com/article/20693 |title=Antique Software: Turbo Pascal v1.0 |last=Intersimone |first=David |date=2000-02-01 |publisher=Embarcadero Technologies |access-date=2010-11-09 |archive-url=https://web.archive.org/web/20101221211755/http://edn.embarcadero.com/article/20693 |archive-date=2010-12-21 |url-status=dead}}</ref> The compiler was first released as Compas Pascal for [[CP/M]], and then released on 20 November 1983<ref name=releasedates>{{cite web |url=https://community.embarcadero.com/blogs/entry/turbo-pascal-version-10--the-turbo-pascal-release-dates-39142 |title=Turbo Pascal version 1.0 - the Turbo Pascal release dates |access-date=2020-09-09 |archive-date=2017-04-24 |archive-url=https://web.archive.org/web/20170424061647/https://community.embarcadero.com/blogs/entry/turbo-pascal-version-10--the-turbo-pascal-release-dates-39142 |url-status=dead }}</ref> as Turbo Pascal for CP/M (including the [[Apple II]] fitted with a [[Z-80 SoftCard]], effectively converting the [[MOS Technology 6502|6502]]-based Apple into a CP/M machine, the Commodore 64 with CP/M cartridge, and the later [[DEC Rainbow]]), CP/M-86, and DOS machines. On its launch in the [[United States]] market, Turbo Pascal retailed for {{USD|link=yes|49.99}}, a very low price for a compiler at the time. The integrated Pascal compiler was of good quality compared to other Pascal products of the time.<ref name="Chapman 2006">{{cite book |last=Chapman |first=Merrill R. |year=2006 |title=In Search of Stupidity: Over 20 Years of High-Tech Marketing Disasters |publisher=Springer-Verlag |page=118 |url=https://books.google.com/books?id=8jntt5nZZ5UC&pg=PA118 |isbn=978-1-59059-721-7 |quote=Borland made its debut in the industry in a big way with the release of Turbo Pascal in November 1983. Turbo Pascal was a port to DOS and CP/M of Anders Hejlsberg's COMPAS Pascal, and it was released by Borland at a price that seemed amazing at that time: $49.95, about one-tenth the price of comparable products. |access-date=2015-12-13 |archive-url=https://web.archive.org/web/20160623183825/https://books.google.com/books?id=8jntt5nZZ5UC&pg=PA118 |archive-date=2016-06-23 |url-status=live}}</ref> The Turbo name alluded to the speed of compiling and of the executables produced. The edit/compile/run cycle was fast compared to other Pascal implementations because everything related to building the program was stored in RAM, and because it was a [[one-pass compiler]] written in [[assembly language]]. Compiling was much faster than compilers for other languages (even Borland's own later compilers for C),{{Citation needed|date=March 2009}} and other Pascal compilers, and programmer time was also saved since the program could be compiled and run from the IDE. The execution speed of these [[COM file|COM]]-format programs was a revelation for developers whose only prior experience programming microcomputers was with [[Interpreter (computing)|interpreted]] BASIC or [[UCSD Pascal]], which compiled to [[p-code machine|p-code]] which was then interpreted at runtime. Unlike some other development tools, Turbo Pascal disks had no [[copy protection]]. Turbo Pascal came with the "Book License": "You must treat this software ''just like a book'' ... [it] may be used by any number of people ... may be freely moved from one computer location to another, so long as there is no possibility of it being used at one location while it's being used at another."<ref>{{Cite web|url=https://groups.google.com/g/borland.public.delphi.non-technical/c/dDP138UWW6k?pli=1|title=The no-nonsense license|website=groups.google.com}}</ref> === Reception === Borland sold about 250,000 copies of Turbo Pascal in two years, which [[Bruce F. Webster]] of ''[[Byte (magazine)|Byte]]'' described as "an amazing figure for a computer language".<ref name="webster198508">{{cite news |last=Webster |first=Bruce F. |author-link=Webster, Bruce F. |date=August 1985 |url=https://archive.org/stream/byte-magazine-1985-08/1985_08_BYTE_10-08_Declarative_Languages#page/n361/mode/2up |title=Greetings and Agitations |work=Byte |page=355 |access-date=27 October 2013}}</ref> He reported six months later that the figure had risen to "more than 400,000 copies in a marketplace that had been estimated as having only 30,000 potential buyers".<ref name="webster198602">{{cite news |url=https://archive.org/stream/byte-magazine-1986-02/1986_02_BYTE_11-02_Text_Processing#page/n343/mode/2up |title=Programming Tool and the Atari ST |work=Byte |date=February 1986 |access-date=9 May 2015 |author=Webster, Bruce |page=331}}</ref> [[Jerry Pournelle]] wrote in the magazine in February 1984 that Turbo Pascal "comes close to what I think the computer industry is headed for: well documented, standard, plenty of good features, and a reasonable price". He disliked the requirement to buy another license to distribute binaries, but noted that "it turns out not to be a lot more. Borland only wants another {{US$|long=no|100}}" atop the {{US$|long=no|49.95}} base price, and that "my first impression of Turbo is that it's probably worth {{US$|long=no|149.95}}. It looks to do everything [[Pascal/MT+|MT+]] ''with the Speed Programming Package'' does, and maybe even do it faster and better".<ref name="pournelle198402">{{cite news |url=https://archive.org/stream/byte-magazine-1984-02/1984_02_BYTE_09-02_Benchmarks#page/n113/mode/2up |title=Chaos Manor Gets Its Long-Awaited IBM PC |work=Byte |date=February 1984 |access-date=8 February 2015 |author=Pournelle, Jerry |page=113 |author-link=Jerry Pournelle}}</ref> Pournelle reported in July that Turbo 2.0's [[overlay (programming)|overlay]]s "[allow] you to write big programs". According to Kahn, IBM had refused to resell Turbo Pascal unless the price was at least {{US$|long=no|200}}; Pournelle noted that "Turbo is much better than the Pascal IBM sells", and unlike the latter was compatible with the [[IBM PCjr]].<ref name="pournelle198407">{{cite magazine |url=http://blog.modernmechanix.com/2011/11/07/the-west-coast-faire/ |title=The West Coast Faire |magazine=[[Byte (magazine)|Byte]] |date=July 1984 |access-date=8 November 2011 |author=Pournelle, Jerry |author-link=Jerry Pournelle |page=136 |archive-url=https://web.archive.org/web/20120128010050/http://blog.modernmechanix.com/2011/11/07/the-west-coast-faire/ |archive-date=2012-01-28 |url-status=dead}}</ref> Three ''Byte'' reviewers praised Turbo Pascal in the same issue. One reviewer said that because of dialect differences "Turbo is not really Pascal. But it's very useful". While cautioning that it was not suitable for developing very large applications, he concluded that Turbo Pascal "is well written, fun to use at times, and fast enough to make up for its few shortcomings ... it is a bargain that shouldn't be passed up". A second called the DOS version "without doubt, the best software value I have ever purchased", while a third said that Borland "deserves praise for" the "high-value" CP/M version.<ref name="wadlow198407">{{cite news |url=https://archive.org/stream/byte-magazine-1984-07/1984_07_BYTE_09-07_Computers_and_Video#page/n263/mode/2up |title=Turbo Pascal |work=Byte |date=July 1984 |access-date=23 October 2013 |author1=Wadlow, Tom |author2=Pierce, Al |author3=Bridger, Mark |pages=263–278 |type=review}}</ref> Also in July 1984, ''[[Creative Computing]]'' favorably compared Turbo Pascal to what the reviewer described as mediocre and expensive Pascals from UCSD, IBM, and Microsoft. He reported converting code written in IBM Pascal in less than 30 minutes, and that "under IBM Pascal, the average program took two weeks to write. With Turbo Pascal, the average is now two days". While noting the .COM and 64 KB limitations, the reviewer approved of Turbo's close adherence to the Jensen and Wirth language standard. The documentation was, he wrote, of "above average readability" and superior to IBM Pascal's. "My only fear", the review concluded, was that "it is grossly underpriced, and I worry that people might fail to take it seriously".<ref name="blank198407">{{Cite magazine |last=Blank |first=George |date=July 1984 |title=Turbo Pascal; the best cost less. |url=https://www.atarimagazines.com/creative/v10n7/53_Turbo_Pascal_the_best_co.php |access-date=2025-03-15 |magazine=Creative Computing |page=53 |volume=10 |issue=7}}</ref> "Turbo Pascal is the Pascal to acquire", ''Computer Language'' in September said of version 2.0. Praising its speed, extensions including PC graphics and sound, documentation, ease of using overlays, and "highly standard syntax", the magazine recommended Turbo to both new and experienced programmers.{{r|rodman198409}} ''[[PC Magazine]]'' was similarly complimentary in November, stating that "nothing like Turbo Pascal has ever existed for PC-DOS before". It praised 2.0's low price, speed, stability, ease of implementing overlays, and unusually good documentation for a compiler, and noted the existence of many utilities for Turbo Pascal from other companies. The review stated that the IDE that simplified the edit-compile-run-debug loop made Turbo Pascal accessible, like BASIC, to new programmers.<ref name="duntemann19841113">{{cite news |url=https://books.google.com/books?id=-Ukz6hjZEA4C&pg=PA276 |title=Supercharged Turbo Pascal |work=[[PC Magazine]] |date=1984-11-13 |access-date=25 October 2013 |author=Duntemann, Jeff |page=276}}</ref> Pournelle in August 1985 called version 3.0 "a distinct improvement on the already impressive version 2" and said that the new book license "seems quite fair to me". He said that "Turbo Pascal has got to be the best value in languages on the market today", and that Borland led the industry in "delivering excellent products at reasonable costs".<ref name="pournelle198508">{{Cite magazine |last=Pournelle |first=Jerry |date=August 1985 |title=The West Coast Computer Faire |url=https://archive.org/details/byte-magazine-1985-08/page/n300/mode/1up?view=theater |magazine=Byte |pages=293–326 |access-date=2023-11-05}}</ref> Webster also praised 3.0, stating in August 1985 that Turbo Pascal "is best known for its small size, incredible compile speeds, and fast execution times". He noted that the software's quality and low price was especially surprising after the "[[JRT Pascal]] fiasco", and stated that even at the new higher {{US$|long=no|69.95}} price, it was "probably still the best software deal on the market".{{r|webster198508}} Despite finding what the magazine called "a serious bug" in 3.0, and decreased compatibility with [[PC clone]]s, ''Byte'' in February 1986 stated that "it is hard to avoid recommending Turbo to anyone who wants to program in Pascal", citing improved speed and graphic routines.<ref name="bridger198602">{{cite news |url=https://archive.org/stream/byte-magazine-1986-02/1986_02_BYTE_11-02_Text_Processing#page/n291/mode/2up |title=Turbo Pascal 3.0 |work=Byte |date=February 1986 |access-date=9 May 2015 |author=Bridger, Mark |page=281}}</ref> When reviewing four other Pascal compilers in December 1986, the magazine described Turbo Pascal 3.0 as "practical and attractive to programmers at all levels of expertise".<ref name="shammas198612">{{cite news |url=https://archive.org/stream/byte-magazine-1986-12/1986_12_BYTE_11-13_Graphics_Algorithms#page/n273/mode/2up |title=Pascal for the IBM PC |work=Byte |date=December 1986 |access-date=9 May 2015 |author=Shammas, Namir Clement |page=265}}</ref> Besides allowing applications larger than 64 KB, ''Byte'' in 1988 reported substantially faster compiling and executing for version 4.0, and that although it did not maintain previous versions' "almost total" backward compatibility, conversion was fast and easy. The reviewer concluded, "I highly recommend Turbo Pascal 4.0 as an addition to any programmer's software repertoire".<ref name="banks198802">{{Cite magazine |last=Banks |first=Walter |date=February 1988 |title=Turbo Pascal 4.0 |url=https://archive.org/details/byte-1988_02/page/n180/mode/1up?view=theater |magazine=Byte |pages=153–156 |access-date=2023-10-01}}</ref> ''Byte'' in 1989 listed Turbo C and Turbo Pascal as among the "Distinction" winners of the Byte Awards. Citing their user interface and continued emphasis on speed, the magazine stated that "for rapid prototyping there's not much better".<ref name="byte198901">{{Cite magazine |date=January 1989 |title=The Byte Awards |url=https://archive.org/stream/byte-magazine-1989-01/1989_01_BYTE_14-01_PC_Communications_and_Annual_Awards_and_Digitizing_Tablets#page/n371/mode/2up |magazine=Byte |page=327}}</ref> In the same issue Pournelle again praised version 4.0 and 5.0 of Turbo Pascal. Citing ''[[Anacreon (computer game)|Anacreon]]'' as "a good example of how complex a program you can write in Pascal", and the many libraries from Borland and other developers, he wrote "I think it may well be the language for the rest of us".<ref name="pournelle198901">{{Cite magazine |last=Pournelle |first=Jerry |author-link=Jerry Pournelle |date=January 1989 |title=To the Stars |url=https://archive.org/stream/byte-magazine-1989-01/1989_01_BYTE_14-01_PC_Communications_and_Annual_Awards_and_Digitizing_Tablets#page/n137/mode/2up |magazine=Byte |page=109}}</ref> Scott MacGregor of Microsoft said that [[Bill Gates]] "couldn't understand why our stuff was so slow" compared to Turbo Pascal. "He would bring in poor [[Greg Whitten]] [programming director of Microsoft languages] and yell at him for half an hour" because their company was unable to defeat Kahn's small startup, MacGregor recalled.<ref>{{cite book |last1=Wallace |first1=James |last2=Erickson |first2=Jim |title=Hard Drive: Bill Gates and the Making of the Microsoft Empire |year=1992 |publisher=[[John Wiley & Sons]] |isbn=0-471-56886-4 |page=[https://archive.org/details/harddrivebillgat00wall_0/page/277 277] |chapter=Growing Pains |chapter-url-access=registration |chapter-url=https://archive.org/details/harddrivebillgat00wall_0/page/277}}</ref> === Successors === By 1995 Borland had dropped Turbo/Borland Pascal and replaced it with the [[rapid application development]] (RAD) environment [[Borland]] [[Delphi (software)|Delphi]], based on Object Pascal. The [[32-bit computing|32]]- and [[64-bit computing|64-bit]] Delphi versions still support the more portable Pascal enhancements of the earlier products (i.e., those not specific to [[16-bit computing|16-bit]] code) including the earlier static object model. This language backwards compatibility means much old Turbo Pascal code can still be compiled and run in a modern environment today. Other suppliers have produced software development tools compatible with Turbo Pascal. The best-known are [[Free Pascal]] and [[Virtual Pascal]]. == Syntax == * Pascal is not [[case-sensitive]]. * Historically, Pascal comments are enclosed <code>{ within pairs of braces }</code>, or <code>(* left parenthesis/asterisk and asterisk/right parenthesis pairs *)</code>, and these can span any number of lines. Later versions of Borland Pascal also supported C++-style comments <code>// preceded by two forward slashes </code>, which finish at the end of the line. * The syntax for the statement <code>case</code> is more flexible than standard Pascal. * Sets may only have up to 256 (2<sup>8</sup>) members. * The standard Pascal <code>String</code> preceded by a length byte is supported, and takes a fixed amount of storage; later versions added a more flexible null-terminated type, calling the older type "short string". Older source code which handles strings in non-standard ways (e.g., directly manipulating the length byte like <code>S[0]:=14</code> to truncate a string) must either have its strings declared as short strings, or be rewritten. This is the classic [["Hello, World!" program]] in Turbo Pascal: <syntaxhighlight lang="Pascal"> program HelloWorld; begin WriteLn('Hello World') end. </syntaxhighlight> This asks for a name and writes it back to the screen a hundred times: <syntaxhighlight lang="Pascal"> program WriteName; var i : Integer; {variable to be used for looping} Name : String; {declares the variable Name as a string} begin Write('Please tell me your name: '); ReadLn(Name); {ReadLn returns the string entered by the user} for i := 1 to 100 do begin WriteLn('Hello ', Name) end; readln; end. </syntaxhighlight> ==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.<ref>{{cite web|title=Chapter 14 -- Combining Pascal with Assembly|url=http://www.oocities.org/codeteacher/pas/pasl2014.html|access-date=2016-10-19|archive-url=https://web.archive.org/web/20161020040817/http://www.oocities.org/codeteacher/pas/pasl2014.html|archive-date=2016-10-20|url-status=live}}</ref> 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 [[Program animation|single stepping]], examination and changing of variables, and conditional breakpoints. In later versions assembly-language blocks could be stepped through. The user could add [[breakpoint]]s on variables and registers in an IDE window. Programs using [[IBM PC compatible|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.<ref>{{cite web |url=https://books.google.com/books?id=9j4EAAAAMBAJ&pg=PA26 |title=InfoWorld 21 Mar 1988: Announcement of Turbopower T-Debug 4 |date=21 March 1988 |access-date=2015-12-13 |archive-url=https://web.archive.org/web/20160425194704/https://books.google.com/books?id=9j4EAAAAMBAJ&pg=PA26&lpg=PA26 |archive-date=2016-04-25 |url-status=live}}</ref> 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 (computer science)|profiler]] that reported on the time spent in each part of the program to assist [[program optimisation]] by finding bottlenecks.<ref>{{cite web |url=http://www.textfiles.com/bitsavers/pdf/borland/Turbo_Profiler_1.0_Users_Guide_1990.pdf |title=Turbo Profiler 1.0 manual |access-date=2011-11-03 |archive-url=https://web.archive.org/web/20120402031845/http://www.textfiles.com/bitsavers/pdf/borland/Turbo_Profiler_1.0_Users_Guide_1990.pdf |archive-date=2 April 2012 |url-status=dead}}</ref> 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.<ref>{{cite web |url=http://www.marcocantu.com/delphipowerbook/DebuggingDelphiPrograms.pdf |title=Marco Cantų's Delphi Power Book: Debugging Delphi Programs |access-date=2011-10-31 |archive-url=https://web.archive.org/web/20120331032317/http://www.marcocantu.com/delphipowerbook/DebuggingDelphiPrograms.pdf |archive-date=31 March 2012 |url-status=dead}}</ref> ===Units=== Over the years, Borland enhanced not only the IDE, but also extended the programming language. A development system based on [[BS 6192|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 ''[[Unit (Software Development)|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 <code>uses crt;</code> in a program included the unit called crt; the <code>uses</code> is the mechanism for using other compiling units. <code>interface</code> and <code>implementation</code> were the keywords used to specify, within the unit, what was (and what was not) visible outside the unit. This is similar to the <code>public</code> and <code>private</code> keywords in other languages such as [[C++]] and [[Java (programming language)|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 [[Clarion (programming language)|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.<ref>{{cite web |url=http://miller.emu.id.au/pmiller/ucsd-psystem-um/reconstruct/03-03-02-linkage.html |title=3.3.2. Linkage to Externally Compiled and Assembled Routines – UCSD Pascal System II.0 User Manual Reconstruction – Version I.5, September 1978 |archive-url=https://web.archive.org/web/20070903053837/http://miller.emu.id.au/pmiller/ucsd-psystem-um/reconstruct/03-03-02-linkage.html |archive-date=2007-09-03}}</ref> 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=== <!-- Deleted image removed: [[File:Turbo Pascal 5.5 with Objects advertising poster.jpg|thumbnail|right|Turbo Pascal 5.5 with Objects advertising poster]] --> From version 5.5 some [[object-oriented programming]] features were introduced: [[Class (computer programming)|classes]], [[Inheritance (object-oriented programming)|inheritance]], [[Constructor (object-oriented programming)|constructors]] and [[Destructor (computer programming)|destructors]].<ref name="tp55">{{cite web |url=http://edn.embarcadero.com/article/20803 |title=Antique Software: Turbo Pascal v5.5 |first=David |last=Intersimone |date=2002-02-21 |publisher=Embarcadero Technologies |access-date=2010-11-09 |archive-url=https://web.archive.org/web/20101124090934/http://edn.embarcadero.com/article/20803 |archive-date=2010-11-24 |url-status=dead}}</ref> 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 (software)|Delphi]] (which has two separate OOP systems). The name "Object Pascal" originated with the Pascal extensions developed by [[Apple Computer]] to program its [[Apple Lisa|Lisa]] and [[Macintosh 128K|Macintosh]] computers. Pascal originator [[Niklaus Wirth]] consulted in developing these extensions, which built upon the [[record (computer science)|record]] type already present in Pascal. ==={{anchor|CRT}}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 [[Cathode-ray tube|CRT]]. This unit contains code in its initialization section to determine the CPU speed and [[calibration|calibrate]] delay loops. This code fails on processors with a speed greater than about 200 [[megahertz|MHz]] and aborts immediately with a "Runtime Error 200" message.<ref>{{cite web|url=http://info.borland.com/devsupport/pascal/|title=Borland Pascal Developer Support|access-date=2011-04-25|url-status=dead|archive-url=https://web.archive.org/web/20101023083050/http://info.borland.com/devsupport/pascal/|archive-date=2010-10-23}}</ref> (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.<ref name=merlyn>{{cite web|url=http://www.merlyn.demon.co.uk/pas-r200.htm |title=Borland's Version 7 Pascals' Start-Up Runtime Error 200 (divide by zero) |access-date=2015-11-16 |url-status=unfit |archive-url=https://web.archive.org/web/20150907221542/http://www.merlyn.demon.co.uk/pas-r200.htm |archive-date=7 September 2015}} Web page discussing the cause of the error and various solutions.</ref> A [[Patch (computing)|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,<ref name=speedpatch>{{cite web|url=http://www.kennedysoftware.ie/patchcrt.htm|title=PatchCRT – fix RunTime Errors on some apps|year=2003|publisher=kennedysoftware.ie|access-date=2010-09-28|archive-url=https://web.archive.org/web/20110721124924/http://www.kennedysoftware.ie/patchcrt.htm|archive-date=2011-07-21|url-status=live}}</ref><ref>{{cite web |url=https://www.heise.de/ct/hotline/Nicht-schon-wieder-Runtime-Error-200-307662.html |title=Nicht schon wieder: Runtime Error 200 |date=8 April 2000}}</ref> or by loading a [[terminate-and-stay-resident program]] before running the faulty program.<ref>{{cite web|url=http://www.pcmicro.com/elebbs/faq/rte200.html|title=How to fix a Run Time Error 200|year=2006|publisher=pcmicro.com|access-date=2010-09-28}}</ref> There are also patches to the TP7 compiler,<ref>{{cite web |url=http://www.blume-programm.de/ab/boerse/a_338.htm |title=Runtime Error 200 |date=2003-03-13 |publisher=blume-programm.de |access-date=2015-11-16 |archive-url=https://web.archive.org/web/20151117063633/http://www.blume-programm.de/ab/boerse/a_338.htm |archive-date=17 November 2015 |url-status=dead |language=de}}</ref> 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.<ref>{{cite web|url=http://www.blume-programm.de/ab/boerse/januar_10/dateien/sdelay11.zip|title=SuperDelay v1.1a|first=Allen|last=Cheng|year=1997|publisher=blume-programm.de|access-date=2010-09-28}}{{Dead link|date=July 2018 |bot=InternetArchiveBot |fix-attempted=yes}}</ref> ===Floating-point arithmetic=== There were several [[floating point]] types, including <code>single</code> (the 4-byte [IEEE 754] representation) <code>double</code> (the 8-byte IEEE 754 representation), <code>extended</code> (a 10-byte IEEE 754 representation used mostly internally by numeric [[coprocessor]]s) and <code>Real</code> (a 6-byte representation). In the early days, <code>Real</code> 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 <code>Real</code> were quicker than using the other types, though its library also [[emulation (computing)|emulated]] the other types in software. ==Versions== ===CP/M and DOS versions=== ====Version 1==== [[File:Turbo pascal 30 cover.jpg|thumb|Turbo Pascal 3.0 manual front cover]] Version 1, released on 20 November 1983, was a basic all-in-one system, working in memory and producing [[COM file|.COM]] executable files for DOS and CP/M, and equivalent [[CMD file (CP/M)|.CMD]] executables for CP/M-86 (totally 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 [[Zilog Z80|Z80]] processors, or an Apple II with Z80 card. The DOS and CP/M-86 versions ran on the many [[Intel 8086|8086]] and [[Intel 8088|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 [[Computer architecture|architecture]] of the various machines running MS-DOS additionally limited the maximum user memory to under 1 MB (e.g., [[IBM PC compatible|machines hardware-compatible with the IBM PC]] were limited to 640 KB). The Turbo Pascal IDE was very advanced for its day. It was able to perform well and compile very fast 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, [[Computer multitasking|multitasking]], was not otherwise available. Borland produced a small application suite called [[Borland Sidekick|Sidekick]] that was a TSR letting the user keep a diary, notes, and so forth. ==== Version 2 ==== Version 2, released a few months later on 17 April 1984, was an incremental improvement to the original Turbo Pascal, to the point that the reference manual was at first identical to version 1's, down to having 1983 as the copyright date on some of the compiler's sample output, but had a separate "Addendum to Reference Manual: Version 2.0 and 8087 Supplement" manual with separate page numbering.<ref name=turbop>{{cite book |url=http://bitsavers.org/pdf/borland/turbo_pascal/Turbo_Pascal_Version_2.0_Reference_1984.pdf |title=Turbo Pascal version 2.0}}</ref> Additions included an [[Overlay (programming)|overlay system]], where separate overlay procedures would be automatically swapped from disk into a reserved space in memory. This memory was part of the 64kB RAM used by the program's code, and was automatically the size of the largest overlay procedure.<ref name=turbop/> Overlay procedures could include overlay sections themselves, but unless a RAM disk was used, the resulting disk swapping could be slow. 2.0 also added the Dispose procedure to manage the [[Heap (programming)|heap]], allowing individual dynamic variables to be freed, as an alternative to the more primitive 'Mark/Release' system and increased compatibility with WordStar commands plus use of the numeric keypad on the IBM PC and compatibles.<ref name=turbop/> Such PCs also had new text window and [[Color Graphics Adapter|CGA]] graphics mode commands as well as being able to use the PC's speaker for tones. Finally, DOS and CP/M-86 machines with an [[8087]] maths coprocessor (or later compatible) had an alternative TURBO-87 compiler available to purchase.<ref name=turbop/> It supported the 8087's ''long real'' data types with a range of 1.67E-307 to 1.67E+308 to 14 significant figure precision but with a much greater processing speed. The manual notes that although source code for the Turbo Pascal's software real data types offering a range of 1E-63 to 1E+63 to 11 significant figures, these were incompatible at a binary level: as well as having a much larger range, the software reals took six bytes in memory and the 8087 ones were eight. Version 2 for CP/M-80 only runs on Z80-based [[CP/M]] machines.<ref name="rodman198409">{{Cite magazine |last=Rodman |first=Richard |date=1984 |title=Turbo Pascal v2.0 |url=https://archive.org/details/Computer_Language_Issue_01_1984-09_CL_Publications_US/page/n79/mode/1up?view=theater |access-date=2025-04-06 |magazine=Computer Language |pages=78–79 |volume=1 |issue=1}}</ref> ==== Version 3 ==== Version 3 was released on 17 September 1986.<ref name="tp302"/> Turbo Pascal 3 supported [[turtle graphics]].<ref>{{cite web|url=https://cs.nyu.edu/cs/faculty/marateck/turtle.html|title=Using Turtle Graphics Under Turbo Pascal |first=Nathan |last=Hull}}</ref> In addition to the default software real numbers and 8087 edition of the compiler, Borland also offered a [[binary-coded decimal]] (BCD) version (TURBOBCD) which offered the same numeric range as real data types but to 18 significant figures.<ref name="tp302"/> === DOS versions === ==== Version 4 ==== Released on 20 November 1987,<ref name="tp_release_dates">{{cite web |url=https://community.embarcadero.com/blogs/entry/turbo-pascal-version-10--the-turbo-pascal-release-dates-39142 |title=Turbo Pascal version 1.0 - The Turbo Pascal release dates |date=17 November 2008 |website=Embarcadero Technologies |access-date=2021-04-13 |url-status=live |archive-url=https://web.archive.org/web/20200224140637/https://community.embarcadero.com/blogs/entry/turbo-pascal-version-10--the-turbo-pascal-release-dates-39142 |archive-date=24 Feb 2020}}</ref> Version 4 was a total rewrite, with both [[look and feel]] and internal operation much changed. The compiler generated executables in [[.exe|.EXE]] format under DOS, rather than the simpler but more restricted .COM executables. The by-then obsolete CP/M and CP/M-86 operating system versions were dropped when Turbo Pascal was rewritten. Version 4 introduced units, and a full-screen text user interface with pull-down menus; earlier versions had a text-based menu screen and a separate full-screen editor. ([[Microsoft Windows]] was still very experimental when the first version was released, and even [[Computer mouse|mice]] were rare.) An add-on package, the Turbo Pascal Graphix Toolbox, was available for Turbo Pascal V4.<ref>{{cite book |url=http://www.bitsavers.org/pdf/borland/turbo_pascal/Turbo_Pascal_Graphix_Toolbox_Version_4.0_1987.pdf |title=Borland Graphics Toolbox Manual}}</ref> ==== Version 5.0 ==== Colour displays were replacing monochrome; Turbo Pascal version 5.0, released 24 August 1988,<ref name="tp_release_dates"/> introduced blue as the editor's default background color, used by Borland's DOS compilers until the end of this product line in the mid-1990s. It also added debugger support for breakpoints and watches. Later versions came in two packages with the same version number: a less expensive "Turbo" package, and a "Borland" package with enhanced capabilities and more add-ons. ==== Version 5.5 ==== This version, released on 2 May 1989,<ref name="tp_release_dates"/> introduced [[object-oriented programming]] features for the Pascal language, including concept of classes, static and dynamic objects, constructors and destructors and inheritance, which would become the basis for the Object Pascal found in Borland Delphi. The IDE uses the default blue colour scheme that would also be used on later Borland Turbo products. Other changes to IDE include the addition context-sensitive help with description of all built-in functions, and the ability to copy code fragments from the help to edit window.<ref>{{Cite web|url=http://progopedia.com/version/turbo-pascal-5.5/|title=Turbo Pascal 5.5: version of programming language Pascal|website=progopedia.com}}</ref> ==== Version 6.0 ==== Version 6 was released on 23 October 1990.<ref name="tp_release_dates"/> Changes from 5.5 include: the addition of inline assembly, the addition of the [[Turbo Vision]] library, mouse support, clipboard for text manipulations, [[multiple document interface]] supporting up to nine edit windows.<ref>{{Cite web|url=http://progopedia.com/version/turbo-pascal-6.0/|title=Turbo Pascal 6.0: version of programming language Pascal|website=progopedia.com}}</ref> ==== Version 7.0 ==== Version 7 was released on 27 October 1992.<ref name="tp_release_dates"/> Changes from 6.0 include support for the creation of DOS and Windows executables and Windows DLLs, and syntax highlighting.<ref>{{Cite web|url=http://progopedia.com/version/turbo-pascal-7.0/|title=Turbo Pascal 7.0: version of programming language Pascal|website=progopedia.com}}</ref> ===Turbo Pascal for Windows=== Two versions named "Turbo Pascal for Windows" (TPW), for [[Windows 3.1x|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 (software)|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.<ref>{{cite web|url=https://winworldpc.com/product/turbo-pascal/1x-mac|title=Borland Turbo Pascal 1.x (Mac)}}</ref><ref name="macworld0487">{{cite magazine |magazine=[[Macworld]] |title=Turbo Pascal Arrives |first=Denis |last=Cohen |volume=4 |issue=4 |date=April 1987 |pages=162–163 |url=https://archive.org/details/MacWorld_8704_April_1987/page/n165/mode/1up}}</ref> 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.{{citation needed|date=August 2020}} ===Freeware releases=== [[Borland]] released several versions of Turbo Pascal as [[freeware]] after they became "antique software",<ref name=borlandmuseum>{{cite web |url=http://bdn.borland.com/museum |work=CDN » Museum |title=Antique Software: Turbo Pascal v5.5 |archive-url=https://web.archive.org/web/20040203055603/http://bdn.borland.com/museum/ |archive-date=3 February 2004 |url-status=dead |access-date=2013-04-01 |publisher=Borland Software Corporation}}</ref> 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.<ref name="tp701frenchfreeware">{{cite web|url=http://www.inprise.fr/download/compilateurs/|archive-url=https://web.archive.org/web/20040624223937/http://www.inprise.fr/download/compilateurs/|archive-date=2004-06-24|url-status=dead|title=Téléchargements - Gratuits : Compilateurs Delphi, Pascal & C / C++ |quote=''Note to international users: This free Turbo Pascal 7 is available in French Only. The US version of Turbo Pascal 7 is not available as free download yet. For the US version please download Turbo Pascal 5.5 US below. Thanks.'' |publisher=Borland Software Corporation}}</ref> Most of the downloads are still available on the successor website of [[Embarcadero Technologies]].<ref name="tp10"/><ref name="tp302"/><ref name="tp55"/> ==See also== * [[Borland Graphics Interface]] * [[Delphi (software)]] * [[Free Pascal]] ==References== {{Reflist}} ==External links== {{commons category|Turbo Pascal}} *Borland International, Inc. Turbo Pascal page: [https://web.archive.org/web/19980423115536/http://www.borland.com/pascal/tp7fact.html DOS 7.0], [https://web.archive.org/web/19980423115552/http://www.borland.com/pascal/turpas15.html Windows 1.5] *Inspire Corporation Turbo Pascal page: [https://web.archive.org/web/20001019031241/http://www.borland.com/pascal/tp7fact.html DOS 7.0], [https://web.archive.org/web/20010303110145/http://www.borland.com/pascal/turpas15.html Windows 1.5] *Borland Software Corporation Turbo Pascal page: [https://web.archive.org/web/20020408085424/http://www.borland.com/pascal/tp7fact.html DOS 7.0] *[http://www.pcengines.ch/tp3.htm Turbo Pascal 3 Code Generation], a description of the Turbo Pascal 3.0 compiler *[http://turbopascal.org Turbo Pascal Compiler Internals] {{Webarchive|url=https://web.archive.org/web/20110427045540/http://turbopascal.org/ |date=2011-04-27}}, complete source code of a Turbo Pascal 7.0-compatible compiler *[http://www.emsps.com/oldtools/borpasv.htm Borland/Inprise Pascal versions] {{Pascal programming language family}} {{Authority control}} [[Category:1983 software]] [[Category:Borland software]] [[Category:CP/M software]] [[Category:DOS software]] [[Category:Classic Mac OS software]] [[Category:Integrated development environments]] [[Category:Object-oriented programming languages]] [[Category:Pascal (programming language) compilers]] [[Category:Assembly language software]] <!-- Hidden categories below --> [[Category:Articles with example Pascal code]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Authority control
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite magazine
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:Commons category
(
edit
)
Template:Dead link
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main other
(
edit
)
Template:Pascal programming language family
(
edit
)
Template:R
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:US$
(
edit
)
Template:USD
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Webarchive
(
edit
)