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
(section)
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!
==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.
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)