The answer to a research fellows dream could be the 85, read on to find out why!
By Henry Budgett
After my first tentative mutterings on the HP micro a couple of months ago it became clear that it was not going to be an overnight job to finish the thing off, so at long last, here is the remainder of the story. To briefly recap for those of you who missed the April issue the HP-85 is a personal, desktop microcomputer for professionals in both research and industry.
What, you may ask, is it doing between the pages of a “hobby” magazine? Well, quite apart from general interest – how did he get in here – it does represent the direction that personal computing is moving in.
The Heart of The Matter
We carefully took the lid off the box and… Figure 1 reveals the naked truth about where your money went. What you are paying for, is research and development of a large number of custom designed ICs which perform all the boring tasks usually allotted to a board full of humble TTL. They even decided to make their own eight-bit CPU, a decision that some people seem unhappy about. The overall result of this little piece of high tech is a professional unit, designed to last a lifetime and be very reliable.
Figure 1. The CPU board laid bare!
For those of you with sharp eyes the lack of solder masking on the board is due to the fact that this is a demo model, HP even warned us about the possibility of damp causing memory problems! Never fear, your shop bought model will be masked and you won’t need to keep it warm at night.
One word will suffice, superb. I detect a note of suspicion but you really can’t find fault with the supplied material. Every facet of operation of the machine is covered in copious detail and the sections on programming are thorough to a fault. Software security is obviously not a worry to HP as they list all the programs in their Standard Pac along with other details, saving you the trouble of folding up all that printout. Presumably they thought that any dedicated person could break down the security codes and saved you the problem. Whilst on the subject of programs it is worth noting that many of the answers to set problems are well worth saving.
Purists will say, and several have already, that no details of machine code are given. Although this is quite correct it hardly matters. At the moment I understand that some details of the assembly language are to be published in the HP newsletter for users, and that they are working on a variety of ROM Pacs. Since the ROM Pacs contain machine code and they are being supplied by HP a lot of effort can be saved.
Of Numbers and Things
Many of you will have read of such things as Tiny BASIC and Integer BASIC and understand that they denote the number handling capabilities of the language. You could say the HP has a Fuller-than-most Scientific BASIC! This very impressive hunk of language sits somewhere within the top 24K and does quite a lot that others cannot do. The number handling capability is a variable in that you can specify one of three ranges. These are INTEGER which gives you -99999 to +99999, SHORT which offers -9.9999 10^-99 to 9.9999 10^99 or the default option of REAL which offers a massive -9.99999999999 10^-499 to 9.99999999999 10^499. It makes good sense to specify those variables which only need to be of INTEGER and SHORT values as this saves an appreciable amount of memory. See Table 1.
All the usual mathematical functions are available with this version of BASIC, as are quite a few that you may not be so familiar with. A summary of the predefined functions is in Table 2.
The advantages of the HP cartridge system over the usual cassette are both many and varied. The system, as I mentioned in the earlier report, uses a similar storage format to that of a soft sectored floppy disc. This results in both faster and more flexible access to the stored information. On machines such as the PET which use cassette, the main bulk of time is spent searching the tape to find the correct header. On the HP tape there is a directory, called CAT, and the program is first located in this – which gives its position on the tape – and the machine can then spool off to this absolute location, much quicker.
When you wish to save a program you merely have to hit the key labelled STORE and then type the name of your file in quotes, “FRED”. The system then checks to see if you are allowing write actions to the tape – there is a hardware tab that can be set – and that’s all. Recall of a program is the reverse using the LOAD key, except that there is no read protection. (See Fig.2 for key layout).
Figure 2. A key for every job and every job has a key
All the usual PRINT# and READ# commands are available for data files. The operating system allows up to ten data files to be set up and used simultaneously during a program run. This unusual offering is performed by using buffers that only write to the tape when they are full.
Two methods of securing data are available. The first is the hardware tab that I mentioned a little earlier; the second is a set of commands that give up to four levels of protection on both program and data files. Mechanical details of the tape system are given in Table 3 and security levels are shown in Table 4.
The most powerful of all the commands associated with the tape system must be CHAIN which allows one program to load and execute other programs, and if properly set up you can actually share or exchange variables between these programs.
Both DISP and PRINT output statements can be made to conform to a predetermined format by using an IMAGE statement. Table 5 reveals the symbols that can be used but suffice to say that the range and flexibility is superb. For an actual example of their use in a program, the Multiplication example in the April issue used a formatted output on both screen and printer. Whilst on the subject it should be noted that if you can’t remember to change your usual PRINTS to DISPs when loading a program in you can swop the roles in the machine by saying CRT IS 2 @ PRINTER IS 1. This is actually executable as a BASIC command so you can swop around within the running of your program. If you wanted to have everything printed out, a diagnostic run for example, you can simply say PRINT ALL, and it does!
Although functions such as STEP are provided on the keyboard, along with PAUSE and CONT, the HP also offers three TRACE functions. These can be programmed in to work on a certain section of code or executed from the keyboard to operate on the whole program, all information is printed. Between them they allow you to follow variables or program lines and really do make debugging a doddle.
Also worthy of note within this section on diagnostics is that the HP has a built-in test sequence initiated by keying TEST, which checks out all internals and prints out the character set with underlining. Why with underlining? Simple, the underline character occupies the top bit so this tests all the bits and not just the lower seven of the printer.
They say that a picture can be worth a thousand words and if that’s true then the 85 must rate as quite an author. The power unleashed by just sixteen commands, see Table 6, is quite amazing. The flexibility is based around the system capability to address any of the available 49,152 dots on the screen which are arranged on a 256 by 192 grid. To compensate for the non-square nature of the screen it is possible to scale the X and Y axes independently. The maximum scale allowed is 100 by 100 but if you try to draw circles in the centre without correcting for the shape of the screen you tend to get ovals! The scaling factor is X-4/3 Y and it is not the nuisance that it might at first appear.
Having grasped the concepts of scaling things the manual leads you on into a vast array of powerful commands that take a little bit of time to come to terms with. For example you can draw a scale on your axes with ‘tics’ at determined intervals with a single command such as XAXIS0,1. This gives the X,Y intercept a value of (0) on the X scale and puts tics at every interval on the predefined scale.
After scales and axes you begin to get a hankering to actually draw something, and here you find that the machine acts rather like a pen and paper. What you do is to specify the colour of your ink and that of the paper. This is done by PEN and PENUP commands. To move the PEN around you can DRAWx,y or PLOTx,y or MOVEx,y where the x and y are real co-ordinates on your screen. By adding a prefix of I to the MOVE and DRAW commands you specify incremental operation rather than absolute. Labelling your graphs is performed by the rather unusual command, LABEL and, as if that wasn’t obvious enough, the orientation of the aforesaid label is controlled by LDIRn – where n is the ‘angle’ of the label.
By this stage of the game you have produced a screen full of straight lines and labels but what about curves? Well you can’t draw curves as curves, you have to draw lots of little straight lines that make up a curve. If you make the lines short enough the curves are very good indeed. All the above graphic capability is easily mastered and is quite sufficient for most purposes, what comes next is not quite so easy.
It is possible to define a shape by character codes and plot these using strings. What you have to do is to draw the shape of your required ‘object’ on graph paper, the object now reduces to patterns of dots – each segment being one dot. In summary, the graphics are extremely powerful and flexible, you don’t have access to pretty little spaceships and men but you do have the facility to produce them if you want, you can store them as data files even!
Now, divide up the result into bytes and convert the binary value to decimal. All, all?, you have to do is to output the resulting string of characters using BPLOT. Figure 3 shows a triangle reduced to a string and the command BPLOT T$,1 where T$ is the string we are using. At this point I graciously admitted defeat and went onto something else. I’m quite sure that practice and careful study will make this function ‘child’s play’ but trying to implement the functions in a crowded office is not the best idea.
Figure 3. Coding up for a character plot.
This section of any computer review is supposed to list a vast selection of esoteric goodies that you can hang on to the machine, not so this time. All that is currently available is a 16K RAM expansion and a ROM drawer. There will be floppy discs and a range of ‘Capricorn to others’ bus converters to allow connection of IEEE devices etc. It is unlikely that any special equipment will be developed as the expected use fits in with all the existing HP laboratory equipment – including atomic clocks – and most of the software merely needs to be converted from the minis.
Neat uncluttered rear panel, with the Capricorn slots at the right.
Having crept out of a research laboratory not so very long ago I can appreciate this as one of the machines that I would want on my bench (next to the PDP 8, but that’s another story). My only regret is that it is expensive, a lower price would have meant volume sales and perhaps they are not geared up for that yet, we can only hope for a reduction in the next year.
The system is a true personal computer, not a machine for playing with, and as such represents the first of a new breed that will emerge over the next few years – serious machines for serious purposes. If HP ever feel generous I would love to have it back, permanently!
We are indebted to Hewlett Packard of King Street Lane, Winnersh, Wokingham, Berkshire for the loan of the machine for a very generous period.
|Table 1. How the HP uses variables and arrays, and what they cost in terms of memory.|
|Precision||Accuracy||Range||Maximum Array Size (standard memory, no program)|
|INTEGER||5 Digits||-99999 through 99999||4800|
|Simple Variables||Bytes of Memory|
|Full precision||10 bytes|
|Short precision||6 bytes|
|String||8 bytes + 1 byte per character|
|Full precision||8 bytes + 8 bytes per element|
|Short precision||8 bytes + 4 bytes per element|
|Integer||8 bytes + 3 bytes per element|
|Table 2. Pre-defined Basic functions that leave a little to be desired|
|ABS(X)||Absolute value of X|
|ACS(X)||Arccosine of X, in 1st or 2nd quadrant|
|ASN(X)||Arcsine of X, in 1st or 4th quadrant|
|ATN(X)||Arctangent of X, in 1st or 4th quadrant|
|ATN2(Y,X)||Arctangent of Y/X, in proper quadrant|
|CEIL(X)||Smallest integer >=X|
|CHR$(X)||Character whose decimal character code is X.0<=X<=255|
|COS(X)||Cosine of X|
|COT(X)||Cotangent of X|
|SCS(X)||Cosecant of X|
|DATE||Julian date in format yydd (assumes system timer has been properly set)|
|DTR(X)||Degree to radian conversion|
|EPS||Smallest machine number (1E-499)|
|ERRL||Line number of latest error|
|ERRN||Number of latest error|
|FLOOR(X)||Same as INT(X) (relates to CEIL)|
|FP(X)||Fractional part of X|
|INF||Largest machine number (9.99999999999E499)|
|INT(X)||Largest integer <=X|
|IP(X)||Integer part ox X|
|LEN(S$)||Length of string S$|
|LGT(X)||Log to base 10 of X, X>0|
|LOG(X)||Natural logarithm, X>0|
|MAX(X,Y)||If X>Y then X, else Y|
|NUM(S$)||Decimal character code of first character of S$|
|POS(S1$, S2$)||Searches string S1$ for the first occurrence of string S2$. Returns starting index if found, otherwise returns 0|
|RMD(X,Y)||Remainder of X/Y: X-Y * IP(X/Y)|
|RND||Next number, X, in sequence of pseudo-random numbers, 0<=X<1|
|RTD(X)||Radian to degree conversion|
|SEC(X0||Secant of X|
|SGN(X)||The sign of X: -1 if X<0, 0 if X=0 and +1 if X>0|
|SQR(X)||Positive square root of X|
|TAB(N)||Skips to specified column|
|TAN(X)||Tangent of X|
|TIME||Time in seconds since midnight (assumed system timer has been set properly) or since power on.|
|UPC$(S$)||Converts all lower-case alphabetic characters in S$ to upper-case|
|VAL(S$)||Returns the numeric equivalent of the string S$|
|VAL$(X)||String equivalent of X|
|Table 3. Mechanical details about the cartridge system|
|Rewind time||29 seconds|
|Initialisation time||15 seconds|
|Search speed||60 inches per second|
|Read/write speed||10 inches per second|
|Tape length||43 metres (140 feet)|
|Number of tracks||2 independent tracks|
|Typical tape capacity||780 program records (195K bytes) 850 data records (210K bytes)|
|Tape directory capacity||42 files (directory entries)|
|Typical access rate (search speed)||7,800 bytes/second|
|Typical transfer rate||650 bytes/second|
|Typical tape life (continuous use)||50 to 100 hours|
|Typical error rate||<1 in 10^8 (that’s less than one in every 100 million!)|
|Table 4. Data security types and what they do|
|0||LIST, PLIST and edit|
|1||STORE (duplication), LIST, PLIST and edit|
|2||STORE (overwriting), PRINT#, STORE BIN|
|3||CAT (blank name directory)|
|Table 5. Format characters for “pretty printing”|
|n(…)||Parentheses allow field replication n times|
|Z||Digit position or leading zero|
|*||Digit position or leading asterisk (*)|
|D||Digit position or leading blank|
|.||Decimal point (.)|
|S||Sign (+ or -)|
|M||Minus sign or blank|
|E||Exponent in form ESDDD|
|K||Use default format|
|R||Comma radix (,)|
|/||Carriage return/line feed|
|Table 6. The graphics commands|
|ALPHA||Sets the display to alphanumeric code|
character string, number of characters per line
|Plots a group of dots on the graphics display as specified by the character string.|
|DRAW x-coordinate, y-coordinate||Draws a line from the current pen position on the graphics screen to the x,y coordinate position specified.|
|GCLEAR(y)||Clears the graphics screen from the specified y value to the bottom of the screen, or the entire screen if no parameter is specified, in current pen colour.|
|GRAPH||Sets the display to graphics mode.|
|I DRAW x-increment, y-increment||Incremental draw. Draws a line from the current pen position to the position determined by incrementing the current pen coordinates by the specified increment values.|
|IMOVE x-increment, y-increment||Incremental move. Moves the pen from the current pen position to the position determined by incrementing the current pen coordinates by the specified increment values.|
|LABEL character string||Writes a character string on the graphics display at the current pen position.|
|LDIR numeric expression||Label direction. Specifies the direction for labels in graphics mode. Horizontal labels are specified by values less than 45. Vertical labels are specified by values greater than or equal to 45. Default label direction is horizontal.|
|MOVE x-coordinate, y-coordinate||Moves the pen to the specified coordinate position without drawing a line on the graphics display.|
|PEN numeric expression||Specifies whether the plotting is done with white dots or black dots. When the expression is positive, a white dot is specified; when it is negative, a black dot is specified.|
|PENUP||Lifts the pen; inhibits line generation.|
|PLOT x-coordinate, y-coordinate||Moves the pen from the current point to the specified location, drops the pen, and makes a dot. If the pen was down, draws a line from current point to specified point|
|SCALE x min, x max, y min, y max||Scales the graphics display in user-defined units. Default values are 0,100, 0, 100.|
|XAXIS y-intercept [, tic spacing [, x min, x max]]||Draws a horizontal axis on the graphics display. Tic marks and initial and final x values can be specified. Positive tic parameters specify the left side of the screen as a reference, negative tics specify the right side as a reference.|
|YAXIS x-intercept [, tic spacing [, y min, y max]]||Draws a vertical axis on the graphics display. Tic marks and initial and final y values can be specified. Positive tic parameters specify the bottom of the screen as a reference, negative tics specify the top of the screen as a reference.|
First published in Computing Today magazine, June 1980