
ToBoS-FP is a floating point compiler for the
Sinclair BASIC
Sinclair BASIC is a dialect of the programming language BASIC used in the 8-bit home computers from Sinclair Research and Timex Sinclair. The Sinclair BASIC interpreter was made by Nine Tiles Networks Ltd.
History
Sinclair BASIC was or ...
on
ZX Spectrum
The ZX Spectrum () is an 8-bit home computer that was developed by Sinclair Research. It was released in the United Kingdom on 23 April 1982, and became Britain's best-selling microcomputer.
Referred to during development as the ''ZX81 Colou ...
. The name stands for
Toruń, Jerzy Borkowski, Wojciech Skaba,
Floating Point. The compiler was released in
Poland
Poland, officially the Republic of Poland, , is a country in Central Europe. Poland is divided into Voivodeships of Poland, sixteen voivodeships and is the fifth most populous member state of the European Union (EU), with over 38 mill ...
in 1986.
Source code compilation enables substantial (20+) 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 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. It is still referred to as one of the best BASIC compiler for ZX Spectrum.
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 Basi
HiSoft Col
Softek IS/F
MCode
ZIP Compile
Boriel ZX Basi
Blas
. 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
Zilog Z80, Z80 assembler. There are two main sources of compiled code execution acceleration:
* Conversion of the source code into
direct threaded code that frees the processor from
epeatedlytranslating the BASIC instructions into program calls
* Application of compiler's own time critical subroutine calls, especially those dealing with floating point arithmetic and graphics functions
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
IEEE 754-1985 was an industry standard for representing floating-point numbers in computers, officially adopted in 1985 and superseded in 2008 by IEEE 754-2008, and then again in 2019 by minor revision IEEE 754-2019. During its 23 years, it was ...
, 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. 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. 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
The Compact Cassette or Musicassette (MC), also commonly called the tape cassette, cassette tape, audio cassette, or simply tape or cassette, is an analog magnetic tape recording format for audio recording and playback. Invented by Lou Otten ...
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
Elwro was a Polish company that manufactured mainframe and microcomputers from 1959 until 1989. Its plant was in Wroclaw. Computer models included Odra mainframe systems, and the Elwro 800 Junior microcomputer for education.
Overview
The Wro ...
clone of ZX Spectrum. Compared to ver. 2.0, some functions were further optimized and Elwro 800 Junior extensions added.
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
Eastern Europe is a subregion of the Europe, European continent. As a largely ambiguous term, it has a wide range of geopolitical, geographical, ethnic, cultural, and socio-economic connotations. The vast majority of the region is covered by Russ ...
countries, where ZX Spectrum and its
clones
Clone or Clones or Cloning or Cloned or The Clone may refer to:
Places
* Clones, County Fermanagh
* Clones, County Monaghan, a town in Ireland
Biology
* Clone (B-cell), a lymphocyte clone, the massive presence of which may indicate a pathologi ...
were in common use until the mid 1990s. Its ability to expedite games written in Sinclar BASIC was especially appreciated.
[
]
References
External links
ToBoS-FP on World of SpectrumToBoS-FP on Speccy
{{DEFAULTSORT:Sinclair Basic
BASIC compilers
ZX Spectrum