H P - 2 8 C N O T E 2 Subject: A collection of notes about the HP-28C Author : Wlodek Mier-Jedrzejowicz No more members have admitted to owning a 28C, so here again is a collection of notes rather than one long article. Many thanks to all who have provided ideas and suggestions. Please send in ideas, and do let us know if you join the ranks of the 28C owners. Among the HP-28C items that CHHU has (see News and Views) is a description by Bill Wickes who was its Product Manager. Written last November, it has still not been published! However HP gave a copy to PPC Paris, who published a French translation in their Jan/Feb journal. A summary is included below. Maybe CHHU or HP will eventually get round to letting us see the original English text. I have also received a very extensive review from Jean-Daniel Dodin, leader of the Toulouse club. As they are no longer publishing a regular journal, he has sent me his review and invited me to print a translation in DATAFILE. Given the time, I shall translate it, in the meantime I would be happy to send a copy of the French original to anyone who asks me for one. In his article Bill Wickes first gives an overview of the 28C, and of its origins as a project to follow the HP-41 and the HP-71/FORTH products. The developments first led to a general concept, then to the HP-18C, and finally to a calculator whose language combines features of the FORTH and LISP languages. He calls the resulting language RPL - Reverse Polish LISP (as if an ordinary Polish lisp wasn't bad enough - I should know!). The calculator behaves in many ways like a classic RPN machine, but it follows FORTH in that far more of the instructions use the stack and reverse notation. It follows LISP in its use of "objects" rather than numbers, in its handling of lists, and in the use of lambda variables (which become "local variables" on the 28C). All this is built around a Saturn processor; like the HP-71B CPU, but with an extra instruction: PC=(A) which speeds up use of the internal bus. As for the symbolic algebra features, they never had the intention of providing the features of MACSYMA or REDUCE (two well-known symbolic algebra programs used on mainframe computers), nor even of a PC running at 5MHz with an 8087 maths co-processor - they just wanted to provide symbolic algebra at the same level as earlier HP calculators supported numerical calculations. They did not plan to produce an algebraic logic type of calculator but rather intended to provide the best points of the HP-41 and HP-15C calculators in a more HP-71 - like environment. The HP-41 ability to deal with floating-point numbers and text strings too in the stack was extended to provide a stack able to handle many types of "objects". On the other hand, the limitations of a 4-level stack were removed by the provision of an infinite stack [personally, I don't see how HP can possibly call it an "infinite" stack if the 28C provides the user with only 1680 bytes memory] - this leads to the need for new habits such as using numbers to describe the levels of the stack, remembering to remove unwanted objects from the stack, using new stack control commands, and using the stack to provide arguments for functions such as FIX or SF. This gives additional significance to ENTER and errors are made easier to correct by the provision of UNDO as well as LAST. Bill goes on to describe the new words used to describe HP-28C features, for example "function" now describes only mathematical operations, and other operations carried out by keystrokes are called just that - "operations". Programmable operations are called "commands". He describes how variables can be used in different ways, and how the symbolic algebra features work, including the fact that they allow the 28C to handle algebraic logic as well as RPN. Programming is intended to be carried out simply by "storing" a set of keystrokes for execution at a later time. [I would point out that TI thought of this long ago, which is why they called PROGRAM mode the LEARN mode. In any case, it doesn't work that way since constructs such as WHILE...REPEAT or ABORT are not directly related to any keyboard operations.] A program is actually considered to be no more than a new operation that the user adds to the built-in operations provided by the 28C. This is meant to encourage the writing of short modular programs which can be combined into larger ones, and that is further encouraged by the absence of XEQ, GTO and ISG - you are supposed to use structures such as FOR...NEXT instead. There is also the possibility of using local variables which help in the writing of programs that behave just like built-in functions, and which can be treated as RPL commands and as algebraic commands. Indeed programs and algebraic expressions are stored and evaluated in very similar ways. This leads Bill to admit that the shortage of memory is the 28C's principal limitation - the availability of only 1700 bytes means that one must think of the HP-28C in the same terms as the HP-15C - you can store some data and a few short programs, but in general you should try to use the 28C as an interactive calculator, taking advantage of the very wide range of built-in functions. [In fact this is a view imposed on Bill by the powers that be at HP - see further on in this article, and also the article "Wheels Within Wheels".] Frankly, the 28C is an experiment - the design team have many ideas as to how the product could be improved and upgraded but first of all they need to see how the market responds to the 28C. This has sufficient new possibilities that users will be able to invent and exchange tips and ideas, which is just where the user clubs come into their own. After the announcement of the 28C Bill Wickes did a round of lectures to user clubs and other organisations. He repeated much of what he wrote in his description, and expanded on it. He carries around a 28C with its back removed, a 71 board added in to hold chips which provide a total of 64K user memory, and an 18C back put on over that for protection. This makes his 28C much thicker than others, so he cannot fold the left-hand keyboard underneath - but he does have the sort of memory that he thinks makes the 28C really useful. Jake Schwartz has sent me a video film of one of Bill's lectures from Philadelphia. If this ever reaches me (the Post Office have had it for 8 weeks now) I hope to show it at one of the London meetings. Bill does not answer many questions about the 28C internals, nor about future products, but Jake Schwartz tells me that information about SYSEVAL is likely to be released by HP piece by piece. The reason why HP have not immediately released all the SYSEVAL entry points is that Technical Support are scared stiff of being inundated by questions - they reckon that they will be safer if they release the information a little at a time. Of course, the NOMAS agreements between HP and the user clubs arranged by Richard Nelson were designed exactly to avoid this sort of problem, but HP aren't being helpful this time. In the absence of information from HP we are carrying on trying to discover things for ourselves. Our R&D fund has collected nearly enough to cover the cost of a 28C (but more contributions are still needed) - we have bought one, taken it to pieces, taken photographs, clipped it together again just to show it still works, then taken it to pieces again. The CPU timing circuit is very similar to that on the HP-71B, so it should be possible to speed up the 28C. There is just about enough room inside to add a couple of extra RAM memory chips. We have identified some of the connections - such as data and strobe lines, but do not yet know where to connect in extra memory. At present we are trying to read out the contents of the HP-28C ROMs. Many thanks to Colin Crowther for providing the 28C, to Ian Maw and Mark Cracknell for helpful suggestions, to Rabin Ezra for taking the 28C apart, and to Zengrange (particularly Graeme and Roger) for doing all the serious work on the circuits. Brian Walsh tells me that S.O.S. (David White's company in California) plan to offer memory expansion for the 28C - installing the memory from HP-71B 4K or 32K RAM modules inside your HP-28C, or selling you one with the extra RAM installed. David does not take the whole 28C apart - he just cuts a hole in the back of the case to put in the extra memory. The service will not be cheap - buying and installing one extra 4K module will cost $100. The speed of a few operations falls as the memory increases - maybe that is why the 28C has so little RAM. Mark Cracknell has made some 28C speed tests of his own. He wrote programs which loop and repeatedly add 1 to register X/level 1 on an HP-29C and a 28C. This is the same test as I described in V6N2p19 under point 2. On a 29C (remember the 29C?) a LBL 1 + GTO 1 loop counted to 714 in 100 seconds, and a 28C FOR...NEXT loop counted to 6393 in 100 seconds - nearly 10 times faster. Most users could therefore live with some slowing down due to extra RAM memory, and those who couldn't would probably be able to get their 28C CPU clock speeded up at the same time as the RAM was built in. One of the things the 28C is particularly slow at is displaying the stack, especially if some of the objects are long lists, matrices, algebraics or programs. A stack with many objects also slows down the display. Apparently the 28C examines every object in the stack each time the stack is altered. There does not seem to be any separate display memory - instead the 28C seems to use a scratch area below the stack to create the display of each object. With 64K bytes of user memory, you could put an awful lot of objects into the stack and REALLY slow down your 28C. You could also store a huge number of named objects - if you want to store a lot of information then you should read page 361 of the Reference Manual; this describes how you can use arrays or lists to let you store data in the same way as in numbered registers on an HP-41. To speed up a simple calculation such as: 172.58 ENTER 243.1 * you can replace ENTER with some other "separator". The manuals mostly follow FORTH in using SPACE as a separator, but page 33 of the Reference Manual says that NEWLINE and comma can also be used. Thus: 172.58 , 243.1 * is faster, because the 28C does not have to rearrange the stack display as it would after ENTER, and because comma is closer to the number keys than ENTER. Bruce Bailey recently wrote to me from the USA and commented on the sometimes unhelpful behaviour of LAST. His particular complaint was that DROP saves the contents of level 1 in LAST, so it is not possible to do things that could be done on the HP-41 - for example CLX, enter a new number, LASTX, * could be used repeatedly on an HP-41 to multiply different numbers by a constant. On a 28C the present contents of level 1 saved by DROP replace the value that you would have wanted to use for the next multiplication. Of course, you can still do this on a 28C by writing and storing a program which does << constant * >> but this not as simple. Can anyone suggest a way of doing DROP without changing the contents of LAST? A quite ridiculous result of this behaviour is that DUP (or ENTER used as DUP) copies the content of level 1 to level 2, and also copies it to LAST - you certainly have no need of that object in LAST if you have still got a copy in level 1. In any case UNDO could be used to cancel the effects of DROP or DUP, letting LAST be used as on earlier calculators - to let you correct mistakes in mathematical operations. A further point observed by Bruce is that A B 2 ->LIST saves only the 2 in LAST, not the A and B. The manuals do not directly explain this, but on page 362 of the Reference Manual it is said that LAST can only return 1, 2 or 3 objects to the stack because no command uses more than three arguments. In fact several commands take a variable number of arguments; ->LIST is one, ->ARRY is another, ROLLD, DUPN, DROPN are three more. All these commands use a number n in level 1 and operate on n more objects in the stack. Since LAST can store a maximum of three objects, it reacts to all these commands by saving only the value n from level 1. The point about LAST is that the HP-28C uses it to restore the stack after errors in commands which remove objects from the stack. If, for example, an arithmetic operation detects a "Bad Argument Type" then it will try to restore the stack using LAST. If LAST is disabled then you lose the objects that caused the error. LAST is used for this purpose rather than UNDO because UNDO uses far more memory and is therefore much more likely to have been disabled by the user. Unfortunately this has a further awkward effect - arguments have to be stored in LAST before a command is carried out, so even if the command fails to work (as in the example above) its arguments are saved in LAST and replace the arguments of a previous successful command - quite unlike the HP-41 - would you expect ALPHA, ABC, ASTO X, ALPHA, SIN, to store "ABC" in register L? One more important point about LAST - you can disable it from a program by clearing flag 31 to save space and time. Then if you know an error can be expected at some point in a program you can re-enable LAST by setting flag 31, carry out the operation that might give trouble, knowing that LAST will let the 28C recover any incorrect arguments, and later clear flag 31 again. This sort of operation is particularly useful inside an IFERR...THEN...ELSE clause where you would lose the incorrect argument before you reached THEN unless flag 31 was set. One more warning - LAST is affected by "commands" but not by "operations" which are not commands (i.e. non-programmable commands - see page 24 of the Reference Manual for an explanation of the difference). This means that CLEAR does not save anything in LAST, neither does ENTER if it is used to copy the command line to level 1 - but if ENTER is used to copy something from level 1 to level 2 then it is actually executing the DUP command and then it does affect LAST. As I wrote last time - take care with ENTER - and take even more care with LAST! Frank Wales has told me of one oddity. Press SHIFT ON to turn off the 28C, then press ON and keep the key down for about a second. Then release the ON key and press SHIFT. There is a 50% chance that the 28C will turn off. If it does not, press ON again - this will turn off the 28C, then press ON again to turn it on and keep the ON key down for a second again. Now press SHIFT again and the 28C will turn off this time. The odd behaviour occurs every second time. Because you kept the ON key down after turning the 28C on, it assumed you wanted to use it as ATTN to interrupt something. But there was nothing to interrupt - so the ON key was stored (in the key buffer?). When you pressed SHIFT, the ON key was found, and the 28C assumed you had pressed SHIFT ON to turn it off. You can press other keys instead of SHIFT when the 28C is in this state - digit and letter keys cause the corresponding character to appear in the command line for a moment, then the character vanishes - as if you had pressed ATTN. Single step operations execute normally, unless they encounter an error, in which case the error message appears for just a moment, then disappears - as if you had pressed ATTN. Programs and longer operations such as DRAW start up, but then stop at once - again as if you had pressed ATTN. Can anyone think of a use for this? I would very much like to use it to produce a programmable OFF function. Neville Joseph points out that the brave souls who use SYSEVAL may find it quicker to press SHIFT, CATALOG, T, PREV, FETCH than to spell out SYSEVAL. Another tidbit - #28C, SYSEVAL produces a continuous tone which is interrupted when you press any key (except ATTN) - you can use this to test your keyboard. Note that many SYSEVAL operations behave differently when executed from a program - this is one such operation. Oh, and when using #123E, SYSEVAL to read the system clock, remember to set the binary word size to 64, otherwise you will not read the full clock value. It may be that the clock bug I reported last time was due to people using #123E with a wordsize so small that the clock was apparently cycling every few days. One member who reported serious problems with the clock finally found these were due to a faulty memory (the 28's, not his). Finally, don't take this issue's cover too seriously. Remember it is an April issue. Till next month, have fun with your HP-28C!