# HP 2640

The HP 2640A and other HP 264X models were block-mode "smart" and intelligent ASCII standard serial terminals produced by Hewlett-Packard using the Intel 8008 and 8080 microprocessors.

## History

The HP 2640A was introduced in November 1974 at a list price of US$3000. Based on the Intel 8008 CPU, it had 8 KB of ROM firmware and came standard with 1 KB of RAM, expandable up to 8 KB (two 4 KB semiconductor RAM cards). In September 1975 Hewlett-Packard introduced the HP 2644A, which was an HP 2640A with mass storage (two mini-tape cartridges, 110 KB each), for US$5000. HP followed up in 1976 with the 2640B, an updated, cost-reduced version of the 2640A with a list price of US$2600, along with three international versions: the Cyrillic-oriented 2640C, the Swedish/Finnish-oriented 2640S, and the Danish/Norwegian-oriented 2640N. All of these early members of the 2640 series had the relatively slow 8008 CPU running at 700 kHz, and they were thus limited to speeds of 2400 baud. The 2640A and 2644A were discontinued in February 1977, but the 2640B remained in production until August 1981.
In September 1976, HP introduced the 2645A, which could handle speeds up to 9600 baud and had a number of advanced features, including as an option the mini-tape cartridge storage of the 2644A. The introductory list price was US$3500, or US$5100 with the cartridge storage option. The 2645A was the first terminal in the 2640 series to use the Intel 8080A, rather than the 8008, as its CPU. Almost all subsequent 2640-family terminals would have 8080A CPUs, all running at 2.5 MHz. The 2645A was followed in November 1976 by the 2641A, a 2645A derivative designed for the APL programming language, and in April 1977 by the 2645R, a 2645 which supported right-to-left Arabic text as well as left-to-right text in Roman letters. In July 1977, Hewlett-Packard introduced the 2648A graphics terminal, a 2645A derivative which added 720×360 black-and-white raster graphics in a separate graphics page that could overlay the main text memory. This was joined in May 1978 by the 2647A programmable graphics terminal, which included its own BASIC interpreter. In October 1980, HP introduced the 2642A, which was like the 2645A, but instead of optional tape cartridges it had a standard 5.25-inch floppy disk drive storing 270 KB per diskette. The ultimate and final model in the 2640 series was the 2647F programmable graphics terminal introduced in June 1982, an improved replacement for the 2647A with the 2642A's floppy drive. Unlike the preceding terminals in the 264X family that had 8080A CPUs, the 2647F used the faster Intel 8085A running at 4.9 MHz. HP kept the 264X family in production until early 1985.

## Model number

The HP catalogs usually refer to the terminal model as simply "2640A", and infrequently as "HP 2640", or "HP 2640A" (both with a blank after the "HP"), or "2640". The incorrect "HP2640" and "HP2640A" are often seen outside of HP.

## Functionality

