ArticleslgStudy

computer science

Turbo-BASIC XL

Turbo-BASIC XL is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Turbo-BASIC XL rather than just read about it. In short: Turbo-BASIC XL is an enhanced version of the BASIC programming language for Atari 8-bit computers. It is a compatible superset of the Atari BASIC that shipped with the computers.

Turbo-BASIC XL — main illustration
Turbo-BASIC XL — illustration

Key takeaways

  • Turbo-BASIC XL belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Turbo-BASIC XL to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Turbo-BASIC XL from memory before moving on to harder problems.

Reference excerpt

Turbo-BASIC XL is an enhanced version of the BASIC programming language for Atari 8-bit computers. It is a compatible superset of the Atari BASIC that shipped with the computers. Turbo-Basic XL was developed by Frank Ostrowski and published in the December 1985 issue of German computer magazine Happy Computer. A version for the 400/800 models was released shortly after as Frost Basic 1.4. Several modified versions working with different DOS systems have been released by other authors. Turbo-Basic XL greatly improves execution speed over Atari BASIC. An Atari BASIC program loaded into Turbo-BASIC, with no changes made, would generally run about three to four times as fast. A Turbo-Basic XL compiler created binary executables, further speeding up program performance to about ten times faster than Atari BASIC. Turbo-Basic XL also includes an expanded editor, support for named procedures, WHILE...ENDWHILE and similar block constructs, and added access to the underlying hardware, which, among other things, allowed operation of attached floppy drives without exiting to DOS. Ostrowski soon got a job with GFA Systemtechnik GmbH (at the time known as Integral Hydraulik) where he adapted Turbo-Basic XL into GFA BASIC for the Atari ST, which became one of the more popular BASICs on that platform.

Background The poor execution speed of Atari BASIC, which shipped with all Atari 8-bit models, led to a market for 3rd party BASIC interpreters and compilers with better performance or more commands. Among them was an official port of Microsoft BASIC sold by Atari, Inc. and several improved versions released by Optimized Systems Software, who had written the original Atari BASIC under contract. There were also Atari BASIC compilers from several companies. Turbo-Basic XL was a late entry to this list, first published in December 1985 as type-in program in Happy Computer magazine. It came in both interpreter and compiler versions. Turbo-Basic XL takes advantage of the extra memory of the XL (and later XE) series machines, preventing it from running on the original 400 and 800. A version supporting those systems was later released as Frost BASIC (short for "Frank Ostrowski"). The internal disk-related commands are tied to particular versions of DOS. A number of ports to different versions of DOS became available.

Performance

The most notable feature of Turbo-Basic was its dramatically improved speed; an unmodified Atari BASIC program loaded into Turbo-Basic would normally run three to five times faster, and the speed advantage improved as the program size grew. It also had a compiler that increased the speed of listings by a factor of 15 to 20. This was due largely to a series of improvements on well-known problems in the original Atari BASIC code. In most BASICs, GOTO was handled by reading the associated line number and then searching through the program for that line of code. In MS-derived BASICs the line numbers were stored as 16-bit integers and numeric constants in the code in their original ASCII format. When a line like GOTO 1000 was encountered, the interpreter would use special code to convert the four ASCII characters "1000" into 16-bit integer format and then search for it. Atari BASIC worked differently, converting all numeric constants to a 6-byte floating-point format when the line was entered. This meant the "1000" was no longer in ASCII format and had to be converted from floating-point to integer format. The code for doing so was not well optimized and could take over 2 ms (average 1-1.5 ms). FOR...NEXT loops are another common construct in BASIC programs. In most BASICs, when the FOR portion was encountered at runtime, its memory location in the source code was pushed onto a call stack so it could easily return to that location when the associated NEXT was encountered. For unknown reasons, Atari BASIC pushed the line number of the FOR onto the stack and then looked through the entire code for that line when it encountered the NEXT. For programs that did significant looping, which is often the case in BASIC, this could cause a dramatic performance hit. Turbo-Basic implemented its FOR loops using the address, as was the case in MS BASIC, and thus ran loops with roughly the same performance as MS. It then went further and greatly improved GOTO performance as well. Line numbers were sent into a hash function that broke them into 256-line chunks. As the program was entered, the address of the first of each of these chunks was stored in a 128-value table. At runtime, when a line number lookup was needed, it would first pick the nearest-but-lower value in the table, retrieve the address, and then begin scanning for the line from that point on. The improvement was most notable in larger programs where the scanning time was increasingly expensive, which is why Turbo-Basic could hit a 5-times increase in larger programs. The other major source of poor performance in Atari BASIC was its very slow binary-coded decimal (BCD) floating point code. The library, contained in a separate 2K ROM and considered part of the operating system as opposed to BASIC itself, had been written in a hurry and never optimized. Some of the routines, notably the multiply and exponents functions, were far slower than they could be. Turbo-Basic fixed this by including its own complete floating-point library, which not only fixed many of these issues but also further optimized the code by unrolling small loops. For programs that used math extensively, the new library resulted in dramatic performance improvements, sending the Atari from near the bottom of the Creative Computing Benchmark lists to near the top, beating a number of machines that were much faster in hardware.

New features Among the extra features of Turbo-Basic XL, added to Atari BASIC, are the following:

enhanced sound and graphics commands more flexible I/O commands, including disk access structured programming constructs simple debugging facilities

See also BASIC A+

References

Fetzer, Ron (1985). Expanded Turbo-BASIC XL Documentation (PDF).

External links Turbo-Basic XL listings listings from Happy Computer magazine

Illustrations

Turbo-BASIC XL illustration

Worked examples

Example 1 — a first encounter with Turbo-BASIC XL

Start with the simplest possible case. Write down what Turbo-BASIC XL claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Turbo-BASIC XL before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Turbo-BASIC XL ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Turbo-BASIC XL

In research
Turbo-BASIC XL appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Turbo-BASIC XL in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Turbo-BASIC XL is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1985 software, Atari 8-bit computer software, BASIC compilers, so understanding it makes those chapters shorter.
In everyday life
Look for Turbo-BASIC XL outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Turbo-BASIC XL” →

How to study Turbo-BASIC XL in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Turbo-BASIC XL means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Turbo-BASIC XL out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Turbo-BASIC XL in simple terms?

Turbo-BASIC XL is an enhanced version of the BASIC programming language for Atari 8-bit computers. It is a compatible superset of the Atari BASIC that shipped with the computers.

Why does Turbo-BASIC XL matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Turbo-BASIC XL?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Turbo-BASIC XL.

Tags

  • 1985 software
  • Atari 8-bit computer software
  • BASIC compilers
  • BASIC interpreters
  • BASIC programming language family
  • Discontinued BASICs
  • Programming languages created in 1985

Keep exploring