ToBoS-FP explained

ToBoS-FP is a floating point compiler for the Sinclair BASIC on ZX Spectrum. The name stands for Toruń, Jerzy Borkowski, Wojciech Skaba, Floating Point. The compiler was released in Poland in 1986.[1] Source code compilation enables substantial (20+[2]) speed up of execution of programs that are normally interpreted. The acceleration results mostly from the utilization of compiler's own floating point arithmetic library[3] and graphics library that replace the ZX Spectrum built-in routines. In a 1992 independent survey, ToBoS-FP was named the most popular of all known BASIC compilers for the ZX Spectrum.[4] It is still referred to as one of the best BASIC compiler for ZX Spectrum.[5]

Background

ZX Spectrum is factory equipped with a Sinclair BASIC editor and interpreter that enables immediate program execution without a compilation pass and not consuming memory for the compiled code. This comes, however, at the price of execution speed. A number of integer and floating point compilers have been released since (e.g.: HiSoft Basic http://www.worldofspectrum.org/infoseekid.cgi?id=0008249, HiSoft Colt http://www.worldofspectrum.org/infoseekid.cgi?id=0008254, Softek IS/FP http://www.worldofspectrum.org/infoseekid.cgi?id=0008693, MCoder http://www.worldofspectrum.org/infoseekid.cgi?id=0013864, ZIP Compiler http://www.worldofspectrum.org/infoseekid.cgi?id=0009452, Boriel ZX Basic http://www.boriel.com/software/the-zx-basic-compiler/, Blast http://www.worldofspectrum.org/infoseekid.cgi?id=0007980). Unfortunately, the Sinclair BASIC enables programming constructs that are hard or even impossible to be compiled (e.g.: GO TO line number which is an expression calculated at runtime). Thus compatibility between the interpreter and a compiler is an issue.

Development

The compiler was written in Z80 assembler. There are two main sources of compiled code execution acceleration:

In order to achieve a substantial speed up, a shorter floating point number format has been applied, one that is close to single precision IEEE 754-1985, consisting of 1-byte exponent and 3-byte fraction (effectively 7 decimal digits precision). The original Sinclair BASIC utilizes 1-byte exponent and 4-byte fraction.[7] All floating point arithmetic routines have been rewritten, including basic operations like addition, multiplication, division and functions like square root, logarithm, exponent. A unique algorithm has been developed for the calculation of trigonometric functions.[8] Line drawing, circle drawing and other graphics functions have also been written.

Releases

The most popular version of ToBoS-FP (ver. 2.0) was released on a compact cassette in May 1986 in Poland. After loading to the memory, the compiler could be invoked with USR 53100. Earlier non-stable versions, assigned 1.0, 1.1, 1.2, and invoked with USR 53500, were available in limited extent.

In June 1987 an improved version named ToBoS-DYD (Tadeusz Golonka co-authored) was released. It was distributed on a 5 1⁄4-inch floppy disk and adapted for the Elwro 800 Junior clone of ZX Spectrum. Compared to ver. 2.0, some functions were further optimized and Elwro 800 Junior extensions added.[9]

Reception

Though some 2000 copies of ToBoS-FP have been sold in Poland, it spread worldwide mostly free of charge. As being released when general interest in ZX Spectrum started to decline, it came too late for the market. ToBoS-FP gained most of its popularity in Poland and other East European countries, where ZX Spectrum and its clones were in common use until the mid 1990s. Its ability to expedite games written in Sinclar BASIC was especially appreciated.[10]

External links

Notes and References

  1. Wojciech. Skaba. Jerzy. Borkowski. Pierwszy polski kompilator na Spectrum [the first Polish compiler for Spectrum]. 20. September 1986. Bajtek. RSW „Prasa-Książka-Ruch”, Młodzieżowa Agencja Wydawnicza. 0860-1674.
  2. Wojciech. Skaba. Jerzy. Borkowski. TOBOS-FP polski kompilator na Spectrum [TOBOS-FP Polish compiler for Spectrum]. 28. March 1987. Komputer. RSW „Prasa-Książka-Ruch”. 0860-2514.
  3. Wojciech. Skaba. ToBoS-FP Basic reaches the speed of light. 30. 1987. 4(121) bimonthly-->. Polish Engineering. AGPOL Foreign Trade Publicity and Publishing Enterprise. 0209-0260.
  4. Book: Болдачев , А.В. . И.Е. Думов. В.А.. Елисеев. Диалекты бейсика для ZX Spectrum. Спектрум Бейсик - Компиляторы, работающие с вещественными числами: Softek FP, Tobos FP.. 1992. Питер (Piter Ltd.). 5-7190-0001-1. Компилятор Tobos FP (Tobos Floating Point) появился на свет в Польше в 1986 году и стал на сегодняшний день, пожалуй, наиболее популярным из всех известных бейсик-компиляторов для ZX Spectrum..
  5. Jakub. Chabik. Kod źródłowy Leonarda da Vinci. 12 Jun 2006. Computerworld Polska. IDG Poland SA. 1429-012X.
  6. Wojciech. Skaba. Jerzy. Borkowski. Polski kompilator TOBOS F.P. [Polish compiler TOBOS F.P.]. 7. August 1986. Elektronik. ZSP Politechniki Wrocławskiej. 0860-293X.
  7. Book: Vickers , Steven . Sinclair ZX Spectrum BASIC programming. Chapter 24. 1982. Sinclair Research Ltd.
  8. Wojciech. Skaba. Sinus, consinus, tangens. 23. February 1988. Mikroklan. Wydawnictwo Czasopism i Książek Technicznych SIGMA. 0860-1941.
  9. Tadeusz. Golonka. Tym razem bez lutownicy [Now without a soldering iron]. 8. April 1988. Informik. Instytut Wydawniczy Nasza Księgarnia, Warszawa. 0860-5696.
  10. Book: Капульцевич , А. . И.. Капульцевич. А.. Евдокимов. Как написать игру для ZX Spectrum. Компиляция игровых программ. 1995. ПИТЕР, Санкт Петербург, (Piter Ltd.). 5-7190-0052-6. 132. Начинать знакомство с этим классом прикладных программ лучше всего с компилятора TOBOS FP. На сегодняшний день он, пожалуй, самый популярный, хотя это и не означает, чт о он самый лучший, самый быстродействующий, самый, самый... Все дело в том, что он самы й простой в обращен ии и накладывает на исходную программу меньше всего огра ничений..