HOME

TheInfoList



OR:

SUPER BASIC, sometimes SBASIC for short, is an advanced dialect of the
BASIC programming language Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * ''Basic'' (film), a 2003 film * Basic, on ...
offered on Tymshare's
SDS 940 The SDS 940 was Scientific Data Systems' (SDS) first machine designed to directly support time-sharing. The 940 was based on the SDS 930's 24-bit CPU, with additional circuitry to provide protected memory and virtual memory. It was announced in ...
systems starting in 1968 and available well into the 1970s. Like the
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
it was based on, SUPER BASIC was a compile and go language, as opposed to an
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
. In addition to offering most of the commands and functions from Dartmouth BASIC Version 4, in including matrix math commands, SUPER BASIC also included a number of features from the seminal
JOSS JOSS (acronym for JOHNNIAC Open Shop System) was one of the first interactive, time-sharing programming languages. It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as bo ...
language developed at
Rand Corporation The RAND Corporation, doing business as RAND, is an American nonprofit global policy think tank, research institute, and public sector consulting firm. RAND engages in research and development (R&D) in several fields and industries. Since the ...
, via Tymshare's version,
CAL Cal or CAL may refer to: Arts and entertainment * ''Cal'' (novel), a 1983 novel by Bernard MacLaverty * "Cal" (short story), a science fiction short story by Isaac Asimov * ''Cal'' (1984 film), an Irish drama starring John Lynch and Helen Mir ...
, and added a variety of new functions,
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the for ...
s as a built-in type, and
double precision Double-precision floating-point format (sometimes called FP64 or float64) is a floating-point arithmetic, floating-point computer number format, number format, usually occupying 64 Bit, bits in computer memory; it represents a wide range of numeri ...
support. SUPER BASIC also greatly improved
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
handling over the rudimentary system in Dartmouth, introducing the , and string functions, simple string concatenation and other features. These were later used in DEC's
BASIC-PLUS BASIC-PLUS is an extended dialect of the BASIC programming language that was developed by Digital Equipment Corporation (DEC) for use on its RSTS/E time-sharing operating system for the PDP-11 series of 16-bit minicomputers in the early 1970s thro ...
, which was later used as the basis for the original
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first v ...
that saw widespread use in the 1980s.


History

The original
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
was released in 1964 but was largely experimental at the time. It went through several revisions before becoming truly useful with the Fourth Edition when it was ported to the GE 635 machine and was published in 1968. Dartmouth specifically placed the underlying design in the public domain, so that anyone could port it to their platforms and call it BASIC. Its spread was further helped by the tireless efforts of its authors to promote it. However, as the code was designed to run on the DTSS operating system, some porting was required to run it on production systems. This led to a proliferation of versions with minor differences. Tymshare was formed within the
University of California, Berkeley The University of California, Berkeley (UC Berkeley, Berkeley, Cal, or California), is a Public university, public Land-grant university, land-grant research university in Berkeley, California, United States. Founded in 1868 and named after t ...
, initially renting out time on the University's computers on off-hours. Tymshare's original BASIC, simply Tymshare BASIC, was based on
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
"from elsewhere" in the University, that Dan Lewis began enhancing. Frank Bracher added the routines for file input/output (I/O), which made it far more practical than the original Dartmouth code that relied purely on statements embedded in the program. Dartmouth's workflow was tape based so loading and saving individual files was not practical and direct I/O was not addressed until later versions. Bracher's I/O code had originally been developed for Tymshare's SUPER FORTRAN offering. One oft-noted feature of the system was the documentation, written by Caroline Diehl. The manuals were written in a conversational style. Tymshare maintained SUPER BASIC through the 1970s, but as the market for rented timeshare programming services dwindled the system went into maintenance and Lewis and Bracher left to do SUPER BASIC consulting for those companies still using it. Maintenance within Tymshare passed primarily to Walter Main. Tymshare filed for a trademark on SUPER BASIC on 7 January 1970, and refreshed it on 17 October 1977, which became the property of
McDonnell Douglas McDonnell Douglas Corporation was a major American Aerospace manufacturer, aerospace manufacturing corporation and defense contractor, formed by the merger of McDonnell Aircraft and the Douglas Aircraft Company in 1967. Between then and its own ...
in 1984 when the company purchased Tymshare.


Language


Direct and indirect mode

Like most BASIC systems of the era, SUPER BASIC had a single
command line A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
editor that worked both as an interactive language and a program editor. Commands that were typed without a line number were executed immediately, which they referred to as " direct mode". If the same line was prefixed with a line number, it was instead copied into the program code storage area, known as "indirect mode". New lines were added to the program if the line number was unique, replaced existing lines with the same number, or removed from the program if an existing line number was typed in without any code following it.


Program statements

Line numbers ran from 0 to 999999. The (or short-form ) could be used to delete a range of lines using typical notation, for instance, . The command started an automatic line-number system. It took two optional parameters, a starting line number and a step, separated with . The starting number was assumed to be zero if not provided, and the step was 10. For instance, would produce 0,10,20,..., would produce 0,5,10,..., and would produce 10,20,30... took three parameters, a new starting line number, a range of lines to renumber (like 20-100) and the step. Although the built-in editor loaded and saved only the lines in the program itself, the user could edit the resulting text file to add additional commands that would run in direct mode. A common example was to edit a program and add on its own line at the end of the file. When loaded, the system would see the and immediately compile and start the program on loading. This is unusual for BASIC systems, although this was commonly used in JOSS.


Statements

In keeping with the overall
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
concept, SUPER BASIC was a compile and go system that compiled the source code when the program was run. SUPER BASIC had two commands for this, the typical seen in most BASICs, as well as which did the same thing. Remarks could be placed anywhere using . SUPER BASIC expanded the statement in several ways. A minor change was to allow in place of , and allowed the step to be placed at the end as in most BASICs, or in the middle as in JOSS and other languages. Thus and were both valid. Additionally, SUPER BASIC provided alternate forms of the range definition using and , whereas most other languages used completely separate loop structures for these. For instance, will continue as long as XMicrosoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first v ...
, multiple loops could end with a single , although it did not include the feature of later version of MS where the index variable could be left off entirely. Finally, in JOSS fashion, one could replace the typical range specifier with an explicit list of values, . A more major change, following the JOSS model, was the concept of "statement modifiers" that allowed an or to be placed after the statement it controlled. For instance, is equivalent to . This can make some commonly found use-cases easier to understand. It also included the
syntactic sugar In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an ...
which was an with the opposite sense; for instance, . One could also use a loop in these cases, which made single one-statement loops easy to implement, for instance . One could also use a "bare" or without the for, . The modifiers could also be ganged, .


Expressions


Variables

Variable names could consist of one or two letters or one letter and a digit. SUPER BASIC did not require variables to be typed, a variable could hold a number at one point and a
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
at another, a side-effect of the way they were stored. This required the system to test the variable type at runtime during and for instance, which reduced performance. This could be addressed by explicitly declaring the variable type using a variety of commands. In most dialects of BASIC, variables are created on-the-fly as they are encountered in the code, and generally set to zero (or the empty string) when created. This can lead to problems where variables are supposed to be set up by previous code that is not being properly called, but at run time it can be difficult to know if 0 is an uninitialized value or one with the perfectly legal 0 values. SUPER BASIC addressed this with the command. There were two primary forms, which made all undefined variables automatically get the value zero when accessed, which is the normal pattern for BASIC, and which would instead cause a "VARIABLE HAS NO VALUE" error to occur when a previously unseen variable was used in a way that attempted to access its value. The later is very useful in
debugging In engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs. For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
scenarios, where the normal behavior can hide the fact that a variable being used in a calculation has not been correctly initialized.


Numeric

