ENCYCLOPEDIA 4U .com



Encyclopedia Home Page

Google
  Web Encyclopedia4u.com

 

BASIC09 programming language

BASIC09 is a structured BASIC dialect developed by Microware for the then-new Motorola 6809 CPU. Somewhat in the fashion of UCSD Pascal it was implemented via 'compilation' into an intermediate representation. The language processor turned BASIC09 source code into a tokenized, optimized, bytecode, called I-code in the BASIC09 literature. It could then be executed by a compact runtime-only interpreter, called RunB (no editor, prettyprinter, ...).

BASIC09 provided very impressive features for its time (it was first available in 1980), and most especially for its memory requirements:

  • reasonable structured control flow (line numbers were mainly needed for computed GOTO, as BASIC09 did not have a switch/case statement, or computed GOSUB)
  • the ability to declare structures
  • integer and Boolean data types
  • more than two significant characters in variable names (many other BASICs of the time allowed only 1!)
  • procedures with local variables (indeed, all variables in BASIC09 are local) and parameters passing by reference
  • a reasonable debugger (its only significant drawback was that one could not examine the contents of fields in structures)
  • a way to interface to machine language code, which could be passed parameters using the BASIC09 calling sequence
  • automatic prettyprinting of source, which enforced a standard layout and avoided the ghastly mess that was the usual appearance of a program of any size in the interpreted BASICs of the time. Programmers normally would cram as many lines together as possible to avoid line number memory overhead -- not a problem in BASIC09

Once one or more BASIC09 procedures are debugged to the programmer's satisfaction, they can be "packed" (or converted permanently to the I-code (ie, bytecode) form). Among other things, comments and names of local variables are discarded during packing, so that, unlike the typical interpreted BASICs of the time, comments and intelligible variable names incurred almost no runtime cost and were not a 'burden' programmers learned to avoid to maximize runtime efficiency or memory use. For the Microware versions of BASIC09, "packed" procedures are in fact OS-9 modules; the OS-9 shell recognizes them as I-code and automatically calls the RunB interpreter to execute them. RunB avoids much of the overhead of the typical interpreted BASICs of the day--not to mention that one can do integer calculations where appropriate rather than doing everything in floating point--so that BASIC09 programs run extremely quickly in comparison with equivalent programs in the interpreted BASICs of the time.

Microware produced a version of BASIC09 for OS-9/68000, calling it Microware BASIC, but has not developed a version for OS-9000 (the portable version of OS-9).





Content on this web site is provided for informational purposes only. We accept no responsibility for any loss, injury or inconvenience sustained by any person resulting from information published on this site. We encourage you to verify any critical information with the relevant authorities.



Copyright © 2005 Par Web Solutions All Rights reserved.
| Privacy

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "BASIC09 programming language".