Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

SCELBAL

From Wikipedia, the free encyclopedia
1976 programming language

SCELBAL, short forSCientific ELementary BAsic Language, is a version of theBASIC programming language released in 1976 for theSCELBI and other earlyIntel 8008 and8080-basedmicrocomputers like theMark-8. Later add-ons to the language included an extended math package andstring handling. The original version required 8 kB ofRAM, while the additions demanded at least 12 kB.

The language was published in book form, with introductory sections followed byflowcharts and then the 8008assembler code. The book described ways to save more memory, turning off arrays for instance, and how the user could add their own new features to the language.

History

[edit]

The primary author of SCELBAL is Mark Arnold, who was a high-school student in 1974 when the SCELBI was announced. Arnold was friends with professors at theUniversity of Wyoming (UW), and through them had arranged to have an account on theirSigma 7mainframe computer. The first version of what became SCELBAL was written for this machine. Later that year, he wrote an 8008cross compiler on that platform.

Arnold entered UW in 1975 and contacted Nat Wadsworth, one of the founders of SCELBI, pitching the idea of acompiled version of BASIC for their new platform. This would be a multi-pass system that would save the intermediate versions oncassette tape. This would be very tedious to use but would produce programs that would run on the 4 kB 8H models of the system. Wadsworth favored aninterpreter, which would require 8 kB, which would be available on the new 8B models of the system. The language usedfloating point routines published by Wadsworth in 1975 inMachine Language Programming for the 8008.

It took Wadsworth several months to finally arrange a contract, which included sending Arnold an 8B development system. This significantly delayed the release of the language into 1976. Arnold speculated that, lacking these delays, SCELBAL could have been released at about the same time asAltair BASIC in late 1975. It was first presented in a lengthy article in the second issue ofDr. Dobb's Journal in February 1976.[1]

The release of SCLEBAL was announced in an advertisement inByte's June 1976 issue. The ad did not specifically link the language to the SCELBI platform, instead, it simply offered itself in book form as a complete source listing to create a version of BASIC on any 8008 or 8080 system with the requisite 8 kB of RAM. The book's price was $49, about $277 in 2025.[2]

Description

[edit]

SCELBAL used a 32-bit (four byte)floating point format for numeric calculations, with a 23-bitmantissa, 1-bit sign for the mantissa, a 7-bit exponent, and 1-bit sign for the exponent. These were organized in reverse order, with the least significant byte of the mantissa in the first byte, followed by the middle and then most significant byte with the sign in the high bit. The exponent came last, again with the sign in the high bit.[3] The manual provides well-documentedassembly code for the entire math package, including entry points and usage notes.[4] 32-bit formats were common in this era, while later versions of BASIC, starting withMicrosoft BASIC for theMOS 6502, generally adopted a 40-bit (five byte) format for added precision.[5]

SCELBAL was otherwise similar to other BASIC dialects, including early MS versions likeAltair BASIC, lacking string variables and operators and a number of mathematic functions. Other differences were less pronounced. TheIF statement had an optional formIF...GOTO that removed the need forTHEN,IFX<YGOTO100.[6] It also retained the MS-style short form for the same concept,IFX<YTHEN100. It also allowed conditional execution of other statements, such asIFX<YTHENPRINTX.[7]

The base language did not support string handling, although literal (constant) strings could be used inPRINT, and had the supporting functions ofCHR to print non-printable characters, andTAB to provide layout. Oddly, the system requiredASCII codes to have the high-bit set, so to convert from normal ASCII to SCELBI character codes, one had to add or subtract 128. For instance,

PRINT"HELLO";CHR(172);CHR(160);"WORLD"

to produce the string "HELLO, WORLD" in the output.[8]

INPUT would normally read the user-entered text as a number, but allowed the dollar sign to indicate the value should be read as the SCELBI code instead. For instance,INPUT A would read the user input "1" into A as the floating-point value 1, whileINPUT A$ would result in A being set to 177, 49 (ASCII for "1") + 128. Additionally, when the dollar sign is used, the traditional "?" prompt is not printed, and command returned to the language as soon as a single character is entered, instead of waiting for the carriage return as in the normal case.[8]

Among the few other differences was that theNEW command found in MS, which clears out existing program code and data, is calledSCR for "scratch",[9] and theUSR function, which called amachine language routine, wasUDF for "user defined function".[10]UDF allowed a single floating-point parameter to be passed to the user-defined function, whose machine-language code must have been loaded into memory at a fixed location ahead of runtime.[11]

Error codes were reduced to two letters, and code forLOAD andSAVE were provided in boilerplate form and expected to be implemented when ported to different platforms.[12] Line numbers could be between 1 and 999999,[10] whereas most BASICs used a 16-bit integer and thus supported lines from 1 to 32767 or 1 to 65535.

Language features

[edit]
Taken from the 1976 manual unless otherwise noted.[13]

Commands

[edit]

Immediate-mode only

[edit]

Referred to as "executive" mode in the documentation.

SCR
scratch, equivalent to MSNEW
LIST
RUN
LOAD
SAVE

Immediate or program mode