Unless otherwise specified, variables were stored in a 48-bit
single precision Single-precision floating-point format (sometimes called FP32 or float32) is a computer number format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point. A floa ...
floating point In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a signed sequence of a fixed number of digits in some base) multiplied by an integer power of that base. Numbers of this form ...
format with eleven digits of precision. One could also explicitly define a variable as , which was the single-precision format. This was not a consideration in other BASICs where some sort of suffix, like , indicated the type wherever it was encountered. When required, a
double precision Double-precision floating-point format (sometimes called FP64 or float64) is a floating-point arithmetic, floating-point computer number format, number format, usually occupying 64 Bit, bits in computer memory; it represents a wide range of numeri ...
format with seventeen digits, stored in three 24-bit words instead of two, could be used by declaring a variable with . An existing single precision value or expression could be converted to double using the function. For instance, one could force an expression to evaluate using double precision using . Likewise, one could declare to produce a one-word 24-bit integer value. A more unusual addition was direct support for
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the for ...
s. These were set up in a fashion similar to other variables, using to set aside two single precision slots. When encountered in programs, other statements like would trigger alternative modes that asked for two numbers instead of one, with similar modifications to (used with statements), and others. A single complex number could be created from two singles using the function, while and extracted the real and imaginary parts, respectively, into singles. A small number of additional utility functions were also offered.


Operators and functions

There were seven basic math operators: * for exponents - the exponent is converted to a 12-bit integer * for multiplication * for division * for modulo, the remainder of an integer division * for integer division * for addition * for subtraction SUPER BASIC's list of mathematical functions was longer than most BASICs, including a series of
inverse trigonometric functions In mathematics, the inverse trigonometric functions (occasionally also called ''antitrigonometric'', ''cyclometric'', or ''arcus'' functions) are the inverse functions of the trigonometric functions, under suitably restricted Domain of a functi ...
and
logarithm In mathematics, the logarithm of a number is the exponent by which another fixed value, the base, must be raised to produce that number. For example, the logarithm of to base is , because is to the rd power: . More generally, if , the ...
s for base 2 and 10. RND(X), returns a random number using a fixed sequence, can be seeded with RND(-1) ABS(N), absolute value SQR(N) or SQRT(N), square root SIN COS TAN ASIN ACOS ATN or ATAN ATN/ATAN with two variables, (y,x) calculates y/x and returns ATN of that SINH COSTH TANH LOG LGT/LOG10 LOG2 EXP EXP2 INT, as in BASIC, always truncates downward FIX, similar to INT but simply truncating the decimal ROUND, rounds the value to closest, unlike INT COMP(X,Y) COMPare, combines a subtraction and SGN, so if X>Y=1, X=Y=0, XY, 0 otherwise SUPER BASIC included a number of functions from JOSS as well: IP(), Integer Part, equivalent to INT FP(), Fraction Part, same as X-INT(X) MAX(...) returns the maximum value from a list of entries MIN(...) returns the minimum


Arrays and matrix math

In addition to basic math, SUPER BASIC included array functionality like many other BASIC implementations. One could to make a two-dimensional array, and as a consequence of the way they were stored, all variables otherwise undeclared were actually DIMed to have ten indexes, so one could without previously DIMing B. In contrast with other BASICs, SUPER BASIC allowed one to define the range of one or both of the dimensions, assuming 1 if not defined. So A in the example above has indexes 1..5, but one might also to produce an array that has 11 indexes from -5 to +5 for X, and 0 to +5 for Y. One could also use the command to change the default, so , for example, makes all dimensions start at 0. In addition to these traditional BASIC concepts, SUPER BASIC also included most of the matrix math features found in later versions of Dartmouth BASIC. These were invoked by adding the keyword to the front of other commands. For instance, multiplies all the items in array B by their corresponding item in C, whereas multiplies all the elements in B by 5. Functions for common matrix operations like inversion and identity were included.


Binary math and logical values

