HP Time-Shared BASIC (HP TSB) 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. The system implements a dialect of BASIC as well as a rudimentary user account and program library that allows multiple people to use the system at once. The systems were a major force in the early-to-mid 1970s and generated a large number of programs. HP maintained a database of contributed-programs and customers could order them on punched tape for a nominal fee. Most BASICs of the 1970s trace their history to the original Dartmouth BASIC of the 1960s, but early versions of Dartmouth did not handle string variables or offer string manipulation features. Vendors added their own solutions; HP used a system similar to Fortran and other languages with array slicing, while DEC later introduced the MID/LEFT/RIGHT functions. As microcomputers began to enter the market in the mid-1970s, many new BASICs appeared that based their parsers on DEC's or HP's syntax. Altair BASIC, the original version of what became Microsoft BASIC, was patterned on DEC's BASIC-PLUS. Others, including Apple's Integer BASIC, Atari BASIC, and North Star BASIC were patterned on the HP style. This made conversions between these platforms somewhat difficult if string handling was encountered.
Nomenclature The software was also known by its versioned name, tied to the hardware version on which it ran, such as HP 2000C Time-Shared BASIC and the operating system came in different varieties — 2000A, 2000B, 2000C, High-Speed 2000C, 2000E, and 2000F. HP also referred to the language as "Access BASIC" in some publications. This matched the naming of the machines on which it ran, known as the "2000/Access" in some publications. This terminology appears to have been used only briefly when the platform was first launched.
Platform details Except for the 2000A and 2000E systems, the system is implemented using a dual-processor architecture. One fully configured HP 2100-series processor is used for the execution of most of the system code and all of the user code, while a second, smaller HP 2100-series processor is used to handle the RS-232 serial lines through which the time-sharing users connected. Depending on the hardware configuration, the system supports up to 16 or up to 32 simultaneous remote users. The usual terminal for a TSB system was a Teletype Model 33 ASR and connected directly to the I/O processor or through a modem or acoustic coupler. Account names are a combination of one alphabetic character, followed by three decimal digits, e.g., B001. Privileged accounts started with the letter "A" and had some additional command and program storage capabilities. The superuser account is A000. This scheme allows up to 26,000 user accounts. During execution, user programs are swapped to a fixed-head drive — physically a disk, but operating like a magnetic drum. When not executing, user programs are stored on moving-head cartridge- or pack-loaded disk storage. Privileged users can also store programs on the much-faster drum. The hard drive was backed up to magnetic tape. Program names and file names consist of up to six alphabetic characters. Legal characters are A-Z, 0-9, and !"#%&'()+-./:;<=>?@[\]. (No * or $, no lowercase a-z, no {|}`~.) The editor holds programs in a tokenized format, and stores them to disk using the SAVE command or the CSAVE command. The system "semi-compiles" the program before executing (RUN) and decompiles it before LISTing, EDITing, RENUMbering, or APPENDing. "Semi-compilation" replaces every line number in every statement with an absolute address, for faster execution, and appends a table of line numbers after the program to allow "semi-compilation" to be undone when needed. SAVE stores the uncompiled program to disk. After loading a large SAVEd program, listing or editing starts instantly, but RUNning the program incurs a pause for semi-compilation. CSAVE stores the slightly larger semi-compiled program to disk. After loading a large CSAVEd program, RUNning the program starts instantly, but LISTing or EDITing incurs a pause for "decompilation" before commencing. In this HP BASIC-only environment, programs cannot READ characters or lines from files, only native numbers and entire strings (almost identically to READing from DATA statements). HP TSB stores no line endings in its tokenized BASIC data files (nor in its tokenized BASIC program files). BASIC programs can neither read nor write a program file; crossing over can only be accomplished by punching a tape and then reading it back in, but that is neither necessary nor useful.
Syntax The language is a fairly standard implementation of BASIC, providing an integrated editing and runtime environment. Statements are analyzed for correct syntax as they are entered and then stored in tokenized form. Each BASIC statement must be on a uniquely numbered line, e.g.
Line numbers are mandatory, and statements are automatically placed in ascending numeric sequence. TSB lines can contain one statement; chaining multiple statements with the colon as in MS BASIC is not supported. Multiple variable assignments are allowed, e.g., 20 LET A=B=C=42. As in most versions of BASIC, use of the word "LET" was optional. In the earliest version (2000A), the language supported the following features. Later versions added many more features.
… excerpt ends here. Continue reading the full article.