The functionality defined by the HP 264X series hasn't changed much as the preferred terminal for HP1000 and HP 3000 series computers. They never achieved the fame of the VT100 among programmers but included sophisticated features not found in the VT100, such as offline forms, multipages, and (in some models) local storage.
The styling looked vaguely like a microwave or toaster oven. It was boxy, with a "widescreen" aspect ratio because it gave the same character length as a punched card. This is still seen in the modern command window. HP had determined that the combination of a standard 4:3 aspect ratio with the 25-line by 80-character display that was the standard of the time required the characters to have a very high profile. HP's response was to specify a cathode-ray tube with an aspect ratio designed around the desired character shape instead of the other way around. Of course, this also mandated rather high manufacturing costs as standard parts could not be used.
HP took pains to further improve the rendering of displayed characters via half-pixel positioning of individual lines within each character. Although the character cell was only 7 horizontal by 9 vertical dots, half-pixel positioning effectively doubled the horizontal resolution to 14 dots, giving the characters very smooth outlines. (The initial sales literature referred to it as using a 7×9 matrix generated in a 9×15 dot character cell).
All of this resulted in an extremely easy-to-read display with the dot-matrix nature, and the scan lines, almost invisible.
The keyboard had flat tops, similar to the HP 9800 series desktop computers rather than the curved contours now considered to be ergonomic. It featured three keypad areas: Alphabetic, numeric, and an array of cursor positioning and editing keys somewhat similar to modern PC keyboard layouts. There were also a number of smaller function and feature control keys arrayed in two rows above the normal keypad areas. The keyboard chassis was separate from the main body, connected via a thick cable. The keyboard used a bit-paired layout (similar to that on a teleprinter machine) rather than the typewriter-paired arrangement on DEC's VT100. Although large, users loved the keyboard because "it had a key for everything".
Similar to the HP desktop computers, it had a number of F-keys (F1 through F8) placed close to the screen. Paper templates were available for some application programs to which placed legends for these keys on the keyboard. Later models arranged these across the top row, and provided for screen labels close to their respective keys. Terminal configuration in the 262X series was done entirely through the screen-labeled function keys rather than dedicated keys and through escape sequences sent from the host computer. The on-screen labeling of the eight function keys, pioneered by the HP 300 ("Amigo") computer, was one of the first applications of a hierarchical menu which allows accessing many functions with a small number of keys. This arrangement is now common on TI graphic calculators, and automated teller and gas pump machines, though no longer used in GUI user interfaces.
Internally, the electronics used a motherboard with plug-in daughter cards. The microprocessor, memory, serial interface card, and various optional functions were each on separate cards. This permitted easy field maintenance, upgrades, and reconfiguration. For example, more memory (providing larger scrollback capability) could be easily added, the serial interface could be changed from RS-232 to current loop, etc. The optional tape drives of the 2645 model were interfaced via another plug-in card. The plug-in card capability strongly resembled the later Apple II expansion architecture.
The manufacturing area was across from R&D cubicles in the Data Terminals Division in Cupertino. The testing area was dubbed "beepland" because it had racks of 500 terminals, with the end of the test ending in a beep.
The HP 2640 introduced "block mode", similar to the IBM 3270 (although the IBM 3270 did not work for ASCII standard serial communications). The escape sequences Esc-[ and Esc-] defined unprotected areas, but it didn't have to take up a visible space. It acted much like a web page, disconnected from the host until the SEND key was pressed. The fields could screen for alphabetic or numeric characters, a feature beyond Windows Forms today. This would be supported by programs such as DEL/3000 and VIEW/3000 which would map form data into runtime variables and databases. It also supported teletype character mode like a standard ASCII terminal, and did not need specialized communications like IBM.
The hardware was radically different from most "dumb" terminals in that the characters were not stored in a simple data array. To save memory, which could extend over several pages, characters were allocated as linked lists of blocks which were dynamically allocated. Display enhancements were encoded as embedded bytes in the stream. Software enhancements which did not affect the appearance such as dim or underline, but protected and unprotected fields were also coded with embedded bytes. The display hardware was capable of reading this unusual data structure. When the cost of memory came down by the 262X series, this was changed to a "parallel" structure with one bit for each enhancement code, but the logic required to emulate previous behaviors was complex. Inserting a code for underline would "propagate" to the next display enhancement, while deleting such a code would also have to be propagated to the next display byte or a cursor jump sequence was issued to jump several bytes. You could also completely turn off enhancements as well as provide protected only field enhancements. This data structure would inspire the sparse matrix data structure for the Twin spreadsheet.
The HP 2640 also introduced multiple pages of memory, much like the DOS box in Microsoft Windows today, and the page up and page down key which appears on PC keyboards.
Users learned to use the offline key to take the terminal offline, edit a line in the display buffer, and then retransmit it. This gave the effect of command line recall and editing even if the operating system did not support it. For example, when working at an operating system's command prompt, an erroneous command could quickly be corrected and re-sent without having to retype the entire line. This was possible in many terminals of the day, but the HP 2640 was smart enough to only retransmit the line from the first character typed by the user, omitting, for example, the operating system's command prompt. This was later implemented as "line mode". Another method was to paint a formatted screen in character mode with protected fields and place it into local edit mode similar to the above but the user did not know. This meant that the characters entered by the user would not be transmitted to the host until a 'special' key, typically the enter key, but other keys were also deemed special (i.e. immediate interrupt of the host) such as control y and function keys. Only the data within the unprotected areas would be transferred in this way, using a semi block mode mechanism, a sort of half way house between block mode and normal character mode, Formatted fields also meant forms could be stored in memory ( tested for and recalled locally or repainted from the host if not present), just the unprotected data areas need be sent, thereby removing the need to repaint or issue direct cursor placements in order to update the screen (TIM/3000 Air Call Computer Systems). The PCL language was PCL level 3 in an HP645/7, which was later implemented to drive Hewlett Packard's first Laserjet printer.
HP Printer Control Language shares a common non-ANSI escape sequence grammar and common sequences with HP terminals.
In-house developers ported TinyBASIC to the HP 2645A, as well as developing several games in assembler (most notably "Keep On Drivin'", Tennis and Reversi).
Plotters could also be interfaced to using HP/GL 2 with TinyBasic.