As in most versions of BASIC, SUPER BASIC included the standard set of comparison operators, , , , , and , as well as boolean operators , and . In addition, could be used as an alternate form of , a form that was found on a number of BASIC implementations in that era. SUPER BASIC also added , for "equivalence" (equals) and for "implication". To this basic set, SUPER BASIC also added three new commands for comparing small differences between numbers, these were , and . The much-greater-than and much-less-than operators compared the values of the two operands, for instance, A and B in the expression . If adding B to A results in A being unchanged after the inherent rounding, returned true. Internally this was performed by . , the close-to-equals, simply compared both values to an internal meta-variable, , performing . Most dialects of BASIC allow the result of such logical comparisons to be stored in variables, using some internal format to represent the logical value, often 0 for false and 1 or -1 for true. SUPER BASIC also allowed this, which resulted in the somewhat confusing behavior of , which, following operator precedence, assigns 5 to B and then returns true or false if A=B. SUPER BASIC also added true logical variables, declared in a similar fashion as doubles or complex, using , and other variables could be conveyed to logical using . In contrast to logical comparisons and operators, SUPER BASIC also added a number of bitwise logical operators. These applied a basic logical operation to the individual bits in a word. These included , and , for and, or and exclusive or. Additional functions include and for bit-shifting left and right, respectively. To ease the entry of binary values, constants could be entered in
octal Octal (base 8) is a numeral system with eight as the base. In the decimal system, each place is a power of ten. For example: : \mathbf_ = \mathbf \times 10^1 + \mathbf \times 10^0 In the octal system, each place is a power of eight. For ex ...
format by prefixing a number with an "O", like .


Strings

SUPER BASIC allowed string constants (literals) to be enclosed with single or double quotes, so one could use or . In contrast to later dialects of BASIC, one could assign a string to any variable and the signifier was not used, so was valid. This could lead to some confusion when a user provided a value combining digits and letters, and SUPER BASIC assumed anything starting with a digit was a number. To guide the system when this might result in confusing input, one could explicitly declare string variables using . As with all variables in SUPER BASIC, these could be arrays, . Additionally, SUPER BASIC added the additional statement which took a second parameter to define the length of the string elements, so makes an array with 12 elements of 10 characters each, while is an array of six elements, 5..10, each 15 characters long.


String operators and functions

SUPER BASIC included operators for for comparison and for concatenation. It included the following functions:


Utility functions

Typical utility functions are also included: POS returns the column of the print head POS(X) returns the position in a file TAB(X) moves the print head to column X TAB(X,N) the same in file number N DATE TIME SUPER BASIC also included pseudo-variables for and , the later being double-precision, as well as the previously mentioned to represent the smallest possible value.


Print formatting

SUPER BASIC included two forms of print formatting that could be used with the statement. used a format string, in this case stored in , in a fashion similar to what other BASICs implemented using or the more common examples found in C and its follow-ons. Field type included integers, specified decimal formats, and exponents, as well as strings and text. signs indicated a single digit in either an integer or real field, and indicated a digit in an E field. and could be used to prefix any value. worked generally the same way, the difference being that spaces had to be explicitly defined using . Thus the format string would print two numerical values with three spaces between them, whereas if this was an image the would be printed out with a space on either side. The version supported a wider variety of format strings and included items like inline carriage returns, but the examples given in the manuals do not make it clear why there are two such systems when they accomplish the same thing in the end. Interestingly, the same format commands could be used for , not just . In this case the user input would be properly formatted based on the string, so might be truncated to if the format is .


File I/O

SUPER BASIC included a file input/output system based on and where is file handle, a number. The number was assigned using . was provided as an alternative to , but they are identical internally. When complete, the file can be released with or . When working with files, one could read the next-read location using and change it using . returned the position within a form if was being used. returned the file size. The could be used in loops to test whether the end of the file was reached during reads. The system also included a function that returned whether or not there was input waiting in the terminal. SUPER BASIC programs often included code like to wait for user input and test it every second before continuing. Additionally, it included a pseudo-filename that could be opened for reading and writing using and then . In addition to , both and also referenced the command teletype.


Notes


References


Citations


Bibliography

* * {{cite book , title=The Tym Before ... , first= Nathan , last= Gregory , publisher=Lulu , date= 2018 , isbn= 9781387304059 , url=https://books.google.com/books?id=UIFcDwAAQBAJ BASIC programming language family Tymshare software