[edit]
PRINT
INPUT
Like MS, could accept multiple variables,INPUTA,B,C. Did not include a prompt string.
LET
Like MS, theLET was optional, so15LETX=10 and15X=10 are equivalent.
IF...THEN
IF...GOTO
Alternate form ofIF...THEN.
GOTO
It appears the "spaced version",GO TO, was not supported.
GOSUB...RETURN
FOR...TO...STEP...NEXT
As in MS,STEP is optional and assumed to be 1.NEXT required a variable, unlike later MS versions.
REM
END
DIM
Arrays worked as in MS, but were optional and could be turned off to save memory. Only single-dimension arrays were supported, and the total number of elements for all arrays combined was 64 numbers.

Functions

[edit]
INT
SGN
ABS
SQR
RND
As in MS, takes a dummy variable and returns a value between 0 and 1.
CHR
Note the lack of the $ found in MS, which usesCHR$.
TAB
UDF

Extensions

[edit]

SCELBI published two extensions to the system, the Mathematical Functions Supplement, and the Strings Supplement.

Math Functions Supplement

[edit]

The Mathematical Functions Supplement added five newtranscendental functions,SIN,COS,EXP,LOG, andATN.[14]

String Supplement

[edit]

The String Supplement was somewhat larger than the Math Functions, including a number of new features.

Strings could be up to 80 characters long, and the system could hold a total of 64 string variables. Any one of those 64, or all of them, could be one-dimensional arrays, but the total number still had to be 64 strings in total. Oddly, string arrays did not require aDIM statement.[15]

In contrast to MS BASIC, and theDartmouth BASIC string handling that inspired it, SCELBI used the "slicing" style of string manipulation found in contemporary BASICs likeSDS BASIC,HP Time-Shared BASIC andNorthstar BASIC, or the laterAtari BASIC. Instead of using functions likeLEFT$,RIGHT$,MID$ to access substrings, the array-access syntax was used with a colon preceding the starting point and optionally a semicolon preceding the length. As SCELBAL also supported string arrays, the first number in the array accessors was the array index, and was optional if the variable was not an array. So, for instance, the code:[15]

10LETA$="HELLO"20PRINTA$(:2;3)

would result in "ELL" being printed to the output. If an array was used the syntax required the array index in the first parameter:[15]

100LETA$(1)="HELLO"150LETA$(2)="WORLD"200PRINTA$(2:2;3)

would result in "ORL" being printed to the output. SCELBAL also allowed omitting the semicolon, which specifies the characters from the starting point to the end of the string. So, for instance, the code:

210PRINTA$(2:2)

would result in "ORLD" being printed to the output.

Although similar to SDS BASIC, there is a major difference in the way this works in comparison to the other BASICs that used slicing syntax, in that the last parameter is the length, not a position. For instance, in Atari BASIC the similar-looking code:[16]

20PRINTA$(2,3)

would instead output "EL", as the instruction translates to "print all characters between positions 2 and 3". In this fashion, SCELBAL works in a fashion more similar to MS BASIC, where the equivalents would be:[17]

20PRINTMID$(A$,2,3)

and

210PRINTRIGHT$(A$(2),2)

To add full support for strings, the Supplement replaced the originalCHR withCHR$, which matched the syntax of its MS counterpart.[15] Likewise,INPUT was modified so string variables worked like numeric ones, waiting for the carriage return and then assigning the entire user input to the associated string variable.[18] It also added the support functionsLEN andASC,[15] andVAL$ to convert a string containing a numeric value to a string representation of that number. As in MS,concatenation used the+ operator.[18]

References

[edit]

Citations

[edit]
  1. ^Arnold, Mark; Wadsworth, Nat (February 1976)."SCELBAL - A Higher Level Language for 8008/8080 Systems".Dr. Dobb's Journal. pp. 30–53.
  2. ^"Shocking!".Byte. June 1976. p. 47.
  3. ^Arnold & Wadsworth 1976, p. 10.1.
  4. ^Arnold & Wadsworth 1976, p. 10.
  5. ^Steil, Michael (20 October 2008)."Create your own Version of Microsoft BASIC for 6502".
  6. ^Arnold & Wadsworth 1976, p. 14.10.
  7. ^Arnold & Wadsworth 1976, p. 2.3.
  8. ^abArnold & Wadsworth 1976, p. 14.16.
  9. ^Arnold & Wadsworth 1976, p. 14.1.
  10. ^abArnold & Wadsworth 1976, p. 14.17.
  11. ^Arnold & Wadsworth 1976, p. 14.3.
  12. ^Arnold & Wadsworth 1976, p. 14.18.
  13. ^Arnold & Wadsworth 1976.
  14. ^Math 1977, p. 1.
  15. ^abcdeStrings 1977, p. 1.
  16. ^Small, David, ed. (1983)."Atari Strings and Text Handling".The Creative Atari. Creative Computing.
  17. ^Strings 1977, p. 3.
  18. ^abStrings 1977, p. 2.

Bibliography

[edit]
  • Arnold, Mark; Wadsworth, Nat (1976).SCELBAL: A higher level language for 8008/8080 systems(PDF). SCELBI Computer Consulting.
  • Arnold, Mark (1977).SCELBAL Mathematical Functions Supplement. SCELBI Computer Consulting.
  • Arnold, Mark (1977).SCELBAL Strings Supplement. SCELBI Computer Consulting.

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=SCELBAL&oldid=1293170056"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp