Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

SuperBASIC

From Wikipedia, the free encyclopedia
Sinclair QL variant of the BASIC programming language
This article is about the interpreter included in Sinclair QDOS. For the unrelated BASIC system by Tymshare, seeSUPER BASIC.
SuperBASIC
DevelopersSinclair Research,Jan Jones
Initial release1984; 42 years ago (1984)
Operating systemQDOS
PlatformSinclair QLmicrocomputer
Typesecond-generation BASIC
LicenseProprietary

SuperBASIC is an advanced variant of theBASIC programming language with manystructured programming additions. It was developed atSinclair Research byJan Jones during the early 1980s.

Originally SuperBASIC was intended as theBASIC interpreter for ahome computer code-namedSuperSpectrum, then under development. This project was later cancelled; however, SuperBASIC was subsequently included in theROMfirmware of theSinclair QLmicrocomputer (announced in January 1984), also serving as thecommand line interpreter for the QL'sQDOSoperating system.[1][2]

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

Reception

[edit]

BYTE in September 1984 approved of SuperBASIC's improvements overSinclair BASIC but criticized its "very, very slow" performance on theByte Sieve, writing that "With a 7.5-MHz68008, you'd think it would take some effort to get a language to run that slowly". The magazine also noted that SuperBASIC's seven-digit precision made it unsuitable for business use ("you can represent numbers far larger than the number of quarks in the universe, but not the pennies on your balance sheet if your turnover exceeds £99,000").[3]

Advanced features

[edit]
  • RESPR for residentprocedures, e.g. to extend QDOS
  • choice of parameters passed to procedures
  • procedures return parameters as chosen
  • IF -THEN -ELSE -END IF
  • FOR -NEXT -EXIT -END FOR
  • REPeat -NEXT -EXIT -END REPeat
  • SELect ON -ON -REMAINDER -END SELect
  • arbitrarilyRETurn from within procedures & functions
  • data type coercion betweennumeric andstring variables
  • actual parameters passing data type to formal parameters
  • array operations: slicing, joining etc.
  • LOCal arrays & (string) variables
  • AUTOmatic line numbering
  • relativeRESTORE &DATA

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

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

will printFRI to the screen. Until cleared (e.g. by enteringNEW), the functionIso[4] 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."[5]

Example

[edit]
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 initiateLachman's Congruence[6]  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

100DIMmonth$(12,9)110RESTORE120REMQLUserGuide's "Data Read Restore" example ii130REMappropriatelyamendedrelativetoexamplei140FORcount=1TO12:READmonth$(count)150DATA"January","February","March"160DATA"April","May","June"170DATA"July","August","September"180DATA"October","November","December"190DATA"SUN","MON","TUE","WED","THU","FRI","SAT"199ENDDEFineIso

Bibliography

[edit]

References

[edit]
  1. ^"Illustrating Super-BASIC on the Sinclair QL".Computing History. Retrieved2023-02-06.
  2. ^Apostolo, Alberto."Sinclair QL: mistakes, misfortune and so many regrets".RetroMagazineWorld. Retrieved2023-02-06.
  3. ^Pountain, Dick (September 1984)."The Sinclair QL".BYTE. pp. 415–419. Retrieved2025-04-10.
  4. ^gopher://sdf.org/0/users/retroburrowers/TemporalRetrology/QL/JG
  5. ^Berry, Stephen (1984).QL User Guide (2nd ed.). Cambridge: Sinclair Research Ltd. Archived from the original on February 22, 2017.
  6. ^"Motorola 68000",Wikipedia, 2023-01-11, retrieved2023-02-06

External links

[edit]
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
Retrieved from "https://en.wikipedia.org/w/index.php?title=SuperBASIC&oldid=1288773454"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp