|
One of the software products Hewlett-Packard produced for the early 211x series machines was a single-user BASIC interpreter. Around 2010 a version of the assembly source, dating from 1970, for the interpreter and associated configuration program became available on bitsavers. This was thanks to Guy Sotomayor who had kept it around since high school in 1971.
This article descibes the requirements and process to get the HPBASIC interpreter to run on a 211x-series processor, starting if necessary from the original HP assembler source.
BASIC was originally (1964) developed on and targetted for multi-user time-shared systems. The early home computer market of the late-1970s to 1980s would largely be characterised by boot-to-BASIC machines: small machines with a BASIC interpreter in ROM which at power-on would immediately boot that interpreter and present BASIC ready to use, machines such as the Apple II, Commodore PET, TRS-80, etc.
Between the large time-shared systems and the small boot-to-BASIC machine, a few waypoint developments can be identified. The earliest (known to this author) instance of a ROM-based BASIC machine is the HP-9830 (1972), followed by the Wang 2200 (1973) and IBM 5100 (1975). Single-user HP BASIC is an even earlier waypoint.
The available assembler source for Single-user HP BASIC is dated January 1970. An HP computer products brochure from June 1968 lists an "interpretative compiler" for BASIC, "operable in 8K" - this being distinct from the HP2000 Timeshared BASIC system for the 2116, also available by 1968.
Single-user HP BASIC could be used as a stand-alone system - it did not require the presence of an OS or executive, nor did it have to sequentially overlay or reload segments of the system to accomplish functionality. Once an HP BASIC system was in core, it was a stand-alone system requiring only the computer and teletype/console for entry and execution of BASIC programs. Combining this stand-alone ability with the non-volatility of core memory, it is possible to have the BASIC "READY" prompt in 2 seconds (3 button-pushes) from power-on of the computer. An HP-2116 with HP BASIC in 1968 may have been the first "boot-to-BASIC" system, though not quite boot-to-BASIC-at-power-on.
Contents (this page): | Sub-pages: |
Resources:
|
External:
|
8KW minimum of memory is required. For an 8KW system using the bufferred I/O option, there will be ~ 2.1KW available for the user program and runtime needs.
In a modern context a console teletype may be simulated with an async serial-line communication program running on some host machine. Such a setup will be referred to here as the console-host. The interpreter usually outputs the 8th bit set 1, so the receiving console-host needs the ability to ignore it. SCOMM is a recommendation for such a program, providing for both text-based console operation and text or binary-transparent transfer of files.
In the modern context, loading and saving files via a console-host as simulated paper-tape reader and punch is the simple solution.
As software, an HPBASIC System is comprised of two program elements:
An I/O Package is produced by running the configuration program PBS (Prepare BASIC System) on the period HP machine. PBS contains template device drivers and produces an I/O Package based on input responses when it is run.
The full workflow starting from assembler source to a running HPBASIC System is shown in the following diagram:
This process can be entered from several starting points depending on the initial availability of the internally-generated resources.
If HPBASIC is loaded at step 2.2b, before PBS is run, PBS will produce an absolute tape with both the configured I/O package and the HPBASIC interpreter, thus a single boot tape. Otherwise, the output from PBS will contain only the configured I/O package and loading the complete HPBASIC System is two steps: loading the I/O package (step 3.1a) and loading the interpreter (step 3.1b). In either case, HPBASIC must be loaded after it's compatriot as it intentionally overwrites some memory locations.
Also, if HPBASIC was loaded, after running PBS it is permissible to skip step 7 and run the now-configured BASIC system directly from core. Note though, that to do so one must not allow PBS to dump (punch) the configured system. Apparently PBS corrupts the in-core system in the course of dumping it, attempting to run the in-core system after dumping will result in BASIC responding with "ERROR IN LINE " to all input.
The Memory Map presents more details about the program elements and their organisation in core.
PBS obtains configuration information from both the front panel Sense switches and from queries via the console.
PBS provides a configuration option for "buffered" or "serial" TTY driver. This does not refer to a line or multi-character buffer in memory, or a serial versus parallel interface. It refers to which of the HP serial I/O interfaces is present in the processor for communication with the TTY/console:
When run, PBS performs the following sequence of activities:
HPBASIC is essentially adherent to the original BASIC, it does not have common alterations and extensions present in later BASICs; for example, "LET" is mandatory in assignments. Some limitations are:
There are two non-standard extensions present in HPBASIC:
User commands are limited to:
Input-line editing is also limited:
For the modern context of a simulated teletype or paper-tape reader, this flow control requirement can present a difficulty - even low bit rates (150 or even lower) and two stop bits is insufficient in providing enough time for line processing. Adding nulls after the EOL is not adequate due to the way the 12531B/C/D interfaces work - when the interpeter starts a read part way into transmission of a null character a bad character may be read, as the 12531 is not edge-triggered on the start bit. Explicit time delays after EOL, unless longer than may be desirable, may not work with USB-serial interfaces due to bufferring in the interface. If the console simulator supports hardware flow-control the READ-COMMAND signal from the 12531 might be adapted to RS-232 levels to provide flow-control.
The interpreter however, does provide an opportunity for character-oriented flow control.
During normally typed input, the interpreter starts processing an input line after receiving the CR from the console,
but does not output the echo LF until after completing that processing.
SCOMM again, provides a facility to support this character stop-start control of transmission, via the sflow
command.
This is not a perfect soultion however, in that if there is an error in the source code, the consequent returned error message will confuse and may hang SCOMM.
Note: When using this method, do not use the interpreter TAPE
command, it does not echo an LF, simply let the console-host transmit to the interpreter at the 'prompt' level.
[See: "Pocket Guide to HP Computers", page BASIC A-1].
LIST
command while redirecting the output at the console to a file.
A line with "READY" will unfortunately be appended at the end of the file, this should be removed to avoid an error message on reloading.
See Restarting Example.
A few programs compatible with HPBASIC in 8KW.
Memory Map
| Operation Examples
HP BASIC CTµL | 2116 | I/O Interfaces | Programming Ref | Software | 2116C Refurb HP 21xx Series |
bhilpert 2014 Sep 2025 May |