Dartmouth Time-sharing System: BASIC

According to their 1985 book Back to BASIC, Kemeny and Kurtz had eight goals in mind when designing the language.

  1. It should be easy to learn for the beginner.
  2. It should be a general-purpose language, allowing the writing of any program.
  3. Advanced features had to be added so that, if there was a price, it would be paid by the expert, not the novice.
  4. It should take full advantage of the fact that the user could interact with the computer.
  5. It should give error messages that were clear and friendly to the user.
  6. It should give fast response for small programs.
  7. No understanding of the hardware should be necessary.
  8. It should shield the user from the operating system.

Let's take a look at the language in its first implementation on DTSS in 1964.

/images/dtss/basic-manual.png Detail from the cover of the original BASIC manual. Source: Bitsavers.

Dartmouth BASIC

There are only 15 keywords.

    LET       GOTO      RETURN 
    PRINT     IF        DEF    
    END       FOR       DIM    
    READ      NEXT      REM    
    DATA      GOSUB     STOP

All variables are floating point numbers, and variables names must be a single character or a single character followed by a single digit. You have to use the LET keyword to assign to variables.

PRINT can print numbers or strings enclosed in double quotes.

This early version could only write data back to the user running the program and was unable to take input from the the user. This was implemented two years later by adding the INPUT keyword and OS support. The emulator does support INPUT, but we'll be historically accurate by using the READ statement to take data from a DATA statement in the program.

GOTO allows jumps to any line number, GOSUB also jumps to the given line number, but when RETURN is reached it will transfer execution back to the line after the GOSUB.

Up to 26 functions, containing a single expression only like Fortran, can be defined with DEF.

The result of an IF statement can only be a line number which is jumped to if the expression is true.

Let's exercise BASIC by implementing the TPK algorithm.

TPK in BASIC

100 REM TPK ALGORITHM IN BASIC
110 
120 DEF FNT(X) = SQR(ABS(X)) + 5*X^3
130 
140 REM MAIN PROGRAM
150 DIM A(11)
160 LET N=11
170 REM READ NUMBERS FROM DATA
180 FOR I = 1 TO N
190 READ A(I)
200 NEXT I
210 PRINT "RESULTS ARE"
220 FOR J = 1 TO N
230 LET K = N - J + 1
240 LET R = FNT(A(K))
250 IF R > 400 THEN 280
260 PRINT R
270 GOTO 290
280 PRINT "TOO LARGE"
290 NEXT J
300 DATA 10, -1, 1, 2, 3, 4, 4.3, 4.305, 4.303, 4.302, 4.301
310 END

In line 120, we use ^ to raise X to the power of 3.

Arrays are zero indexed, but we use 1-11 for the array defined on line 150.

The READ on line 190 takes values in order from the DATA on line 300. You could substitute INPUT A(I) here to take input from the user.

Executing this on the emulator

  • See the quick tour on how to get the emulator running.
  • Download the source file from Github.
  • If you are not on Windows, ensure the file has CR/LF line endings. A simple way to do this:
awk 'sub("$", "\r")' < input_file > output_file
  • Store the file as TPK (no extension) in the same directory as DTSS.EXE.
  • Start DTSS.
  • Type OLD TPK.
  • Type LIST to confirm the source has been loaded.
  • Type RUN.

The results will look like this:

OLD TPK
RUN

TPK     18:55      JUN 23, 2025

RESULTS ARE
 399.886
TOO LARGE
TOO LARGE
TOO LARGE
  399.609
  322
  136.732
  41.4142
  6
-4
TOO LARGE


TIME 0. SECS

Further information

The DTSS emulator zip file contains A BASIC Outline.pdf. A 1964 introduction to the system and BASIC can be found on bitsavers.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


Dartmouth Time-sharing System: Architecture

As mentioned in the introduction, DTSS comprised of two computers, a GE-235 to run user programs and a DATANET-30 to talk to terminals and schedule tasks, both sharing a disk drive. Let's look at how this worked in more detail. This describes the system at around its launch in 1964; it was considerably expanded later.

/images/dtss/dtss-architecture-diagram.png

Architecture diagram from "DTSS: A Brief Description", Computation Center, Dartmouth College, 1964. Source: bitsavers.

