Southampton BASIC System

Last updated

Southampton BASIC System (SOBS) was a dialect of the BASIC programming language developed for and used on ICT 1900 series computers in the late 1960s and early 1970s; it was implemented as an incremental BASIC interpreter under the MINIMOP operating system at the University of Southampton [1] and also ran under MAXIMOP.

Contents

It was operated from a Teletype terminal, though CRT terminals could also be used.

Language characteristics

In common with many early implementations of BASIC, SOBS needed lines to have line numbers, both to allow a user to add new lines to the program in the desired place and also as targets for GOTO and GOSUB statements. A RENUMBER facility was available to allow for sections of the code to be renumbered, by default in increments of 10, to allow more space in the middle of a program.

Other than line numbers, all numeric values were represented internally as floating point.

Statements

The language had relatively few statements by comparison with modern programming languages:

StatementPurpose
DATAStored data for READing into variables at runtime
DIM var(size)...Dimension an array. One-, two- and three-dimensional arrays were supported.
ENDHalt execution of the program.
FOR var=start TO end [STEP incr]Perform a set of statements repeatedly for varying values of var
GOSUB lineCall a subroutine at a given line number; flow would return to the next statement when a RETURN was executed.
GOTO lineUnconditional branch to a given line number.
IF expr THEN line [ELSE line]Conditionally branch. The THEN and ELSE parts could only give line numbers to go to.
INPUT varPrompt the user for input data
LET var=exprAssign a value to a variable. Unlike many modern dialects of BASIC, LET was not an optional word.
NEXT varPerform the next iteration of a FOR loop.
PRINTOutput to the Teletype
READ var...Read data from DATA statements into variables
REMShort for REMark, this allowed for a comment to be placed on a line
RESTORE [line]Reset the READ pointer in order to re-read DATA
RETURNReturn to the line following a GOSUB.

Note in particular the lack of a WHILE-like statement; FOR was the only looping construct available to programmers.

Variables

Variable names for numeric values were either a single letter, or a single letter followed by a single numeric digit, thus allowing for 286 discreet variables in total. Strings were supported; variable names for them had the same restriction but were followed by a pound (£) symbol.

Functions

A limited number of numeric functions were provided, all of which took one numeric parameter:

FunctionFunction() returned
SIN
COS
ATN
SQR
LOG
EXP
INTThe largest integer not greater than
SGN1, 0, or 1, depending on whether was less than, equal to, or greater than zero
ABS if was negative, otherwise

Support for strings was more limited, with only one function, LEN, which returned the length of the string parameter. Sub-strings were supported with square brackets, so A£[2,3] referred to the sub-string of the string from the 2nd character to the 3rd character inclusive, so

10LETA£="FOO"20PRINTA£[2,3]

would print OO

This syntax was also supported on the left-hand side of an assignment, so

10LETA£="FOO"20LETA£[2,2]="BAR"30PRINTA£

would print FBARO

Arrays

Support for handling arrays of data was relatively strong, with MAT statements able to read an entire array from DATA statements, and perform useful matrix operations such as matrix addition, matrix subtraction, matrix multiplication, and finding the inverse matrix for a square matrix.

Example:

10DIMA(3,3)20MATREADA30DATA1,1,2,1,0,2,0,2,140DIMB(3,3)50MATREADB60DATA0,0,1,0,1,0,1,0,070DIMC(3,3),D(3,3)80MATC=A*B90MATD=INV(C)100MATPRINTD,
A is read from the first DATA statement
B is read from the second DATA statement
C is calculated by multiplying A and B
D is calculated as the inverse of C

The output would be 2 2 1 1 -1 0 4 -3 -2

Debugging

SOBS had primitive debugging capabilities, limited mostly to the TRACE statement. TRACE ON would cause the interpreter to print each line number as it was executed.

Related Research Articles

Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the original Apple II model. It is also referred to as FP BASIC because of the Apple DOS command used to invoke it, instead of INT for Integer BASIC.

<span class="mw-page-title-main">Atari BASIC</span> Dialect of the BASIC programming language

Atari BASIC is an interpreter for the BASIC programming language that shipped with the Atari 8-bit family of 6502-based home computers. Unlike most American BASICs of the home computer era, Atari BASIC is not a derivative of Microsoft BASIC and differs in significant ways. It includes keywords for Atari-specific features and lacks support for string arrays, for example.

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 interactive programming environment to all undergraduates as well as the larger university community.

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 through the 1980s.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

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.

