Turbo Pascal - Issue With CRT Unit On Fast Processors

Issue With CRT Unit On Fast Processors

Several versions of Turbo Pascal, including the latest version 7, include a CRT unit used by many fullscreen text mode applications. This unit contains code in its initialisation 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; it was just a coincidence). 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 1 to 8 MHz, and little thought was given to the possibility of vastly higher speeds, so at about 200 MHz the 16-bit counter overflows. Several patches have been required as processor speeds increased.

Programs compiled with this error can be recompiled with a compiler patched to eliminate this error (using a TURBO.TPL itself compiled with a corrected CRT unit) or, if source code is not available, executables can be patched by a tool named TPPATCH or equivalent, or by loading a Terminate and Stay Resident program loaded before running the faulty program.

There are also patches to the TP7 compiler itself, thus if the Pascal source is available, a new compilation's code will work without the compiled code having to be patched. If the source code is available, porting to libraries without CPU clock speed dependency is a solution too.

Read more about this topic:  Turbo Pascal

Famous quotes containing the words issue, unit, fast and/or processors:

    The area [of toilet training] is one where a child really does possess the power to defy. Strong pressure leads to a powerful struggle. The issue then is not toilet training but who holds the reins—mother or child? And the child has most of the ammunition!
    Dorothy Corkville Briggs (20th century)

    During the Suffragette revolt of 1913 I ... [urged] that what was needed was not the vote, but a constitutional amendment enacting that all representative bodies shall consist of women and men in equal numbers, whether elected or nominated or coopted or registered or picked up in the street like a coroner’s jury. In the case of elected bodies the only way of effecting this is by the Coupled Vote. The representative unit must not be a man or a woman but a man and a woman.
    George Bernard Shaw (1856–1950)

    Overly persuasive a woman’s ordinance spreads far, traveling fast; but fast dying a rumor voiced by a woman perishes.
    Aeschylus (525–456 B.C.)

    The information links are like nerves that pervade and help to animate the human organism. The sensors and monitors are analogous to the human senses that put us in touch with the world. Data bases correspond to memory; the information processors perform the function of human reasoning and comprehension. Once the postmodern infrastructure is reasonably integrated, it will greatly exceed human intelligence in reach, acuity, capacity, and precision.
    Albert Borgman, U.S. educator, author. Crossing the Postmodern Divide, ch. 4, University of Chicago Press (1992)