SuperBASIC

Appearance move to sidebar hide SuperBASIC
Developer(s)Sinclair Research, Jan Jones
Initial release1984 (1984)
Operating systemQDOS
PlatformSinclair QL microcomputer
Typesecond-generation BASIC
LicenseProprietary

SuperBASIC is an advanced variant of the BASIC programming language with many structured programming additions. It was developed at Sinclair Research by Jan Jones during the early 1980s.

Originally SuperBASIC was intended as the BASIC interpreter for a home computer code-named SuperSpectrum, then under development. This project was later cancelled; however, SuperBASIC was subsequently included in the ROM firmware of the Sinclair QL microcomputer (announced in January 1984), also serving as the command line interpreter for the QL's QDOS operating system.

It was one of the first second-generation BASICs to be integrated into a microcomputer's operating system (unlike BBC BASIC which preceded it in 1981), making the OS user-extendable—as done by Linus Torvalds in his formative years.

Advanced features

The function below illustrates the last eight of these features. After having RUN it, entering

PRINT weekdays$(Iso("19631122",1))

will print FRI to the screen. Until cleared (e.g. by entering NEW), the function Iso will act like an extension to the operating system. Similarly, according to the QL User Guide, "many of the operating system commands are themselves defined as procedures."

Example

AUTO 11,2 DEFine FN Iso(S,O) LOCal y%,m%,d%,i$,n%,w% REM Step 0 - to isolate components of date-stamp S="YEARMoDa" LET y%=S(1TO 4) : m%=S(5TO 6) : d%=S(7TO 8) REM Step 1 - to initiate Lachman's Congruence LET i$=m%*2.56+ 193 : S=S(1TO 6)- 3 REM Step 2 - to compute the day-number within the week LET w%=(S(1TO 2)&"32"DIV 16+ S(1TO 4)DIV 4+ y%+ i$(2TO 3)+ d%)MOD 7 REM Step 3 - to return result SELect ON O ON O= 5 : n%=i$(2TO 3) ON O= 4 : n%=y% ON O= 3 : n%=m% ON O= 2 : n%=d% ON O= 1 : n%=w% ON O= REMAINDER : n%=-1 END SELect RETurn n% REM data statements DIM weekdays$(6,3) RESTORE 190 FOR count=0 TO 6 : READ weekdays$(count)

ctrl+space

100 DIM month$(12,9) 110 RESTORE 120 REM QL User Guide's "Data Read Restore" example ii 130 REM appropriately amended relative to example i 140 FOR count=1 TO 12 : READ month$(count) 150 DATA "January","February","March" 160 DATA "April","May","June" 170 DATA "July","August","September" 180 DATA "October","November","December" 190 DATA "SUN","MON","TUE","WED","THU","FRI","SAT" 199 END DEFine Iso

Bibliography

References

  1. ^ "Illustrating Super-BASIC on the Sinclair QL". Computing History. Retrieved 2023-02-06.
  2. ^ Apostolo, Alberto. "Sinclair QL: mistakes, misfortune and so many regrets". RetroMagazineWorld. Retrieved 2023-02-06.
  3. ^ gopher://sdf.org/0/users/retroburrowers/TemporalRetrology/QL/JG
  4. ^ Berry, Stephen (1984). QL User Guide (2nd ed.). Cambridge: Sinclair Research Ltd.
  5. ^ "Motorola 68000", Wikipedia, 2023-01-11, retrieved 2023-02-06