User interface

The user interface was much like we saw in the emulator quick tourm with the addition of a HELLO command for the user to identify themselves via a numeric ID; there were no passwords.

The user can either be editing their program - indicated by a typing a number at the start of a line - or submitting commands such as LIST or RUN. The commands are not tied to BASIC, so you could use them if programming in ALGOL, for example.

The DATANET-30

The DATANET-30 was intended by GE to be a smart communication controller, capable of handling several terminal lines, buffering data and sending messages. It had 18-bit words and was relatively fast. It was interrupt driven and had a stored program facility which Dartmouth used to create an operating system. This was divided into real-time and spare-time tasks.

The real-time part was driven by an interrupt running 110 times per second. It would scan the lines for activity and store them in buffers. For commands, it would set up a job entry and store it in the spare-time queue.

The spare-time part ran every second and would examine its queue. Programs being developed would be sent to the disk. Command such as RUN would cause the DN-30 to send a message to the GE-235 to do the actual work of compiling and running the program.

The disk drive stored up to 16 million words of data and was connected to both the DN-30 and the GE-235.

The GE-235

The GE-235 was more powerful than the DN-30 for integer and floating point arithmetic. It had up to 16,000 words of core memory, each word having 20 data and 1 check bit.

During time-sharing, its operation was controlled by the DN-30. It held the compilers and execution services in memory. When it receives a message from the DN-30, it read the user program from the disk and starts compiling and executing it - so user programs were compiled every time they were run rather than saving object files. At run-time user programs had access to 6,000 words of memory.

As far as I can tell from the documentation, only one user program could be in memory at any time: the DN-30 could tell the GE-235 to write the contents of memory to disk in order to process another user program. The 1964 documentation states that the system was good at running a number of short jobs this way, but there could be waits of 5-10s for jobs to be executed. However, longer running jobs were not really suitable for this system.

Peripherals such as tapes and card readers were not used during time-sharing, but were used for system development purposes, presumably in a batch execution mode.

Further information

From bitsavers:

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


Dartmouth Time-sharing System: A quick tour using DTSS.EXE

In this post we'll look at how to get the Dartmouth Time-sharing System emulator DTSS up and running. As mentioned in the previous post, this is fairly limited in what it can do, but gives a flavour of what a user of the system in around 1964 would see.

/images/dtss/dtss-exe-simple-program.png

Running DTSS.EXE. Source: Rupert Lane. License: CC0.

Set up

Download the Windows zip file from the dtss.dartmouth.edu site and unpack it to a directory. Then just run the DTSS.EXE program to start; on non-Windows devices with Wine installed, run wine DTSS.EXE instead.

There are no user configurable options to adjust the simulator or interface.

Input should all be in upper case. Note that copy/paste does not work, usually bringing up an error message that ends the emulator. But there is a way to get programs in and out of the system - see below.

Entering a simple BASIC program

Type NEW HELLO to start a new program called HELLO. Then type the program lines including the starting line number.

10 FOR I = 1 TO 5
20 PRINT "HELLO, WORLD"
30 NEXT I
40 END

You can edit the program by retyping any lines. To delete a line, just type the line number and press Enter.

Type RUN to start the program and LIST to get a listing.

To save the program to disk, type SAVE.

You can then exit the emulator by typing BYE or just closing the window. When you come back, load your old program by typing OLD HELLO.

Program libraries

There are two libraries, a personal one and a system one. Type CAT to see your library: you will see your HELLO program along with a number of other demo programs.

