Southampton BASIC System: Difference between revisions

Content deleted Content added
m Language characteristics: <source lang="basic">
OAbot (talk | contribs)
m Open access bot: url-access updated in citation with #oabot.
 
(18 intermediate revisions by 15 users not shown)
Line 1:
{{One source|date=December 2023}}
{{see also|SOB (disambiguation)}}
{{Use dmy dates|date=JanuaryAugust 20112021}}
'''Southampton BASIC System''' ('''SOBS''') was a dialect of the [[BASIC]] [[programming language]] developed for and used on [[ICT 1900 series]] computers in the late 60s1960s and early 70s1970s; it was implemented as an incremental [[BASIC interpreter]] under the [[MINIMOP]] operating system at the [[University of Southampton]].<ref>
{{cite webjournal
| last = Rees
| firstlast1 = M.J.Rees
| lastfirst1 = ReesM.J.
| last2 = Oppenheimer
| first2 = A.W.
| title = SOBS - an incremental BASIC system
| workjournal = Software: Practice and Experience
| publisher = Wiley InterScience
| date = 21 January 1977
| volume = 7
| url = http://www3.interscience.wiley.com/journal/113444749/abstract?CRETRY=1&SRETRY=0
| issue = 5
| pages = 631–643
| url = http://www3.interscience.wiley.com/journal/113444749/abstract?CRETRY=1&SRETRY=0
| archive-url = https://archive.today/20130105083634/http://www3.interscience.wiley.com/journal/113444749/abstract?CRETRY=1&SRETRY=0
| url-status = dead
| archive-date = 5 January 2013
| format =
| doi = 10.1002/spe.4380070508
| accessdates2cid = 18 May 200933989728
| access-date = 18 May 2009
}}</ref>
| url-access = subscription
}}</ref> and also ran under [[MAXIMOP]].
 
It was operated from a [[Teletype Corporation|Teletype]] terminal, though CRT terminals could also be used.
 
== Language characteristics ==
Line 78 ⟶ 88:
 
=== Variables ===
[[Variable (programming)|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 (<code>&pound;£</code>) symbol.
 
=== Functions ===
Line 116 ⟶ 126:
 
Support for strings was more limited, with only one function, <code>LEN</code>, which returned the length of the string parameter. Sub-strings were supported with square brackets, so <code>A£[2,3]</code> referred to the sub-string of the string <code>A£</code> from the 2nd character to the 3rd character inclusive, so
<sourcesyntaxhighlight lang="basic">
10 LET A£ = "FOO"
20 PRINT A£[2,3]
</syntaxhighlight>
</source>
would print <code>OO</code>
 
This syntax was also supported on the left-hand side of an assignment, so
<sourcesyntaxhighlight lang="basic">
10 LET A£ = "FOO"
20 LET A£[2,2] = "BAR"
30 PRINT A£
</syntaxhighlight>
</source>
would print <code>FBARO</code>
 
Line 134 ⟶ 144:
 
Example:
<sourcesyntaxhighlight lang="basic">
10 DIM A(3,3)
20 MAT READ A
30 DATA 1,1,2,1,0,2,0,2,1
40 DIM B(3,3)
50 MAT READ B
60 DATA 0,0,1,0,1,0,1,0,0
70 DIM C(3,3),D(3,3)
80 MAT C=A*B
90 MAT D=INV(C)
100 MAT PRINT D,
</syntaxhighlight>
</source>
{|
|<code>A</code> is read from the first <code>DATA</code> statement
|<math>\begin{pmatrix}
1 & 1 & 2 \\
1 & 0 & 2 \\
0 & 2 & 1
\end{pmatrix}</math>
|-
|<code>B</code> is read from the second <code>DATA</code> statement
|<math>\begin{pmatrix}
0 & 0 & 1 \\
0 & 1 & 0 \\
1 & 0 & 0
\end{pmatrix}</math>
|-
|<code>C</code> is calculated by multiplying <code>A</code> and <code>B</code>
|<math>\begin{pmatrix}
2 & 1 & 1 \\
2 & 0 & 1 \\
1 & 2 & 0
\end{pmatrix}</math>
|-
|<code>D</code> is calculated as the inverse of <code>C</code>
|<math>\begin{pmatrix}
2 & 2 & 1 \\
1 & -1 & 0 \\
4 & -3 & -2
\end{pmatrix}</math>
|}
 
The output would be
2 2 1
1 -1 0
4 -3 -2
 
== Debugging ==
Line 187 ⟶ 197:
==References==
{{Reflist}}
{{Use dmy dates|date=January 2011}}
 
{{BASIC}}
 
{{DEFAULTSORT:Southampton Basic System}}
[[Category:ICL programming languages]]
[[Category:BASIC interpreters]]
[[Category:ICL programming languages]]
[[Category:Science and technology in Hampshire]]
[[Category:University of Southampton]]
[[Category:BASIC programming language family]]