## Models

The HP 264X series included several models beyond the HP 2640A.
* The HP2644A introduced 3M mini cartridge tape drives which could be used to upload or download data, as opposed to slow paper tapes of the time. Another later model used floppy disks, and supported drawing forms etch-a-sketch style and would compute intersections. Also notable was the use of paper labeled function keys on the upper left. These would always get lost, so users would scroll lock the top 2 lines of the screen and used these for labels. These were built into the next generation of terminals. The values of these keys could be programmed.
* The HP 2648 was a graphics terminal which featured hardware zoom, and "autoplot". It utilized separate memory for graphics and text, allowing the user to turn off either type of display at will.
* The HP 2647 had a variant of Microsoft BASIC with AGL (HP's standard for plotting) built in, and perhaps the first real business charting for a microcomputer, complete with 3D cross-hatched pie charts.
** 02647-13301 Graphics: 2647 Multiplot and Slide Software. Multiplot was the model for the PC based Chartman by the Cambridge company that also produced the Twin spreadsheet 1-2-3 clone which introduced HP 2640 style forms to PC applications.
** 13257B Graphics: 2647 Graphics Presentation Resource Pac
** 13257D Statistics/Mathematics: 2647 Statistical Analysis Resource Pac
** 13257C Statistics/Mathematics: 2647 Mathematics Analysis Resources Pac
** 13257F Business: 2647: Project Management Analysis Resource Pac
** 13257K General/Utilities: 2647 2647/1351 Basic
* The HP262X series introduced the "periscope" look, "soft" key labels along with a 4 + 4 key display at the bottom of the screen, a hierarchical setup tree, 12" screen and an optional internal thermal printer. The HP-125 45500A Dual Z80 CP/M used the form factor and terminal emulation of the HP 2621 terminal. The HP-150 had the terminal capabilities of the HP 2623 graphics terminal in a smaller package (9" screen).
* The HP2382 "munchkin" repackaged the HP 2622 in a 9" screen package. The HP-120 45600A packaged the HP-125 into the HP2382 form factor.
* The "Therminal" was an unusual implementation of a screen-less printing terminal which used the thermal print mechanism. It was one of the first projects of the Vancouver division. It even supported tape cartridge local storage, but it was not successful.
The great over-reach was a color graphics terminal that cost more than the HP 2647 monochrome graphics workstation that sold very few units but cost a huge effort to develop.
Eventually, HP ended up selling essentially a low-cost version of the HP 2640. Today, terminal emulators still implement the late 1970s feature set of these terminals on common PCs.
See also List of HP 26xx terminals (introduction, price, discontinuation)