To see what is in the system library, type OLD LIBCAT*** then LIST. To load one of these programs, for example FTBALL, type OLD FTBALL*** (note the *** at the end to denote a system program.

100 BASIC PROGRAMS
110 
120 AVELOG***   AVERAGE OF 100 LOGARITHMS
130 FTBALL***   DARTMOUTH FOOTBALL
140 GUESS***    GUESS A NUMBER FROM 1 TO 100
150 GCD***      GREATEST COMMON DIVISOR (GCD)
160 GCD3NO***   GCD OF THREE NUMBERS
170 MORT***     CALCULATES LIFE OF A MORTGAGE
180 NORMAL***   PLOT OF THE NORMAL CURVE
190 QUAD***     SOLVE A QUADRATIC EQUATION
200 PIE***      APPROXIMATE PIE

Getting data in and out

Programs are stored on the host file system as plain text files, with your library in the same dierctory as the executable, and the system library under LIB/. So to see the text of your HELLO program, look for the file named HELLO without an extension.

You can view, edit and create new files outside of the emulator using this method. Remember to save files in DOS format, ie with CR/LF at the end of each line.

Other features

The SPEED command will adjust the speed of the emulator: SPEED 10 is approximately the speed of the original system.

You can switch from BASIC to ALGOL with SYSTEM ALGOL.

There is a computer aided learning system called TEACH available also.

Further information

The DTSS emulator zip file contains three useful documents.

  • Commands.pdf
  • A BASIC Outline.pdf
  • An Algol Outline.pdf

A 1964 introduction to the system and BASIC can be found on bitsavers.

We'll look at BASIC and ALGOL in more detail in upcoming posts.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


Dartmouth Time-sharing System

DTSS, the Dartmouth Time-sharing System, was developed at the eponymous New England college in 1963/4. Running on a pair of GE computers, it achieved campus-wide access to computing and was the origin of the BASIC language.

/images/dtss/dtss.jpg

Captures from "Educating the Computer", a 1969 video by GE. Source: Youtube.

Dartmouth had experimented with several smaller computers from the late 1950s but wanted to extend this to all students and faculty. This had two immediate issues - batch processing was not viable for a large number of inexperienced users, and existing high level languages like Fortran or Algol were too complex.

Professors John Kemeny and Thomas Kurtz decided to solve the first problem by building a time-sharing system (famously after Kurtz had talked to John McCarthy at MIT, who suggested "why don't you guys do time-sharing?"). They got funds from the NSF and evaluated several computers, eventually settling on a large GE-225 computer together with a GE DATANET-30 communication controller. Their plan was to build a real time user facing operating system on the D-30 that would talk to user teletype terminals, and would then send work to the GE-225 for compilation and execution. Disks drives were shared between both computers. This combination of systems looked to the end user like a single time-sharing system.

To solve the language issue, they invented the BASIC programming language specifically for people new to programming: with a small number of keywords it was ideal for developing programs of 10-100 lines. Over time, the system would also run other languages but BASIC was the most popular.

All the software for both computers had to be written in house - they enlisted several undergraduates to help, writing code on paper before the machine arrived. The system went into service for the fall term of 1964. The GE-225 was soon replaced with a more powerful GE-235.

It met their goals, with the system being able to serve tens and later hundreds of users at the same time. Terminals were installed throughout the college and the surrounding area, including many high schools. A library of programs developed by people in different faculties was built up, including many games.

A second version of DTSS came along in 1969 that extended its capacity and added more features; copies were was installed at at least 10 external sites, and became the basis of several commercial time-sharing services. BASIC went on to be used on many mini- and micro-computer systems, and still has users today in products like Visual BASIC.

The Wikipedia article and its references are a good way to find out more on the history of DTSS.

Preservation status

There are code listings for the GE-235 and D-30 executives along with BASIC and ALGOL compilers from about 1965 available on dtss.dartmouth.edu, but sadly later versions of DTSS or the libraries of user code have not been found.

Bitsavers has manuals from Dartmouth for DTSS/BASIC/ALGOL and from Honeywell for the hardware.

Lars Brinkhoff has collected known DTSS material, including all the above, at Github.

Emulation status

A group of people from Dartmouth, including Thomas Kurtz, came together in the early 2000s to scan the listings, create an assembler and build a simulator (written in True BASIC). This only simulates the GE-235 part of the system, so is not multi-user, but can run BASIC and ALGOL code. Only 32 bit Windows and classic Mac binaries are available, however the former runs fine under Wine.

There was also a web based emulator of the GE-235 and D-30 running similar era code but including the multi-user executive. Although the website is still online, as of 2025 logins no longer works and I have not been able to find a contact address for the owners.

We will use the Windows emulator dtss.exe to explore DTSS further.

Questions, corrections, comments

June 2025: correct name for Dartmouth College, clarified use of GE-225 vs 235.

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.



Next →