<span class="mw-page-title-main">Vilnius BASIC</span> Dialect of the BASIC programming language

Vilnius BASIC, sometimes known as BK BASIC, is a dialect of the BASIC programming language running on the Elektronika BK-0010-01/BK-0011M and UKNC computers. It was developed at Vilnius University, located in Lithuania which was a republic of the Soviet Union at the time.

HP Time-Shared BASIC is a BASIC programming language interpreter for Hewlett-Packard's HP 2000 line of minicomputer-based time-sharing computer systems. TSB is historically notable as the platform that released the first public versions of the game Star Trek.

thinBasic is a BASIC-like computer programming language interpreter with a central core engine architecture surrounded by many specialized modules. Although originally designed mainly for computer automation, thanks to its modular structure it can be used for wide range of tasks.

Color BASIC is the implementation of Microsoft BASIC that is included in the ROM of the Tandy/Radio Shack TRS-80 Color Computers manufactured between 1980 and 1991. BASIC is a high level language with simple syntax that makes it easy to write simple programs. Color BASIC is interpreted, that is, decoded as it is run.

IBM System/34 BASIC was an interpreter for the IBM System/34 midrange computer.

IBM System/36 BASIC was an interpreter for the IBM System/36 midrange computer.

SCELBAL, short for SCientific ELementary BAsic Language, is a version of the BASIC programming language released in 1976 for the SCELBI and other early Intel 8008 and 8080-based microcomputers like the Mark-8. Later add-ons to the language included an extended math package and string handling. The original version required 8 kB of RAM, while the additions demanded at least 12 kB.

SUPER BASIC, sometimes SBASIC for short, is an advanced dialect of the BASIC programming language offered on Tymshare's SDS 940 systems starting in 1968 and available well into the 1970s.

Data General Extended BASIC, also widely known as Nova Extended BASIC, was a BASIC programming language interpreter for the Data General Nova series minicomputers. It was based on the seminal Dartmouth BASIC, including the Fifth Edition's string variables and powerful MAT commands for matrix manipulation. In contrast to the compile-and-go Dartmouth BASIC, Extended BASIC was an interpreter.

SDS BASIC, also known as CP-V BASIC, Batch BASIC or Sigma BASIC depending on the version, is a BASIC programming language compiler for Scientific Data Systems's (SDS) Sigma series mainframe computers, originally released in 1967. Xerox purchased SDS in 1969 and began rebranding it as Xerox Data Systems, and finally just Xerox, at which time the language became known as Xerox BASIC.

Wang BASIC is a series of BASIC programming languages for computers from Wang Laboratories. The term can be used to refer to the BASIC on any Wang machine, but is mostly associated with the versions on the Wang 2200 minicomputer series of the early 1970s. When these machines were updated to the VP series in 1976, BASIC-2 was introduced and remained the pattern for future machines in the 2200 series. A planned BASIC-3 was never released.

Full BASIC, sometimes known as Standard BASIC or ANSI BASIC, is an international standard defining a dialect of the BASIC programming language. It was developed by the American National Standards Institute (ANSI) X3.60 group in partnership with the European ECMA. It describes an advanced version of BASIC with many features including structured programming, matrix math, input/output for file handling, and many other options.

CALL/360:BASIC was an IBM dialect of the BASIC programming language for the System/360 and later platforms. It was based on mid-1960s versions of Dartmouth BASIC but added a number of extensions. Most of these were related to file handling, which, at that time, Dartmouth lacked. It also added support for the mathematical symbols found on some IBM terminals, so that <= could be entered directly as . Differences are otherwise minor.

Acorn System BASIC and Atom BASIC are two closely related dialects of the BASIC programming language developed by Acorn Computers for their early microcomputers like the Acorn System 3 and Acorn Atom. Developed in-house, they have a number of significant idiosyncrasies compared to most BASIC dialects of the home computer era.

References

  1. Rees, M.J.; Oppenheimer, A.W. (21 January 1977). "SOBS – an incremental BASIC system". Software: Practice and Experience. Wiley InterScience. 7 (5): 631–643. doi:10.1002/spe.4380070508. S2CID   33989728. Archived from the original on 5 January 2013. Retrieved 18 May 2009.